I have a CheckBoxList. If I select two or more values then the CheckBoxList SelectedValues would be passed as a Parameter one by one, and I want to generate the Crystal Report for each SelectedValue in PDF format and I want to merge all the Crystal Report PDF format into a Single PDF format. How to achieve this? So far I have generated only a single Crystal Report in PDF format. In below, I have given the Code about How I had generated the Crystal Report in PDF Format.
CrystalDecisions.CrystalReports.Engine.ReportDocument rpt =
new CrystalDecisions.CrystalReports.Engine.ReportDocument();
string conn = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();
string[] str = conn.Split(';');
string server = str[0].Substring(str[0].IndexOf(" = ") + 3);
string database = str[1].Substring(str[1].IndexOf(" = ") + 3);
string userid = str[2].Substring(str[2].IndexOf(" = ") + 3);
string password = "Welc0me";//str[3].Substring(str[3].IndexOf(" = ") + 3);
rpt.Load(Server.MapPath(RepPath));
for (int i = 0; i < rpt.DataSourceConnections.Count; i++)
{
rpt.DataSourceConnections[i].SetConnection(server, database, userid, password);
}
// Here ReleaseID will be replaced by the CheckBoxList's SelectedValue
rpt.SetParameterValue(0, ReleaseID);
rpt.SetParameterValue(1, false);
rpt.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat,
HttpContext.Current.Response, true, "Docs Report");
But the above code is only to generate a single pdf report at a time. But I want to pass each CheckBoxList selectedvalue as a Parameter. For Example, If I Selected three values means, then the Crystal Report should contain all the three Crystal Report for the Corresponding SelectedValue one by one. How do I merge all the PDF Crystal Report into a Single Crystal Report. I have to solve this problem. Please help me.