使用visual studio 2013在Sharepoint中创建rdlc报告 [英] Creating rdlc reports in Sharepoint using visual studio 2013

查看:80
本文介绍了使用visual studio 2013在Sharepoint中创建rdlc报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Sharepoint 2013的新手。我正在尝试使用报告查看器创建一个rdlc报告。我的问题如下:



1.尽快当我放置报表查看器控件时,它会抛出一个错误:报表查看器无法修改Web配置。报表可能无法正确显示。未找到配置文件。参数webConfigpath。但点击确定我能够进一步工作。我不知道这是一个问题。我能够查看我的网站。



2.我无法查看我的报告。代码中没有错误,但在执行后它显示一个消息:没有为数据源'Dataset1'提供数据源实例。



这是用于报告绑定代码的代码:



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:

//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();
   }
}



请帮助我.. 非常紧急..

推荐答案

我已经解决了这个问题..



u可以检查此链接,以防万一你遇到这样的问题



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





谢谢
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


这篇关于使用visual studio 2013在Sharepoint中创建rdlc报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆