简体   繁体   English

打印ac#winform申请表

[英]Printing a c# winform application form

I'm amazed how difficult this seems to be. 我很惊讶这看起来有多困难。 I 'just' want to print my form (it's an invoice), and ensure it prints the whole form (not just what is displayed on the screen)? 我只想打印我的表格(这是发票),并确保打印整个表格(不仅仅是屏幕上显示的内容)? I can alter anything I want on the form itself..so how do I set it all up so it prints perfectly to a standard letter sized sheet of paper, and doesn't let the user resize it, etc etc. They should see it just like it will print.. maybe they can zoom in and out, but no re-sizing, etc. 我可以在表格本身上改变我想要的任何东西。那么如何将它全部设置好以便它完美地打印到标准的信纸大小的纸张上,并且不会让用户调整大小等等。他们应该看到它就像它会打印..也许他们可以放大和缩小,但没有重新调整大小等。

I thought a reportviewer control would be handy in order to handle all the printing and sizing stuff.. but that control doesn't seem to lend itself to a single record display. 我认为一个reportviewer控件可以很方便地处理所有打印和调整大小的东西..但是这个控件似乎不适合单个记录显示。 (maybe have a Header as the entire report! seems crazy) (可能有一个Header作为整个报告!看起来很疯狂)

so unless i'm wrong, maybe someone can just give me all the properties to set, etc, in order to make a regular form statically sized for a standard sheet of paper (8.5 x 11)? 所以,除非我错了,也许有人可以给我所有要设置的属性等,以便为标准纸张(8.5 x 11)制作静态大小的常规形式? And then show me the way to print the entire thing rather then just a 'printscreen'. 然后告诉我打印整个东西的方式,而不仅仅是'printscreen'。

I've read a bunch of ideas for using 'printscreen' and using GDI+ (i didn't fully understand how I could use that).. nothing seems to be standing out for me. 我已经阅读了一些关于使用'printscreen'和使用GDI +的想法(我并不完全理解我如何使用它)。似乎没有什么能帮助我。

I'd recommend the report viewer and rdlc report. 我推荐报告查看器和rdlc报告。 You can use it just fine for only one record, and you can include a subreport for the invoices line items. 您只能将其用于一条记录,并且可以为发票行项目包含子报表。 No need to have everything in the header. 无需在标题中包含所有内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM