社区
C#
帖子详情
发票打印,在线等待
cxyPioneer
2004-09-21 11:42:37
在水晶报表怎样打印发票(自定义),用针式打印机,并且能够连续打印
...全文
213
3
打赏
收藏
发票打印,在线等待
在水晶报表怎样打印发票(自定义),用针式打印机,并且能够连续打印
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用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
打赏
举报
回复
怎样设置水晶的尺寸,自定义
电信设备-一种移动
发票
打印
系统.zip
在实际应用中,这种移动
发票
打印
系统不仅提高了电信行业的服务效率,减少了客户
等待
时间,还能降低企业的运营成本,减少纸质
发票
的管理和存储压力。对于电信运营商来说,这是一项能够提升品牌形象,增强竞争力的重要...
通用机打
发票
打印
软件安装说明.pdf
通用机打
发票
打印
软件是企业日常运营中必不可少的工具,用于高效
打印
各类
发票
。这篇文档主要介绍了该软件的安装和卸载步骤,确保用户能够顺利进行操作。 **一、通用机打
发票
软件安装** 1. **下载安装包**: 首先,...
网络游戏-提高网络开票系统客户端
发票
打印
速度的方法及系统.zip
针对“网络游戏-提高网络开票系统客户端
发票
打印
速度的方法及系统”这一主题,我们可以深入探讨以下几个关键知识点: 1. **
发票
打印
速度优化**: - **并行处理**:通过多线程或异步处理技术,同时处理多个
打印
任务...
SilentPrint一个静默
打印
的中间件网页实现静默
打印
- **
发票
和收据
打印
**:
在线
购物平台在订单完成后自动
打印
发票
。 - **报告和文档**:在用户提交表单后,系统自动
打印
报表或合同。 - **自助服务终端**:自助
打印
服务在用户完成操作后立即开始
打印
。 总的来说,`...
微信闪开
发票
解决方案
3. **用户体验**:用户无需排队
等待
,随时随地轻松完成
发票
开具。 4. **环境保护**:减少了纸张消耗,有利于可持续发展。 5. **数据安全**:基于区块链技术的保障措施使得数据更加可靠。 #### 六、未来展望 随着...
C#
111,093
社区成员
642,554
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章