Click here to Skip to main content
15,867,330 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone,
I am trying to integrate SSRS report in to the Asp.net web site, back-end C#.
I have report which contains the sub-report. Main report shows the car owners list and subreport will show the list of cars of particular owner's on owners name click. It is working fine in SSRS, but I am not able to integrate it into the web site.
I get success till the load of main report but on click of Owner name subreport is not loading and it shows the error like A data source instance has not been supplied for the data source 'CarOwnerList'. 'CarOwnerList' is a dataset for main report. I have used SubreportProcessing event handler.
Posted
Comments
Bhushan Mehetre 29-Jul-14 9:23am    
Here is the code of loading report

try
{
rptv.ProcessingMode = ProcessingMode.Local;
rptv.LocalReport.ReportPath = Server.MapPath("~/SSRS Reports/SRE Main.rdlc");
DataSet ds = fillCarOwnersDetals("SubReport");
ReportDataSource rds = new ReportDataSource("CarOwnerList", ds.Tables[0]);
rptv.LocalReport.DataSources.Clear();
rptv.LocalReport.DataSources.Add(rds);
}
catch (Exception ee)
{
lblStatus.Text = ee.Message.ToString();
}

fillCarOwnersDetals() is the function which fills the data into the dataset.

SubreportProcessing handler code
e.DataSources.Add(new ReportDataSource("OwnersCar", fillsubReportDataset(Convert.ToInt16(e.Parameters[0].Values[0].ToString())).Tables[0]));
Bhushan Mehetre 29-Jul-14 9:48am    
No this is not the case...
Actual working of the report is like, On main report in table I will get one table that is contains columns "Owner Name", "Address", "Contact", "Email", "Active".
Down to this table there is a sub report which contains the columns like "Car No", "Rent Agreement Id", "Engine No", "Car Condition", "Car Make".

At the time of load only main report is loaded. subreport is empty thats why it is subpressed. On click of column "Owner Name" from the main report. It get the id of owner and pass it to the subreport and subreport dataset is filled on the basis of owner id. After successfull fill it shows the subreport with data.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900