向Crystal report viewer添加多个报告 [英] add multiple report to crystal report viewer

查看:75
本文介绍了向Crystal report viewer添加多个报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的带有c#的windows应用程序中,我有许多不同的水晶报告,我想在一个水晶报告查看器中显示它们

In my windows application with c#, I have many different crystal report and I want to show them all in one crystal report viewer

推荐答案

检查:

使用c#<一个水晶报告中的多个报告 [ ^ ]

适用于所有报告Web Appln C#的单晶报表查看器 [ ^ ]

< a href =http://stackoverflow.com/questions/9469157/is-it-possible-to-append-multiple-crystal-reports-in-a-single-viewer>是否有可能附加多个Cry stal在单个查看器中报告? [ ^ ]
Check:
multiple reports in one crystal reports using c#[^]
Single Crystal Report Viewer for All Report Web Appln C#[^]
Is it possible to append multiple Crystal Reports in a single viewer?[^]


为每个报告创建一个报告查看器。然后报告查看者添加标签页

Create a report viewer for Each report. then report viewers add tab pages
     private void FormCrystalRepotViewer_Shown(object sender, EventArgs e)
{
    ReportDocument crReport = crArrReport[0];
    crystalReportViewer.ReportSource = crReport;
    crystalReportViewer.Zoom(100);
    crystalReportViewer.PrintMode = CrystalDecisions.Windows.Forms.PrintMode.PrintToPrinter;
    tcTabControl.TabPages[0].Text = arrRaporlar.Get(0).sReportName;

    for (int i = 1; i < crArrReport.Count; i++)
    {
        crReport = crArrReport[i];
        CrystalDecisions.Windows.Forms.CrystalReportViewer crview = new CrystalDecisions.Windows.Forms.CrystalReportViewer();

        crview.ReportSource = crReport;
        crview.Zoom(100);
        crview.PrintMode = crystalReportViewer.PrintMode;
        crview.ActiveViewIndex = -1;
        crview.BorderStyle = crystalReportViewer.BorderStyle;
        crview.Cursor = crystalReportViewer.Cursor;
        crview.Dock = crystalReportViewer.Dock;
        crview.Location = crystalReportViewer.Location;
        crview.Size = crystalReportViewer.Size;
        crview.TabIndex = 0;
        crview.ToolPanelView = crystalReportViewer.ToolPanelView;
        crview.ShowParameterPanelButton = crystalReportViewer.ShowParameterPanelButton;
        crview.ShowLogo = crystalReportViewer.ShowLogo;

        crview.ReportRefresh += new CrystalDecisions.Windows.Forms.RefreshEventHandler(this.crystalReportViewer_ReportRefresh);

        TabPage page = new TabPage(arrRaporlar.Get(i).sReportName);
        tcTabControl.TabPages.Add(page);
        page.Controls.Add(crview);
        page.AutoScroll = true;
    }
}

private void crystalReportViewer_ReportRefresh(object source, CrystalDecisions.Windows.Forms.ViewerEventArgs e)
{
    e.Handled = true;
    ParametreleriKontrolEt();
    crystalReportViewer.ReportSource = crArrReport[0];
    for (int i = 1; i < crArrReport.Count; i++)
    {
        CrystalDecisions.Windows.Forms.CrystalReportViewer crview = new CrystalDecisions.Windows.Forms.CrystalReportViewer();
        crview = tcTabControl.TabPages[i].Controls[0] as CrystalDecisions.Windows.Forms.CrystalReportViewer;
        crview.ReportSource = crArrReport[i];
    }
}


这篇关于向Crystal report viewer添加多个报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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