tknudsen-qec
asked on
.NET ReportViewer
I'm using a ReportViwer. It works fine the first time it binds data, but if the criteria (parameters or FilterExpression) change on a postback, the data pulled doesn't change accordingly.
My changing paramaters are datevariable1 and datevariable2, which change depending on user input.
Rather than keep smashing my forehead off my desk I figured I might as well see if any EXPERTS had a notion what I'm doing wrong.
Please assist!
My changing paramaters are datevariable1 and datevariable2, which change depending on user input.
Rather than keep smashing my forehead off my desk I figured I might as well see if any EXPERTS had a notion what I'm doing wrong.
Please assist!
ReportViewer ReportViewer1 = new ReportViewer();
ReportViewer1.LocalReport.ReportPath = "Report1.rdlc";
ObjectDataSource ODS = new ObjectDataSource("GraphTest.ValuesByDateDataSetTableAdapters.vValuesByDateTableAdapter", "GetDataByDateRange");
ReportDataSource RDS = new ReportDataSource("ValuesByDateDataSet_vValuesByDate", ODS);
ODS.SelectParameters.Add("Start", datevariable1.ToString("d"));
ODS.SelectParameters.Add("End", datevariable2.ToString("d"));
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(RDS);
PlaceHolder1.Controls.Add(ReportViewer1);
you close the report viewer after displaying the report and load as a fresh viewer for the filtered data.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
samsymon,
Thanks kindly for your reply. I'm not clear on whether your comment was a suggestion on what I'm doing wrong or what I could do right, sorry :(
I seem to have found a workaround solution for now however.
Thanks again.
Thanks kindly for your reply. I'm not clear on whether your comment was a suggestion on what I'm doing wrong or what I could do right, sorry :(
I seem to have found a workaround solution for now however.
Thanks again.
Try the following function
ReportViewer1.RefreshRepor t();
ReportViewer1.RefreshRepor
ASKER
Hi greatsubash,
Thanks for your reply. For the webforms version of the ReportViewer class, RefreshReport is an event, not a method, and I don't see how I would handle it to fix this.
Thanks
Thanks for your reply. For the webforms version of the ReportViewer class, RefreshReport is an event, not a method, and I don't see how I would handle it to fix this.
Thanks
ReportViewer1.LocalReport.