Last post Sep 05, 2011 04:27 AM by AMJAD_BL3AWY
Apr 27, 2010 09:47 AM|serg.jn|LINK
After some internet sifting i found how to create a crystal report using the disconnected model and learnt how to pass parameters to it.
In my report am suplying a range of dates to select data inside the range; when the report only has one page (or the first of a multi paged) everything works like a charm. The problem is when i naviagate the report using the default toolbar buttons on the
crystalreportviewer, the report asks for the very same parameters ive set in code behind.
I was using queystring parameters to pass the parameters (i have a page where you pick the report types and another which has the reportviewer and displays the reports previously selected)
and i thought that they got lost because when you click next/previous there is a postback...switched to session variables and it is still the same.
1: How can i solve this?
2: Is there a way to cache all the report so that navigation doesnt require database access?
3: How can i open the reports without any browser controls /toolbars?
//code from the page where the parameters are set
Apr 27, 2010 12:57 PM|Satish SG|LINK
the behaviour you see with the RefreshReport method is by design. msdn describes if functionality as follows on
"This method will refresh the data for the report currently displayed in the viewer. Any parameters or logon information, needed by
the report, will be prompted for."
So instead I would try to refresh the report itself (not the viewer), pass the parameters to it and then pass the report to
something like this
ReportViewer.ReportSource = rptLowStock
Apr 28, 2010 03:35 AM|cvshivan|LINK
My suggetion is to use a seperate page for the criteria and a popup window for the report [ report viewer is placed in this window]
Apr 28, 2010 05:23 AM|serg.jn|LINK
will give it a go in a moment, will post back the results
it eludes me why the same report would ask for parameters if am just browsing an already generated data set...but what the hell.
Am doing exactly that. I have a page where the criteria is set (which is where i got the first piece of code from)
and a page which solely hosts the reportviewer, where the second piece of code comes from.
Again, my problem is that when i have a report with 2+ pages am asked for pamareters whenever i switch pages. this behaviour happens on the second page hosting the viewer
Apr 28, 2010 05:58 AM|cvshivan|LINK
Put the second code in Page_Init, remove the IsPostback and try.
Apr 29, 2010 05:00 AM|serg.jn|LINK
the reportviewer itself is proving to be a letdown. will persuit a way to show the data as pdf while somehow providing options to convert.
Sep 05, 2011 04:27 AM|AMJAD_BL3AWY|LINK
dear, did you solve this issue?
im having the same issue now.
im using ASP.net 2010 and i have the same problem with one report.
i have tow reports in the first one im passing the parameter without any problem.
but in the 2nd one after running the report if i will click on next page or export or anything i think, it will ask for the parameters that i already gave to the report document
this is part of my code where im giving the report document the parameters.
CrystalReportViewer1.ReportSource = crReportDocument
need help please!!!!!!