Click here to Skip to main content
15,907,493 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,im new to Sharepoint 2013.I am trying to create an rdlc report using the report viewer.my issues are the following:

1. As soon as i place the report viewer control it throws an error :"report viewer failed to modify the web config.reports may not display correctly.Configuration file not found.Parameter webConfigpath". but on clicking ok im able to work further.I dont know if this is an issue.im able to view my webpart.

2. Im not able to view my report.there are no errors in code,but after execution it shows a msg : "A data source instance has not been supplied for the data source 'Dataset1'".

this is the code given for binding code to report:

C#
//ReportData is a userdefined function

DataTable reportdt=ReportData();          
ReportDataSource dsrpt = new ReportDataSource();
dsrpt.Name = "Datasetpagename_NameofdatatableinDatasetpagename";
dsrpt.Value = reportdt;

string s1;
s1 = reportdt.Rows[0]["C1"].ToString();
//   s2 = dt.Rows[0]["C2"].ToString();

try
{
   if (dsrpt != null)
   {
      ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/_LAYOUTS/15/SampleReport/SampleReport1.rdlc");
      ReportViewer1.LocalReport.EnableExternalImages = true;

      ReportViewer1.Visible = true;
      ReportViewer1.LocalReport.ExecuteReportInCurrentAppDomain(System.Reflection.Assembly.GetExecutingAssembly().Evidence);

      ReportViewer1.LocalReport.DataSources.Clear();
      ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("SampleReportDataSet", reportdt));

      Microsoft.Reporting.WebForms.ReportParameter[] reportParameterCollection = new Microsoft.Reporting.WebForms.ReportParameter[1];

      reportParameterCollection[0] = new Microsoft.Reporting.WebForms.ReportParameter();
      reportParameterCollection[0].Name = "ProjectName";
      reportParameterCollection[0].Values.Add(s1 == null ? "" : s1);
      reportParameterCollection[0].Visible = false;

      ReportViewer1.AsyncRendering = false;
      ReportViewer1.SizeToReportContent = true;

      ReportViewer1.LocalReport.Refresh();
   }
}

Please help me..its very urgent..
Posted
Updated 3-Jun-14 0:51am
v2

1 solution

I have solved the issue..

u can check this link if in case anyone of u come across such a problem

http://www.aspsnippets.com/Articles/ASPNet-Report-Viewer-control-Tutorial-with-example.aspx[^]


Thank you
 
Share this answer
 
v2

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