如何使用Microsoft报告查看器创建参数化的报告?使用Microsoft查看器的报告
0
A
回答
0
在你的问题中提供更多的细节,但据我所知,MSDN ReportViewer Controls将是非常好的,你自己学习更多。
0
0
一两件事,我会避免在Microsoft报表查看器控件。只需使用浏览器控件,浏览报告,像使用浏览器时那样传递URL中的参数。
这是好多种原因。
- MS报告查看器控件有很多错误,你会被困住。
- 浏览器和报表查看器以略微不同的方式呈现报表,例如边距等。因此,如果您切换到Web应用程序并需要使用浏览器访问报表,则必须调整大部分报表。这让我想到下一个问题。 。 。
- 如果你需要去一个web应用程序,你将需要重新实现你如何调用报告,传递参数等,而不是仅仅使用你已经创建的浏览器功能(你使用控件vs不同的方式访问报告。使用浏览器)
否则,如果你真的想使用报表查看器控件,这里是(使用.NET 2.0)样本:
ReportViewer rvReportViewerControl = new ReportViewer();
rvReportViewerControl.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote;
rvReportViewerControl.ServerReport.ReportServerUrl = new Uri("http://<SERVERNAME>/ReportServer");
rvReportViewerControl.ServerReport.ReportPath = "<FOLDER PATH TO REPORTS>");
rvReportViewerControl.ShowParameterPrompts = false;
Microsoft.Reporting.WinForms.ReportParameterInfoCollection rpInfoCollection = rvReportViewerControl.ServerReport.GetParameters();
if (rpInfoCollection.Count > 0)
{
List<ReportParameter> paramList = new List<ReportParameter>();
foreach (ReportParameterInfo reportParameter in rpInfoCollection)
{
string parameterName = reportParameter.Name.ToString();
string parameterValue = "";
bool isParameterVisible = reportParameter.Visible;
paramList.Add(new ReportParameter(parameterName, parameterValue, isParameterVisible));
}
rvReportViewerControl.ServerReport.SetParameters(paramList);
}
rvReportViewerControl.RefreshReport();
This site有很多有用的信息。
相关问题
- 1. 使用Microsoft报告查看器打印图像
- 2. 使用报告查看器显示Asp.Net中的RDLC报告
- 3. 2使用报告查看器报告中的数据集?
- 4. 使用多个报告的报告查看器
- 5. 报告查看器的iPad
- 6. vb.net报告查看器多个报告
- 7. 使用报告查看器时报告水印消失
- 8. 在asp.net中使用报告查看器生成报告
- 9. 报告查看器与httpOnlyCookies
- 10. 报告查看器在php
- 11. 帮助报告查看器
- 12. 报告查看器打印?
- 13. 报告查看器问题
- 14. 报告查看器X Dapper
- 15. RDLC报表查看器钻取报告
- 16. C#asp.net报告和报表查看器(或的ReportViewer)子报告
- 17. RDLC报告查看器不在报告查看器中显示数据?
- 18. ASP.Net SSRS报告查看器9.0和报告查看器10.0并排
- 19. VS报告 - 报告查看器不适用于ASP:面板
- 20. 使用报表查看器在MVC 4中显示RDLC报告
- 21. 报告查看器不显示使用Sql Server Reporting Services创建的报告
- 22. 是否可以使用单个报告查看器显示不同的报告?
- 23. 如何为不同的RDLC /报告使用一个报告查看器
- 24. 使用主报告查看器来显示RDLC中的所有报告
- 25. 报告查看器与服务器2008
- 26. HTML5的SSRS报告查看器
- 27. 报告查看器IO的工具?
- 28. 在asp.net中的报告查看器
- 29. MVC SyncFusion的报告查看器?
- 30. 报告查看器的点击事件?
做了一些编辑,我的第一个代码不会很正确。尽管现在应该是好的。 – richard