This tutorial demonstrates how to print multiple copies of an Invoice from Crystal Report. Sometimes, it is necessary to create multiple copies of the same report. Actually, I got a requirement from client to generate multiple copies of the same invoice for seller, customer, and also for admin. So, in this example, I am going to explain how to do it using Crystal Report Viewer in C# step by step.
Implementation
Let's start implementation of our requirement given by client to create multiple copies of the same invoice.
Step 1
Open your Visual Studio and follow the steps given below.
File > New > Project
Open your Visual Studio and follow the steps given below.
File > New > Project
Step 2
Now, a new window will appear on your screen, as below. From left side menu, select Visual C#, choose Windows Forms Application from the list, give your application a name, and click OK.
Now, a new window will appear on your screen, as below. From left side menu, select Visual C#, choose Windows Forms Application from the list, give your application a name, and click OK.

Step 3
After this, you can see there is one blank form in your directory with the name Form1.
After this, you can see there is one blank form in your directory with the name Form1.

Step 4
Now, follow this screen and add CrystalReportViewer in this blank form from toolbox.
Now, follow this screen and add CrystalReportViewer in this blank form from toolbox.

After this, your Form1 will look like this.

Step 5
Now, create database, add table, and enter some data on created table where product id is the primary key (No Duplication).
Now, create database, add table, and enter some data on created table where product id is the primary key (No Duplication).
Step 6
Now, add CrystalReport in your project. For that, you should follow this screen. You can add this by right clicking on your project name from Solution Exploler >> Add >> Add New Item. Now, you can see a new window on your screen. From there, choose CrystalReport and click on OK.

Now, add CrystalReport in your project. For that, you should follow this screen. You can add this by right clicking on your project name from Solution Exploler >> Add >> Add New Item. Now, you can see a new window on your screen. From there, choose CrystalReport and click on OK.

Step 7
Add dataset on your project and add the created table in it.
Add dataset on your project and add the created table in it.
To add Datatable in dataset, follow this screen and right click on dataset. Select Add >> Datatabe and add columns in it as like in your table.
Step 8
Now, we will start to write C# Code and write following code in Form1.cs but before that you should add following namespace to use crystal report in our application.
Now, we will start to write C# Code and write following code in Form1.cs but before that you should add following namespace to use crystal report in our application.
- using System.Data.SqlClient;
- using CrystalDecisions.CrystalReports.Engine;
Create Database connection and write connection string and also create instance of report document within main class like this.
- SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\Admin\Downloads\WindowsFormsApplication5\Database1.mdf;Integrated Security=True;Connect Timeout=30");
- ReportDocument rprt = new ReportDocument();









Kinjal PatoliyaPosted Mar 12, 2020, 3:49 AM
Hello, it is working ok for simple records but what can do for original, duplicate triplicate for invoice contain with details and report header , page footer.