Click here to Skip to main content
15,883,745 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

i want to know how create report using RDLC by accessing stored proc.Please guid me with an example.
Posted

1 solution

You're question indicates a lack of knowledge about SSRS. An RDLC file is simply the file generated by the report designer with the database connections removed. Therefore a stored proc is not valid. You need to get the data in your code and serve it to the report as a datasource.

RDLC is used as an embedded report whereas RDL is a server based report that may contain links to the database.

I suggest doing a lot more reading and working through the examples[^] available
 
Share this answer
 
Comments
ks ravi 18-Oct-11 2:48am    
Thanks for the reply,Even i have tried it in visual studio with below coding,...


con.Open();
SqlCommand cmd = new SqlCommand("OnlineReports", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Clear();

cmd.Parameters.AddWithValue("@movie_ShowDate", Convert.ToDateTime("03/10/2011"));
cmd.Parameters.AddWithValue("@movie_ID", 70);
cmd.Parameters.AddWithValue("@show_ID", 2);
cmd.Parameters.AddWithValue("@class_ID", 1);




DataSet1 fd = new DataSet1();
DataSet1TableAdapters.OnlineReportsTableAdapter dds = new WebApplication1.DataSet1TableAdapters.OnlineReportsTableAdapter();
dds.Fill(fd.OnlineReports, Convert.ToDateTime("03/10/2011"), 70,2,1);


//SqlDataAdapter adptr = new SqlDataAdapter(cmd);
//DataSet ds = new DataSet();
//adptr.Fill(fd,"OnlineReports");

//DataSet2.OnlineReportsDataTable fd = new DataSet2.OnlineReportsDataTable(ds.Tables[0]);

ReportDataSource dataSource = new ReportDataSource("OnlineReports", fd.Tables[0]);


ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(dataSource);
ReportViewer1.LocalReport.Refresh();


But while run dis i'm geeting this error,
A data source instance has not been supplied for the data source 'DataSet2_OnlineReports'.

plz reply wit an example,,
Mycroft Holmes 18-Oct-11 3:25am    
So name the ReportDataSource with the name it is asking for DataSet2_OnlineReports instead of OnlineReports. This is a typical undocumented black hole that gets us all!

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