使用单个Microsoft报表查看器控件生成多个报表 [英] multiple report generation using single microsoft report viewer control
本文介绍了使用单个Microsoft报表查看器控件生成多个报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使用单个微软报告查看器生成5个报告....现在对于每个报告我使用单独的微软报告查看器控制它太难以处理所以任何人都帮助我
i need to generate 5 reports using single microsoft report viewer.... right now for each report i am using separate microsoft report viewer control its too difficult to handle so anyone help me
推荐答案
我为每个报告使用单独的微软报表查看器控件
为什么会这样?只需放置/使用一个查看器,并根据需要将报告源更改为它。您需要在运行时根据您的定义为查看器定义报告。
for each report i am using separate microsoft report viewer control
Why so? Just place/use one viewer and change the source of report to it as per need. You would need to define the report for the viewer at runtime as defined by you.
//This code will define a report at runtime
//Winforms
reportViewer1.Reset();
reportViewer1.LocalReport.ReportEmbeddedResource = "WindowsApplication1.Report1.rdlc";
this.reportViewer1.RefreshReport();
//Webforms
reportViewer1.Reset();
reportViewer1.LocalReport.ReportEmbeddedResource = MapPath("Report1.rdlc");
this.reportViewer1.RefreshReport();
这篇关于使用单个Microsoft报表查看器控件生成多个报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文