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.
Related
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.
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.
Is it posible to put crystal report file in some site, like :
http://localhost/DocumentRPT/ProductPerTenorByProductID.rpt
And then, I executed with
ReportDocument.load(serverPath)
Or, any suggestion in common publishing method?
Many thanks for the answer.
there is property of report viewer ReportPath you can assign it from code behind
ReportViewertrans.LocalReport.ReportPath = HttpContext.Current.Server.MapPath("Your path to rpt");
or
report.Load(Server.MapPath("Report1.rpt"))
I have created a report with C1Report Designer and show this report in a web form with the C1ReportViewer.
The report works fine, but if I add a chart control in the report, the error message "File is not a valid C1MDX file" appears.
If I show the preview in the report designer, I see the result without error.
How can I use a chart in my report?
Thanks
Peter
You need to add C1Chart.x.dll and C1.C1Report.CustomFields.x.dll (where x is .NET framework ver 2 and 4) in your application to display charts.
Thanks,
Richa
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