0
有谁知道如何在一个应用程序中使用多个.rpt文件(水晶报告)?我需要生成报告并直接保存到.pdf,但我不知道如何去做。当我使用单个.rpt文件时,我设法做到这一点,但我不确定如何生成具有多个.rpt文件的报告。有人能帮助我吗?如何在一个应用程序中使用多个.rpt文件(水晶报告)?
我的编码:
ReportDocument cryRpt = new ReportDocument();
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
ConnectionInfo crConnectionInfo = new ConnectionInfo();
Tables CrTables;
cryRpt.Load("C:\\rptBilling.rpt");
crConnectionInfo.ServerName = "ServerName";
crConnectionInfo.DatabaseName = "DatabaseName";
crConnectionInfo.UserID = "userID";
crConnectionInfo.Password = "Password";
CrTables = cryRpt.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
{
crtableLogoninfo = CrTable.LogOnInfo;
crtableLogoninfo.ConnectionInfo = crConnectionInfo;
CrTable.ApplyLogOnInfo(crtableLogoninfo);
}
cryRpt.SetParameterValue("@CollectionStartDate", "2011/09/14");
cryRpt.SetParameterValue("@CollectionEndDate", "2011/09/29");
cryRpt.SetParameterValue("@SpokeCode", "14");//country code
cryRpt.SetParameterValue("@UseCollectionDate", "1");//value can be set 0 or 1
cryRpt.SetParameterValue("@UseUploadDate", "0");//value can be set 0 or 1
cryRpt.SetParameterValue("@UploadStartDate", "2011/09/23");
cryRpt.SetParameterValue("@UploadEndDate", "2011/09/23");
cryRpt.ExportToDisk(ExportFormatType.PortableDocFormat, "e:\\1.pdf");
没有ü意味着,我需要为每个RPT文件的另一个功能?例如:public static void BillingReport(),public static void AgingReport() – srahifah