在Crystal Report中打印报告时如何更改纸张名称? [英] How Do I Can Change The Paper Name When Print Report In Crystal Report?

查看:91
本文介绍了在Crystal Report中打印报告时如何更改纸张名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试打印销售账单,比如超市,我有水晶报告,我将纸张尺寸设为用户定义尺寸4 * 8但是当我打印报告纸张名称=后者和报告打印A4尺寸或后者尺寸,我想打印我的尺寸报告,我正在使用此代码

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

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?

推荐答案

这篇关于在Crystal Report中打印报告时如何更改纸张名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆