Crystal Report Asking parameter again - asp.net

Dear all I am working on an asp .net application in which I am using crystal report for showing reports.
In my application everything works fine including the reports. The real problem comes when I start clicking on the crystal report toolbar. If I click on any buttons on the crystal report tool bar like (Export, next page ...etc.) it is asking parameters again. Is there any way so that that the crystal report viewer does not ask the parameter that I have already given ?
I have also given true for the property reuseparametervaluesonrefresh. i am passing parameters to the report document.
ReportDocument rd = new ReportDocument();
rd.SetParameterValue("#Date", Request["Date"]); CrystalReportViewer1.ReportSource = rd;

try to change Crystal Report Parameter type from Date to String.

Related

ASP.Net (VB) Report View Data set Dynamically

I am having a hard time with this one and I assume it is something I am missing as always.
I am using Visual Studio Web Express 2012. I have installed Report Builder and Report Viewer 11. I have created a generic report file in the report builder as I can not seem to view any designer view in Visual Studio. Not the issue. I am pulling data from my SQL database as usual and populate a dataset. All is fine from here. I can not seem to get the data to show in the report view but can not figure out what I am missing. I have looked everywhere on the web as well as Stack specifically. I have used some of the sample codes and have gotten the report to now show up but still no data. Any help would be great.
I create a generic report file in report builder. No fields, no title etc., just the generic report. This may be my issue but I can not seem to figure out what I am missing.
On my page load I populate the dataset as always with no problem as I can display the data in a label etc.
I add the report viewer to my page and add the following code to the page load after the dataset fill. I also noted that you must use if page.postback = false as Ajax seems to not like it otherwise and just seems to loop and continue loading forever.
I have tried many different code ideas but found I finally got the report to load (again no data) with the following.
rv1.Reset()
rv1.LocalReport.DataSources.Clear()
Dim rds As New ReportDataSource("DataSet1", tempDS.Tables(0))
rv1.LocalReport.ReportPath = Server.MapPath("\tests\test.rdl")
rv1.LocalReport.DataSources.Add(rds)
rv1.LocalReport.Refresh()
Again this is VB.Net webpage. What am I missing? Thanks in advance.
Did you bind the datasource? Sorry if i'm wrong, but in C# asp.net you need to bind the datasource after using an atribution.

can't show a stimulsoft report more than 1 time

I've created a simple report in vs.net 2008 with stimulsoft report 2013.
I'm using these codes to show report:
StiReport1.RegData(ds)
StiReport1.Render()
StiReport1.Show()
when I click on the button I Can see the report correctly for the first time.
but when i close the reportviewer's Windows and click on that button again the
report is empty (I can see the header or footer but no data loaded on the report)
I think the report data not load again or something saved on cache.
please Help.
Thanks
SOLVED
Try this code. its work for me
StiReport1.Dictionary.DataStore.Clear();
StiReport1.Dictionary.Databases.Clear();
StiReport1.Dictionary.DataSources.Clear();
StiReport1.BusinessObjectsStore.Clear();
StiReport1.RegData(ds)
StiReport1.Dictionary.Synchronize();
StiReport1.Compile();
Try this method:
StiReport1.ResetRenderedState();
The problem solved.
I should just save the report and load it each time:
Dim rpt As Stimulsoft.Report.StiReport = New Stimulsoft.Report.StiReport
rpt.Load("report/MyReport.mrt")
rpt.RegData(ds)
rpt.Render()
rpt.Show()
You need to reset your Viewer before rendering. Use ResetReport() function before Reg and Render codes.

Crystal report with subreport export to excel fails

I'm working on a ASP.Net web application in Visual Studio 2010. I'm working on a report designed in SAP Crystal Reports for VS2010.
I'm able to export the report to PDF and Word formats, but when I try to export it in Excel format, the Visual Studio debug just stops, and the response is never returned.
I'm using Crystal Reports for Visual Studio 2010, and the report in question has a simple subreport (nothing but a single label) in Section 1 (Report Header).
using (TestReport report = new TestReport()) // TestReport inherits ReportClass
{
TestDataSet data = this.GetData();
report.SetDataSource(data);
return report.ExportToStream(ExportFormatType.Excel);
}
The report.ExportToStream(ExportFormatType.Excel); fails and the debug just stops. If I remove the subreport it works OK, but otherwise it fails.
I managed to fix it by replacing the output format enum value from to Excel to ExcelWorkbook...
Code:
using (TestReport report = new TestReport()) // TestReport inherits ReportClass
{
TestDataSet data = this.GetData();
report.SetDataSource(data);
return report.ExportToStream(ExportFormatType.ExcelWorkbook);
}

Crystal Reports - Data missing when exporting to (PDF or excel or word)

I'm trying to either print or export some Crystal Reports in asp.net
web application. The reports were made with CR 10.5, get their data
from an SQL Server 2008 database.
When I print or export to PDF, a bunch (but not all) of the fields are
skipped. I've
confirmed that the reports work fine in the viewer and designer, but
not when trying to view or export
1) Some fields are always skipped.
2) The same fields seem to be skipped.
Any suggestion or help is appreciated.
try this...
bind your crystal report viewer in page_init() method or check your page postback event...

"Missing Parameter Values" error on moving to next page of report

I am writing a web application using ASP.NET 2.0 [Visual Studio 2005 Professional Edition].
I have a Crystal Report that is connected to a stored procedure residing in SQL Server. This stored procedure accepts a parameter and therefore I have a formula in my report's hyperlink section to pass the parameter via Query String.
Everything works fine except when I click the navigation buttons to move to the next page of the report, I either get an error or Crystal Reports shows an input box to enter the parameter values.
The error shown is: "Missing Parameter Values". Only this error is shown and nothing else. If I try to export the report by selecting Export option on the Crystal toolbar, it opens a page and asks for the parameter values.
I am not following why parameter values disappear when either I move from the first page to the other or try to export the report?
Most likely you are setting the parameters in the report viewer instead of the report object. If the parameters are set in the report object they should persist on navigation. If you still have issues create an event handler for the report viewer's 'Navigate' event and reset them.
Aditionally, if you call report.Refresh() or report.VerifyDatabase() after you set parameters it clears the values so be aware of that,
MD
When we click on report navigatin button, print button page is refeshed and we facing with 'missing parameter values error '
My probem is solved by using below line of code.
If Not Page.IsPostBack Then
CrystalReportViewer1.ParameterFieldInfo = paramFields
CrystalReportViewer1.ReportSource = myReportDocument
CrystalReportViewer1.DataBind()
Else
CrystalReportViewer1.ReportSource = myReportDocument
CrystalReportViewer1.DataBind()
End If
where paramFields are runtime created ParmeterFields
Best Regards,
Vinay Shukla

Resources