Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to print sales bill like to supermarket ,I have the crystal report and I made Paper Size to User Defined Size 4*8 but when I print report the paper name = latter and Report printing on A4 size or latter Size and i want to print report on my size , I'm using this code
C#
SBillTableAdapter ta = new SBillTableAdapter();

DataSet1.SBillDataTable table = ta.GetData(9);

SBill CRBill = new SBill();
CRBill.SetDataSource(table.DefaultView);

CRBill.SetParameterValue(0,Convert.ToInt32 (textBox3.Text));
CRBill.SetParameterValue(1, Convert.ToInt32(textBox2.Text));
CRBill.SetParameterValue(2, Convert.ToInt32(textBox4.Content));
System.Drawing.Printing.PrintDocument printDoc = new System.Drawing.Printing.PrintDocument();
int i;
int rawKind = 0;
for (i = 0; i < printDoc.PrinterSettings.PaperSizes.Count; i++)
{
    if (printDoc.PrinterSettings.PaperSizes[i].PaperName == "User Defined Size")
    {
        rawKind = (int)GetField(printDoc.PrinterSettings.PaperSizes[i], "kind");
    }
}
CRBill.PrintOptions.PaperSize = (CrystalDecisions.Shared.PaperSize)rawKind;
CRBill.PrintToPrinter(1, true, 0, 0);


Please help me how i can change the paper name to my size?
Posted
Updated 22-Jun-14 17:09pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900