i want to print one report multiple times on user input number of page to be print, as like in this video....here is link of that video Https://www.youtube.com/watch?v=i7NYevleSA0 .
current;y i am printing one report on one page using crystal report ,,,,
here is my code
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Configuration;
- using System.Data;
- using System.Data.SqlClient;
- using System.IO;
- using System.Globalization;
- using Microsoft;
- using Salesorder;
- using CrystalDecisions.CrystalReports.Engine;
- using System.Drawing.Printing;
- namespace Salesorder
- {
- public partial class Print : System.Web.UI.Page
- {
- SqlConnection con = new SqlConnection();
- ReportDocument rpt = new ReportDocument();
- protected void Page_Load(object sender, EventArgs e)
- {
-
- {
- rpt.Dispose();
- rpt.Close();
-
- }
-
-
-
- }
-
- protected void Button1_Click(object sender, EventArgs e)
- {
- rpt.Dispose();
- rpt.Close();
- con = new SqlConnection("Data Source=DESKTOP-5PJ76B9;Integrated Security=SSPI;Initial Catalog=SilverProduction;MultipleActiveResultSets=True;");
- try
- {
- con.Open();
- SqlCommand cmd = new SqlCommand("spbigbaleprint", con);
- cmd.CommandType = CommandType.StoredProcedure;
-
-
-
- SqlDataAdapter adp = new SqlDataAdapter(cmd);
- DataSet ds = new DataSet();
-
-
- adp.Fill(ds);
-
-
-
-
- rpt.Load(Server.MapPath("~/CRBigbalprnt.rpt"));
- rpt.SetDataSource(ds.Tables["Table"]);
-
-
-
-
- ReportDocument rd = new ReportDocument();
-
- CrystalReportViewer1.ReportSource = rpt;
- rpt.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, false, "Bigbalprd");
-
- }
-
-
- catch (Exception ex) { }
- }
-
-
-
- protected void CRBigview_Unload(object sender, EventArgs e)
- {
-
-
- if (rpt != null)
- {
- rpt.Close();
- rpt.Dispose();
-
- }
- }
-
- }
- }