社区
C#
帖子详情
发票打印,在线等待
cxyPioneer
2004-09-21 11:42:37
在水晶报表怎样打印发票(自定义),用针式打印机,并且能够连续打印
...全文
232
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
打赏
举报
回复
怎样设置水晶的尺寸,自定义
关于电子
发票
打印
报销最优美的姿势——
发票
大师网页版
电子
发票
普及后,报销时存在
打印
费时、浪费纸张、裁剪费力、归档不便等问题。
发票
大师网页版无需安装软件,通过浏览器打开即可使用。它有
发票
合并功能,可将多个
发票
合并到一个pdf文件;能识别有效
发票
并提示数量和金额;还能提供裁剪线,避免
打印
出现空白,轻松解决报销难题。
在一张A4纸上合并
打印
多张PDF电子
发票
的简单方法
本文介绍了一种通过PDF
打印
助手
在线
合并电子
发票
的方法,避免了因单张
打印
产生的大量纸张浪费,提倡企业在报销流程中采用更环保的方式管理电子
发票
。
C# WPF
发票
打印
本文介绍如何使用C#和WPF实现
发票
预览及
打印
功能,通过添加MaterialDesignThemes和MaterialDesignColors Nuget库,创建美观的
发票
界面,并演示了如何将界面内容
打印
成PDF格式。
如何
打印
网页版的
发票
_纸质
发票
将消失,电子
发票
如何报销、
打印
、收集?这一篇就够了...
本文介绍了区块链电子
发票
的概念及其与普通电子
发票
的区别,并探讨了区块链电子
发票
在深圳的应用情况。此外,文章还提供了电子
发票
使用中的一些解决方案。
python提取
发票
信息
发票
识别_python
发票
识别
这篇博客介绍了如何使用Python进行各种
发票
的识别和信息提取,包括增值税专用
发票
、通用机打
发票
、火车票等,利用腾讯云API进行字段识别,并提供了相关SDK的使用指导和源码链接。
C#
111,129
社区成员
642,541
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章