ReportViewer如何在iis中工作? [英] how dos the ReportViewer work in iis ?

查看:95
本文介绍了ReportViewer如何在iis中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个设计好的项目.通过c#. Net-ASP.NET.我已使用
Microsoft报告"ReportViewer控件"
我的问题:将项目发布到iis并使用"ReportViewer"运行报表时
出现的消息是:主报告无法获得资金"
1-是否需要IIS的"Sql Report Service"来运行ReportViewer?
2-我安装的报表服务处于活动状态,但我没有解决问题.
3-请告诉我一个示例或更多设置
谢谢

I have a project that designed. by c #. Net-ASP.NET .I have used the
Microsoft Report "ReportViewer control"
my problem:when publis project to iis and run the report with "ReportViewer"
the message appeard :"Main Report Canot be fund"
1 - is neded "Sql Report Service" for run ReportViewer is IIS?
2 - I installed Report Service is the active , but I did not solve the problem.
3 - Please tell me an example or more settings
thanks

推荐答案

如果您不使用报告服务的服务器部分,则使用的是本地"报告,报告文件必须具有.rdlc扩展名而不是.rdl

使用本地报告时,由您决定是否提供代码中的所有报告数据.设计和测试报告,请小心不要使用数据源名称,因为您将需要使用完全相同的名称来调用数据源.我使用以下代码填充asp reportviewer.

If you are not using the Server part of reporting services then you are using a "local" report, the report file must have an.rdlc extension rather than a .rdl

When using local reports it is up to you to supply all the report data from your code. Design and test the report, make careful not of the data source names as you will need to callyou data sources the exact same name. I use the following code to populate an asp reportviewer.

/// <summary>
/// Put the data and the rdlc file together and give it to the report viewer
/// </summary>
/// <param name="dtData">datatable from the stored procedure used to supply the data</param>
/// <param name="sDataSetName">name of the datasource used in the rdlc</param>
/// <param name="sReportFile">full path of the rdlc file</param>
private void DoStdReport(DataTable dtData, string sDataSetName, string sReportFile)
{
	DataSet oDS = dtData.DataSet;
	oDS.DataSetName = sDataSetName;
	string sPath = Server.MapPath("");
	string sFile = System.IO.Path.Combine(sPath, sReportFile);
	TextReader oTR = File.OpenText(sFile);
	ReportDataSource oRepDS = new ReportDataSource(sDataSetName, oDS.Tables[0]);
	RepView.LocalReport.LoadReportDefinition(oTR);
	RepView.LocalReport.DataSources.Add(oRepDS);
	string s = RepView.LocalReport.DataSources[0].Name;
}


我的问题尚未解决
请帮助我
My problem is not solved yet
please help me


这篇关于ReportViewer如何在iis中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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