如何从数据库中打印数据 [英] How to print data from database

查看:439
本文介绍了如何从数据库中打印数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我想打印包含2个表格中的数据的徽章
我想在写名称时显示其余数据并打印
我该怎么办?
thx

解决方案

正如优素福所说,您的问题不是很清楚.我只能建议您使用合适的搜索词(例如 c#打印数据库)在互联网上搜索,然后坐在舒适的椅子上读书.


正如 Ysuf所说,这些是涉及的步骤.

1)从数据库中获取必要的数据.
2)创建PrintDocument类的新实例.在PrintPage事件处理中,使用PrintDocument的图形设备上下文(例如,如果您的PrintPageEventargs变量为e,则为e.Graphics).使用 System.Drawing类方法在此设备上下文上绘制任何图形,文本或图像.

3)创建PrinterSettingsPageSettings类的实例,填充所需的任何设置,然后将其分配给printdocument的属性.

4)提交打印,检查结果,您可能需要重新缩放和放置图形.可能需要进行一些试验.

现在,按照Henry Minute这些步骤搜索Internet时,请尝试一下.如果卡在任何地方,张贴那些具体问题.我们可以为您提供帮助.


thx伙计们,但我是c#的初学者.
我会尝试清除它
我要打印包含姓名和国家/地区的页面
我的问题不在于获取数据
我只想知道如何打印
我想做这个http://www.y4yy.net/images/89248045587334530998.jpg
从数据库中获取名称和国家/地区,然后执行
如果您能帮助我


hi i want to print badges contain data from 2 tables
i want when write name show the rest of data & print it
how can i do it?
thx

解决方案

As Yusuf has said, your question is not very clear. I can only suggest that you search the internet using a suitable search phrase, something like c# print database, and settle down in a comfortable chair to do some reading.


As Ysuf said these are the steps involved.

1) Fetch necessary data from the database.
2) Create a new instance of the PrintDocument class. In the PrintPage Event handling use the graphic device context of the PrintDocument (say if your PrintPageEventargs variable is e then e.Graphics). Draw any graphic, text or images on this device context using the System.Drawing class methods.

3) Create instance of PrinterSettings and PageSettings classes, populate whatever settings you want then assign it to the properties of printdocument.

4) Commit print, check the results and you may need to rescale and position the graphics. A few trials may be needed.

Now as Henry Minute search internet on these steps, try yourself. If stuck anywhere post those specific question. We could able to help you.


thx guys but i''m beginner in c#
i''ll try to clear it
i want to print page contain name & country
my problem isn''t in fetch data
i just want to know how to print
i want to make this http://www.y4yy.net/images/89248045587334530998.jpg
bring the name & country from database & do this
if u can plz help me


这篇关于如何从数据库中打印数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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