C#中的电子账单准备和打印 [英] Electric Bill Preparation and Printing in C#

查看:76
本文介绍了C#中的电子账单准备和打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试找出打印电费单的捷径.
到目前为止,我可能会想到的一个选择是:搜索当前的电费单模板并将其与PictureBox项一起加载,然后尝试将从数据库中获取的文本打印到此PictureBox项上.

另一个选择是使用Crystal Reports或ReportViewer手动设计类似的模板,然后再次通过数据库填充字段以进行打印.
但是我不知道哪种方法更好,因为我的时间有限,我的知识也很有限.

谢谢任何有经验的人给我他的意见.谢谢.

I am currently trying to figure out a short path to print an electric bill.
One option that i could come up till now is googling a present electric bill template and loading it with PictureBox item,later on trying to print texts taken from database onto this PictureBox item.

Another option is to use Crystal Reports or ReportViewer to design a similar template by hand and filling the fields via database again for printing purposes.
But I don''t know which way is better,easier.Because my time is limited and so does my knowledge also.

Any experienced person to give me his opinions about this would be welcome.Thanks beforehand.

推荐答案

好吧,假设您的意思是您创建了一个应用程序,该应用程序作为其过程的一部分,必须打印一个看起来像电费单的报告.

从您所说的来看,您已经有了数据,因此我非常确定有关展示的决定.您提到捕获一张看起来像您想要的报告的图像,然后在此基础上对数据进行分层.听起来对我来说不是一个不错的选择.

然后,您将讨论使用Crystal Reports或ReportViewer都能达到目的的方法.您还可以查看根据数据创建pdf的方法-始终可以正常工作. [ ^ ]可能的帮助:iTextSharp(您需要深入研究该链接才能找到它)非常通用,并且可以产生出色的输出.

但是,您将需要做一些工作才能做到这一点:没有万能的解决方案:就像您的时间有限一样,其他所有人也是如此:如果您不准备花时间学习,那为什么会有人会花时间帮助您吗?
Well, let''s assume that you mean you have created an application which, as part of its process, has to print a report that looks like an electric bill.

From what you''ve said you already have the data so the decision i spurely about presentation. You mention grabbing an image of a report that lookslike what you want and then layering your data on top of this. Doesn''t sound like a decent option to me.

Then you talk about Crystal Reports or ReportViewer either of which would do the trick. You could also look at creating a pdf from the data - that always works well. This[^]might help: iTextSharp (you''ll need to dig through that link toget to it) is very versatile and produces great output.

You will, however, have to do some work to make this happen: there is no magic bullet solution: just as your time is limited so is everyone else''s: if you are not prepared to invest the time to learn then why would anyone spare the time to help you?


如果您对通过前端应用程序进行所有计算/数据显示并将报告显示为图像感到满意,那很好.

但是,Crystal Report/Report查看器方法是一种更复杂的方法.
您可以将数据字段直接绑定到报表(当然,从数据库中加载数据字段之后),可以将计算/公式添加到报表中.
有导出到excel/pdf等文件格式的功能

但是,维护此类报告会产生开销.
If you are happy with doing all calculations / data displays via your front end application and displaying your report as an image then it is fine.

The Crystal Report / Report viewer approach, however, is a more sophisticated one.
You can directly bind your data fields to the report (after they are loaded from the database, of course) You can add calculations / formulas to the report.
There are export to excel / pdf and other file format facilities

However, there is an overhead of mainting such reports.


DaReport ^ ].当然,与Crystal报表相比,它的复杂程度较低,但对于小型报表或帐单,在您的情况下非常有用.
我曾在我的一个商业项目中使用过它来打印包括动态图片等在内的详细报告,并且它带有报告设计器,以便您可以为任何种类的账单准备不同的模板
An open source and easier-to-implement alternative to crystal reports is DaReport as in here[^]. Of course, compared to Crystal reports, it is less sophisticated, but serves extremely well for small scale reports or bills, in your case.
I have used it in one of my commercial projects to print detailed reports including dynamic pictures etc., and it comes with a report designer so that you could prepare different templates for any kind of bills


这篇关于C#中的电子账单准备和打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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