TVS RP-45卷纸印刷 [英] TVS RP-45 roll paper printing

查看:77
本文介绍了TVS RP-45卷纸印刷的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将票据格式制作为彻头彻尾的crystalreports,其中页面宽度为4英寸,高度为动态[我将其设为2英寸,我不知道如何使其动态].
打印机是 TVS RP-45 Justbill打印机.
打印机通过在打印后弹出纸张来浪费大量纸张,
请提出减少纸张浪费的方法.
除了crystalreporting以外,其他任何方式都对我有帮助.
我的代码写在c#2.0 winforms,数据库sql server 2005中.
我的报告结构是

I have a bill format made thorough crystalreports where the page width is 4 inch and height is dynamic[I make it 2 inch, I don''t know how to make it dynamic].
printer is TVS RP-45 Justbill printer.
printer is wasting lots of paper by ejecting paper after printing,
please suggest the way to stop the paper waste.
Any other way except crystalreporting will be helpful for me.
My Code is wrtten in c#2.0 winforms, database sql server 2005.
stucture of my report is

Report Header Section
                      Bill no : 101
______________________________________________
Detail Section
Item Code               Qty           Amount
[ItemCode]             [Qty]         [Amount]
______________________________________________
Report Footer Section
Grand Total                      [GrandTotal]
______________________________________________




我的三个部分的高度大约为2英寸,所以我将纸张的高度设置为2英寸,
但是仍然浪费了很多纸.如果有1个以上的项目,则纸张高度现在乘以2.
[我的纸是高度不固定的卷纸,应取决于要出售的物品数]

可能采用哪种方式,但我需要在不浪费纸张的情况下打印账单.
Please Please Please help!




My three section is taking around 2 inch height so I set the Height of the paper to 2 inch,
But still lots of paper is wasted. Paper height is now multiply by 2 if there is more than 1 item.
[My Paper is a Roll Paper where Height is not fixed, it should depends on No. of Item to be sold]

Whatever might be the way, but I need to print the bill without wasting any paper.
Please Please Please help!

推荐答案

>在文本下方打开记事本文档副本粘贴
> open notepad doc copy paste below text
Report Header Section
                      Bill no : 101
______________________________________________
Detail Section
Item Code               Qty           Amount
[ItemCode]             [Qty]         [Amount]
______________________________________________
Report Footer Section
Grand Total                      [GrandTotal]
______________________________________________


>设置字体新快递"
>打开打印机设置,设置纸张尺寸和打印机
支票纸是否在浪费

它肯定会在文本文档中起作用


动态创建帐单,


> set font ''courier new''
> open printer settings set papersize & printer
check paper is wasting or not

It will definitely work in text document


create bill dynamically,

billstr= feedcutstr("heading",36,right) + vbnewline; //create feedcutstr function in which you paas string and width & alignment as per that it will feed characters with spaces so string will be become 36 characters
e.g input "headings" output -> "             headings               "

billstr+= feedcutstr("--------------------------------------",36,right) + vbnewline;
for(i=0;i<dtbill.rows.count;i++)>
   {
        if (i==0)
        {  
            billstr += feedcutstr("ItemCode",20,Left) + feedcutstr("Qty",5,right) + feedcutstr("Amount",11,right)+ vbnewline; 
            billstr+= feedcutstr("--------------------------------------",36,right) + vbnewline;
        }
        billstr += feedcutstr(dtbill.rows[i]["itemcode"],20,Left) 
        billstr += feedcutstr(dtbill.rows[i]["Qty"],5,right) 
        billstr += feedcutstr(dtbill.rows[i]["Amount"],11,right) + vbnewline;
   }



//现在,在文本文件中写入bill str



// now, write bill str in text file

StreamWriter sw = new StreamWriter("D:\\Test.txt");
//Write a line of text
sw.WriteLine(billstr);
//Close the file
sw.Close();



//然后打印记事本文件(您的帐单)



//then print notepad file(your bill)

objProcess.StartInfo.FileName = "D:\\test.txt";
                    objProcess.StartInfo.Verb = "Print";
                    objProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
                    objProcess.StartInfo.UseShellExecute = true;
                    objProcess.Start();



祝您编程愉快!
:)



Happy coding!
:)


这篇关于TVS RP-45卷纸印刷的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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