我将一个名为“CustomerId”的参数传递给晶体报告('.rpt')文件,基于其生成报告的参数。当我将此报告('.rpt')加载到水晶报表查看器时,它正常工作......
但我有不同的“CustomerId”。我需要根据参数生成报告并将它们加载到单个报告查看器中。 ,而不是逐个单独查看它们,我想将它们全部视为单页报告查看器。
任何人都可以告诉我如何解决这个问题....
答案 0 :(得分:2)
您需要将CustomerID参数设置为接受多个值。同时按客户创建一个组,并在组
中的最后一个部分之后设置开始新页面答案 1 :(得分:1)
为每个报告创建一个报告查看器。然后报告查看者在选项卡控件上添加标签页。
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];
}
}