整体思路同aspx+rpt实现网页打印,但是,Microsoft.Reporting的处理模式与CrystalReport稍有不同
1、自定义控件部分 public partial class RDLViewer : System.Web.UI.UserControl
{
LocalReport lr;
protected void Page_Init(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
}
}
protected void Page_Load(object sender, EventArgs e)
{
}
public void configReport(DataSet dateSet, String reportName)
{
ReportViewer.ProcessingMode = ProcessingMode.Local;
lr = ReportViewer.LocalReport;
lr.ReportPath = reportName;
lr.DataSources.Clear();
for (int i = 0; i < dateSet.Tables.Count; i++)
{
ReportDataSource rds = new ReportDataSource(dateSet.Tables[i].TableName, dateSet.Tables[i]);