Last post Aug 07, 2012 02:33 AM by Ken MacLeod
Aug 06, 2012 03:40 PM|Ken MacLeod|LINK
I have reportviewer controls running in local mode. These are being controlled successfully by cascading dropdownlists. I now wish to initialise the reportviewer controls by assigning a report and a datatable on page load. However, the viewer is being
The code in page_load is:
ReportViewer rV1 = ReportViewerTopLeft;
tA1 = new DataSetX01ATableAdapters.vwExtract02_StockCountEaTableAdapter();
newSCTable1 = tA1.GetDataX01A("All", "All", "All", "All");
rV1.LocalReport.ReportPath = "ReportX01.rdlc";
DataTable dt1 = (DataTable)newSCTable1;
rV1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt1));
This is basically the same as is used by the cascadingdropdown lists except the parameter values and the report name are hard coded.
Any thoughts on the problem?
Aug 06, 2012 10:06 PM|santa_1975|LINK
Try the below code.
Hope this helps.
Aug 07, 2012 12:59 AM|Ashutosh Pathak|LINK
right, use it:
Aug 07, 2012 02:33 AM|Ken MacLeod|LINK
You are right that this line was missing. There were a couple of other problems to do with parameters.
What made me miss the obvious points was that it remains the case that there is a problem with a report viewer sometimes failing to render. I don't know whether this is a problem others have found.