C#2.0中的Crystal Report卷纸打印 [英] Crystal Report roll paper printing in C# 2.0

查看:110
本文介绍了C#2.0中的Crystal Report卷纸打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个尺寸为4x2的Crsytal报告,它正在商店中打印账单.
打印机是TVS JuSTBILL打印机[热敏打印机].
它可以正常工作,但是在打印完实际文本后进行打印时,打印机会通过大量纸张从打印机中取出2到3英寸的纸张[卷纸没有任何固定的高度,宽度为4英寸].那张纸浪费了.

是问题.

我们可以在打印完实际打印后停止打印机,以免浪费任何空白页吗?
如何停止打印机以从打印机中弹出多余的纸张.
我正在使用以下代码.

I have a Crsytal Report with the size 4x2, which is printing bill in a shop.
Printer is TVS JuSTBILL printer [Thermal Printer].
Its working, but at the time of printing after printing the actual text, the printer through lots of paper out from the printer like 2 to 3 inches paper[Roll paper does not have any fixed height, width is 4 inches]. That paper go wasted.

It is the problem.

Can we stop the printer after printing the actual printing, so that any blank page will not go wasted.
How to stop printer to eject extra paper from printer.
I am using the following code.

private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(GlobalClass.constr);
            con.Open();
            SqlDataAdapter da3 = new SqlDataAdapter("select * from SalesDetails where BillNo='" + textBox1.Text + "'", con);
            DataSet ds3 = new DataSet();
            da3.Fill(ds3, "SalesDetails");
            rptSalesbill abc = new rptSalesbill();
            abc.SetDataSource(ds3.Tables[0]);
            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 == "4x2")
                {
                    rawKind = (int)GetField(printDoc.PrinterSettings.PaperSizes[i], "kind");
                }
            }
            abc.PrintOptions.PaperSize = (CrystalDecisions.Shared.PaperSize)rawKind;
            abc.PrintToPrinter(1, true, 0, 0);
            crystalReportViewer1.Refresh();
        }
        private object GetField(Object obj, String fieldName)
        {
            System.Reflection.FieldInfo fi = obj.GetType().GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
            return fi.GetValue(obj);
        }



请帮助我,关于这个问题,我没有得到任何完美的答案.



Please Help me, I,m not getting any perfect answer regarding this question.

推荐答案

检查打印机的/页面属性是否有可用的选项,
原始文档(如果已将其设置为 [Feed,cut]
) 我已经使用过Epson打印机&记事本文档.

您可以参考下面的链接,
http://www.bigresource.com/VB- Change-Notepad-settings-from-VB-6-0-BcReZa4RRZ.html#slugrMccW9 [
check your printer''s / page''s property is there any option available,
Source Document if it is then set it to [Feed,cut]
I have used Epson printer & notepad doc.

you can refer below link,
http://www.bigresource.com/VB-Change-Notepad-settings-from-VB-6-0-BcReZa4RRZ.html#slugrMccW9[^]


这篇关于C#2.0中的Crystal Report卷纸打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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