Talk with the Author
 Crystal Reports Forum : General Information : Talk with the Author
Message Icon Topic: setting print height in crystal report Post Reply Post New Topic
Author Message
RahulGiridharan
Newbie
Newbie


Joined: 10 Jul 2012
Online Status: Offline
Posts: 1
Quote RahulGiridharan Replybullet Topic: setting print height in crystal report
    Posted: 12 Jul 2012 at 2:08am
private void crystalrep()
        {

            ReportDocument rptDoc = new ReportDocument();
       
            rptDoc.Load(Server.MapPath("~/Reports/CRDischarge.rpt"));
           // PaperSize p1 = new PaperSize();
           
            
            rptDoc.SetParameterValue("Name", lbname.Text);
            rptDoc.SetParameterValue("BillNo", Lbbillno.Text);
            rptDoc.SetParameterValue("Total", Lbtotalamnt.Text);
            rptDoc.SetParameterValue("RoomNo", txtroomnumber.Text);
            rptDoc.SetParameterValue("BedNo", txtbednumber.Text);
            rptDoc.SetParameterValue("Rent", lbrent.Text);
            rptDoc.SetParameterValue("Pharma", lbpharmaamnt.Text);
            rptDoc.SetParameterValue("Lab", lblabamnt.Text);
            rptDoc.SetParameterValue("Xray", lbxrayamnt.Text);
            rptDoc.SetParameterValue("Add", lbaddit.Text);
           // rptDoc.PrintOptions.PrinterName = "WeP CSX 450";
          
               rptDoc.PrintOptions.PaperSource = PaperSource.Auto;
               rptDoc.PrintOptions.PaperSize = PaperSize.DefaultPaperSize;

               CrystalDecisions.Shared.PageMargins edges = new CrystalDecisions.Shared.PageMargins(1, 1, 1, 1);
               rptDoc.PrintOptions.ApplyPageMargins(edges);

               CrystalReportViewer1.ReportSource = rptDoc;
               //CrystalReportViewer1.Refresh();
               CrystalReportViewer1.ReportSource = rptDoc;
               rptDoc.PrintOptions.PrinterName = "WeP CSX 450";

               rptDoc.PrintToPrinter(1, false, 0, 0);
            }
Am ussing this code to print ma crystal report in webforms application....but its printngin a4 page height..how can i stop the printer just after the content in the report is over....actually am printng in a roll paper for billing application..the height of paper may increase according to number of items purchased...thanks
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.047 seconds.