Кто-нибудь знает, как использовать несколько файлов .rpt (Crystal Reports) в одном приложении?Мне нужно создавать отчеты и напрямую сохранять в .pdf, но я не уверен, как это сделать.Мне удается это сделать, когда я использую один файл .rpt, но я не уверен, как создать отчет с несколькими файлами .rpt.Может ли кто-нибудь помочь мне с thid?
Моя кодировка:
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");