Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6106033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:02:10+00:00 2026-05-23T14:02:10+00:00

I have a CheckBoxList. If I select two or more values then the CheckBoxList

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:02:11+00:00Added an answer on May 23, 2026 at 2:02 pm

    Crystal Reports are meant to generate one page per record. You just have to set a datasource with several lines of data, set that data source for your report and export it to pdf directly (already “merged”).

    First of all you have to create a datasource with your data. For instance, you can create a DataSet using the Visual Studio designer. More info here.

    Then you have to set the data source for your Crystal Report. You can do it with the Crystal designer.

    Then at runtime, you just have to populate the rpt with the data related to all selected checkboxes, and export it to pdf. Inside the .rpt file create a group on the specific column related to the checkboxes with the “page break after” option set on the group. This will generate one Pdf file containing all your records, 1 per page.

    Here’s a sample code:

                using (var reportDocument = new ReportDocument())
            {
                var datasource = new Datasource { EnforceConstraints = false };
    
                var adapter = new adoTableAdapter { Connection = ConfigurationManager.ConnectionStrings["ConnectionString"]) };
                adapter.Fill(datasource.ado);
    
                reportDocument.Load(RptPath);
                reportDocument.SetDataSource(datasource);
    
                PageMargins myMargins = reportDocument.PrintOptions.PageMargins;
                myMargins.topMargin = Settings.Default.DefaultTopMargin;
                myMargins.leftMargin = Settings.Default.DefaultLeftMargin;
                reportDocument.PrintOptions.ApplyPageMargins(myMargins);
                reportDocument.PrintOptions.PaperSize = PaperSize.PaperA5;
                reportDocument.PrintOptions.PaperOrientation = PaperOrientation.Landscape;
    
                reportDocument.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
                reportDocument.ExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
                reportDocument.ExportOptions.DestinationOptions = new DiskFileDestinationOptions { DiskFileName = PdfFilename };
                reportDocument.ExportOptions.FormatOptions = new PdfRtfWordFormatOptions();
    
                reportDocument.Export();
            }
    

    In this code, dsEtiqueta is the ADO datasource, RptPath the path to the *.rpt report file and the pdf filename is generated using a timeSpan. It’s what I needed in my project but feel free to adapt it to your needs.

    Edit: done with CR for VS 2010.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two problems with checking and unchecking (select and deselect all) a checkboxlist:
Greeting, if I have asp.net checkboxlist control : <asp:CheckBoxList id=list1 runat=server> <asp:ListItem>One</asp:ListItem> <asp:ListItem>Two</asp:ListItem> <asp:ListItem>Three</asp:ListItem>
Given 2 tables: Person PersonsFavoriteColors A person can have one or more favorite colors.
I have a CheckBoxList where users can select multiple items from the list. I
I have a CheckBoxList and 5 labels. I would like the text value of
I have a CheckBoxList that is showing all A table C column. SELECT DISTINCT
ASP.NET and C#. I'd like to have a CheckboxList with a Select All item.
I have this CheckBoxList on a page: <asp:checkboxlist runat=server id=Locations datasourceid=LocationsDatasource datatextfield=CountryName datavaluefield=CountryCode />
I'm having trouble figuring this out. If I have a checkboxlist inside a usercontrol,
I have an ASP.Net CheckBoxList control inside an Ajax UpdatePanel. I will include the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.