社区
C#
帖子详情
发票打印,在线等待
cxyPioneer
2004-09-21 11:42:37
在水晶报表怎样打印发票(自定义),用针式打印机,并且能够连续打印
...全文
234
3
打赏
收藏
发票打印,在线等待
在水晶报表怎样打印发票(自定义),用针式打印机,并且能够连续打印
复制链接
扫一扫
分享
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
myflyer
2004-09-21
打赏
举报
回复
我做过的酒店结帐单的打印看看对你有没?
private void PrintPageTop(object sender,System.Drawing.Printing.PrintPageEventArgs e,float fltXPos,ref float fltYPos)
{
string strMain=null;
if(this.Consume)
strMain = "中银酒店客户消费单";
else
strMain = "中银酒店客户结帐单";
e.Graphics.DrawString(strMain,new Font("华文行楷",18F,FontStyle.Bold),Brushes.Black,100,fltYPos);
e.Graphics.DrawString("客户:" + this.strName,new Font("宋体",10F,FontStyle.Bold),Brushes.Black,fltXPos,fltYPos += new Font("华文行楷",18F,FontStyle.Bold).Height);
e.Graphics.DrawString(this.strUnit,new Font("宋体",8F,FontStyle.Italic),Brushes.Black,fltXPos + 312,fltYPos += new Font("宋体",10F,FontStyle.Bold).Height);
fltYPos += new Font("宋体",8F,FontStyle.Italic).Height;
e.Graphics.DrawString("商品名",new Font("宋体",9F,FontStyle.Bold),Brushes.Black,fltXPos,fltYPos);
e.Graphics.DrawString("数量",new Font("宋体",9F,FontStyle.Bold),Brushes.Black,fltXPos + 138,fltYPos);
e.Graphics.DrawString("商品名",new Font("宋体",9F,FontStyle.Bold),Brushes.Black,fltXPos + 203,fltYPos);
e.Graphics.DrawString("数量",new Font("宋体",9F,FontStyle.Bold),Brushes.Black,fltXPos + 340,fltYPos);
}
private void PrintPageList(object sender,System.Drawing.Printing.PrintPageEventArgs e,float fltXPos,ref float fltYPos)
{
float fltLineTop = fltYPos;
string strName=null;
Font fontList = new Font("宋体",8.5F);
double dPrice,dSumMoney,dSum;
decimal decCSum=0;
//菜
dv.RowFilter = "类别 not in('酒','扑克','干巾','湿巾','烟')";
for(int i=0;i<dv.Count;i++)
{
decCSum += Convert.ToDecimal(dv[i]["金额"]);
dSum = Convert.ToDouble(dv[i]["数量"]);
fltYPos += fontList.GetHeight(e.Graphics);
if(dv[i]["名称"].ToString().Length<8)
strName = dv[i]["名称"].ToString();
else
strName = dv[i]["名称"].ToString().Substring(0,7) + "..";
e.Graphics.DrawString((i+1).ToString() + strName ,fontList,Brushes.Black,fltXPos,fltYPos);
e.Graphics.DrawString(dSum.ToString("0.0"),fontList,Brushes.Black,fltXPos + 138,fltYPos);
i++;
if(i<dv.Count)
{
decCSum += Convert.ToDecimal(dv[i]["金额"]);
dSum = Convert.ToDouble(dv[i]["数量"]);
if(dv[i]["名称"].ToString().Length<8)
strName = dv[i]["名称"].ToString();
else
strName = dv[i]["名称"].ToString().Substring(0,7) + "..";
e.Graphics.DrawString((i+1).ToString() + strName,fontList,Brushes.Black,fltXPos + 203,fltYPos);
e.Graphics.DrawString(dSum.ToString("0.0"),fontList,Brushes.Black,fltXPos + 340,fltYPos);
}
}
fltYPos += fontList.GetHeight(e.Graphics);
e.Graphics.DrawString("菜单合计:" ,fontList,Brushes.Black,fltXPos,fltYPos);
e.Graphics.DrawString(decCSum.ToString("0.0"),fontList,Brushes.Black,fltXPos + 360,fltYPos);
Pen blackPen = new Pen(Color.Black,1);
blackPen.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDot;
fltYPos += fontList.GetHeight(e.Graphics);
e.Graphics.DrawLine(blackPen,230,fltLineTop,230,fltYPos);
//酒水
decimal decJXSum=0;
dv.RowFilter = "类别 in('酒','扑克','干巾','湿巾','烟')";
if(dv.Count>0)
{
e.Graphics.DrawString("商品名",new Font("宋体",9F,FontStyle.Bold),Brushes.Black,fltXPos,fltYPos);
e.Graphics.DrawString("售价",new Font("宋体",9F,FontStyle.Bold),Brushes.Black,fltXPos + 240,fltYPos);
e.Graphics.DrawString("数量",new Font("宋体",9F,FontStyle.Bold),Brushes.Black,fltXPos + 300,fltYPos);
e.Graphics.DrawString("金额" ,new Font("宋体",9F,FontStyle.Bold),Brushes.Black,fltXPos + 360,fltYPos);
for(int i=0;i<dv.Count;i++)
{
decJXSum += Convert.ToDecimal(dv[i]["金额"]);
dPrice = Convert.ToDouble(dv[i]["售价"]);
dSumMoney = Convert.ToDouble(dv[i]["金额"]);
dSum = Convert.ToDouble(dv[i]["数量"]);
fltYPos += fontList.GetHeight(e.Graphics);
e.Graphics.DrawString((i+1).ToString() + dv[i]["名称"].ToString(),fontList,Brushes.Black,fltXPos,fltYPos);
e.Graphics.DrawString(dPrice.ToString("##0'.';(##0'.');0'.'"),fontList,Brushes.Black,fltXPos + 240,fltYPos);
e.Graphics.DrawString(dSum.ToString("0.0"),fontList,Brushes.Black,fltXPos + 300,fltYPos);
e.Graphics.DrawString(dSumMoney.ToString("##0'.';(##0'.');0'.'"),fontList,Brushes.Black,fltXPos + 360,fltYPos);
}
fltYPos += fontList.GetHeight(e.Graphics);
e.Graphics.DrawString("酒水合计:",fontList,Brushes.Black,fltXPos,fltYPos);
e.Graphics.DrawString(decJXSum.ToString("0.0"),fontList,Brushes.Black,fltXPos + 360,fltYPos);
}
}
private void PrintPageButton(object sender,System.Drawing.Printing.PrintPageEventArgs e,float fltXPos,float fltYPos)
{
Font fontButton = new Font("宋体",9F);
fltYPos +=20;
e.Graphics.DrawString("合计消费:" + Convert.ToDouble(this.strSumPrice).ToString("¥#,##0.0;(¥#,##0.0);"),fontButton,Brushes.Black,fltXPos,fltYPos);
if(!this.Consume)
{
e.Graphics.DrawString("已收:" + Convert.ToDouble(this.strTruePrice).ToString("¥#,##0.0;(¥#,##0.0);"),fontButton,Brushes.Black,fltXPos + 160,fltYPos);
e.Graphics.DrawString("欠款:" + Convert.ToDouble(this.strOwe).ToString("¥#,##0.0;(¥#,##0.0);"),fontButton,Brushes.Black,fltXPos + 300,fltYPos);
fltYPos += 10 + fontButton.GetHeight(e.Graphics);
e.Graphics.DrawString("客户确认:",fontButton,Brushes.Black,fltXPos,fltYPos);
Pen blackPen = new Pen(Color.Black,1);
e.Graphics.DrawLine(blackPen, fltXPos + 66,fltYPos + fontButton.GetHeight(e.Graphics)-3,210,fltYPos + fontButton.GetHeight(e.Graphics)-3);
}
fltYPos += 10 + fontButton.GetHeight(e.Graphics);
e.Graphics.DrawString("打单日期时间:" + DateTime.Now.ToString(),fontButton,Brushes.Black,fltXPos,fltYPos);
e.Graphics.DrawString("- - - - - - - - 谢谢您的惠顾,欢迎下次光临 - - - - - - - -",new Font("宋体",10F),Brushes.Black,fltXPos,fltYPos + 20);
}
private void pd_PrintPage(object sender,System.Drawing.Printing.PrintPageEventArgs e)
{
float fltXPos,fltYPos;
fltYPos = e.MarginBounds.Top;
fltXPos = e.MarginBounds.Left;
this.PrintPageTop(sender,e,fltXPos,ref fltYPos);
this.PrintPageList(sender,e,fltXPos,ref fltYPos);
if(fltYPos<340)
this.PrintPageButton(sender,e,fltXPos,340);
else
this.PrintPageButton(sender,e,fltXPos,fltYPos);
}
myflyer
2004-09-21
打赏
举报
回复
如果是票据打印还是用printDocument类打印吧,这样比较灵活
cxyPioneer
2004-09-21
打赏
举报
回复
怎样设置水晶的尺寸,自定义
关于电子
发票
打印
报销最优美的姿势——
发票
大师网页版
目录关于电子
发票
打印
报销最优美的姿势关于电子
发票
发票
大师网页版
发票
合并功能
发票
抽取功能页面整理简单好用,就是
发票
大师 关于电子
发票
打印
报销最优美的姿势 关于电子
发票
支付电子化、办公无纸化,这些都成为电子
发票
普及的基础。从一开始,电子
发票
就得到了极大的关注和喜爱。电子
发票
从开具到分发,都不再需要现场操作、远程邮寄,尤其得到几大网络购物平台/电商的重视。 虽说有不少优点,但是具体到
发票
报销的时候,财...
在一张A4纸上合并
打印
多张PDF电子
发票
的简单方法
PDF电子
发票
合并
打印
的实用方法推荐,怎么将多张电子
发票
在一张A4纸上
打印
?
C# WPF
发票
打印
微信公众号:Dotnet9,网站:Dotnet9。问题或建议,请网站留言; 如果您觉得Dotnet9对您有帮助,欢迎赞赏 C# WPF
发票
打印
内容目录 实现效果 业务场景 编码实现 本文参考 源码下载 1.实现效果
发票
界面 PDF
打印
结果 2.业务场景 界面作为
发票
预览,按客户需求可
打印
成
发票
纸张给客户。 3.代码实现 3.1 添加Nuget库 站长使用 .Net ...
如何
打印
网页版的
发票
_纸质
发票
将消失,电子
发票
如何报销、
打印
、收集?这一篇就够了...
电子
发票
推行已有相当长一段时间了,在深圳前海纸质
发票
就快要彻底消失了!票据电子化即将全面普及。在10月29日腾讯官方宣布,近日,中国信通院、深圳税务局和腾讯联合代表中国在 ITU-T SG16 Q22 会议上首次提出《General Framework of DLT based invoices》(基于区块链分布式账本的电子
发票
通用框架)标准立项,获得了成员国家的支持,顺利通过新标准立项。这标志着...
python提取
发票
信息
发票
识别_python
发票
识别
广告关闭腾讯云11.11云上盛惠 ,精选热门产品助力上云,云服务器首年88元起,买的越多返的越多,最高返5000元!本接口支持机动车销售统一
发票
和二手车销售统一
发票
的识别,包括
发票
号码、
发票
代码、合计金额、合计税额等二十多个字段。 默认接口请求频率限制:5次秒。 推荐使用 api explorer 点击调试 api explorer 提供了
在线
调用、签名验证、sdk代码生成和快速检索接口等能力。 ...
C#
111,128
社区成员
642,536
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章