none
Label Print with multiple copies on user input RRS feed

  • Question

  • 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  . i have share this requirement on Fourm.asp.net but no solution found
     
    currently 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)  
            {  
                //if (!IsPostBack)  
                {  
                    rpt.Dispose();  
                    rpt.Close();  
                    // loadReport();  
                }  
      
      
      
            }  
      
            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;  
      
                    // cmd.Parameters.AddWithValue("@BID", Request.QueryString["BID"]);  
                    //  cmd.Parameters.AddWithValue("@BID", TextBox2.Text);  
                    SqlDataAdapter adp = new SqlDataAdapter(cmd);  
                    DataSet ds = new DataSet();  
      
      
                    adp.Fill(ds);  
                    //   for (int i = 0; i < int.Parse(TextBox1.Text); i++)  
                    // {var dialog = new PrintDialog();  
      
      
                    rpt.Load(Server.MapPath("~/CRBigbalprnt.rpt"));  
                    rpt.SetDataSource(ds.Tables["Table"]);  
      
                  //  PrintDocument pd = new PrintDocument();  
                  //  rpt.PrintOptions.PrinterName = pd.PrinterSettings.PrinterName;  
      
                    ReportDocument rd = new ReportDocument();  
                    // rd.PrintToPrinter(Convert.ToInt32(TextBox1.Text.Trim()), false, 0, 0);  
                    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();  
      
                }  
            }  
      
        }  
    }  

    • Moved by CoolDadTx Wednesday, August 7, 2019 8:50 PM Third party product
    Wednesday, August 7, 2019 6:40 PM

Answers

  • This forum is for C# specific questions only. 

    Please post questions related to ASP.NET in the ASP.NET forums.

    Questions related to using third party products like Crystal Reports need to be posted in their forums.


    Michael Taylor http://www.michaeltaylorp3.net

    • Marked as answer by Akhterhussain Wednesday, February 19, 2020 5:35 PM
    Wednesday, August 7, 2019 8:49 PM