windows 在 Visual Studio 2010 中打印
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4708461/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Printing in Visual Studio 2010
提问by Lefteris Gkinis
Dear's all.
Now I'm at the end of the first part of my project and now i need to print a voucher with few pre-printing words and 7 fields that comes from a dataset.
I try to use *rdlc file on which i made all the necesary layout very good, and the link was very good as well
But print NO
I did something in *.xaml file very dificult to put controls and make the links.
But lets say i will do it, for the moment i have a picture and a label with few words, and I'm trying to print it with the following lines
亲爱的。
现在我已经完成了项目的第一部分,现在我需要打印一张包含少量预打印字和来自数据集的 7 个字段的凭证。
我尝试使用 *rdlc 文件,在该文件上我将所有必要的布局都做得非常好,链接也非常好
但是打印不
我在 *.xaml 文件中做了一些非常困难的事情来放置控件并制作链接。
但是可以说我会这样做,目前我有一张图片和一个字很少的标签,我正在尝试用以下几行打印
Dim myPrintDialog As PrintPreviewDialog = New PrintPreviewDialog
Dim myDocument As New PrintDocument
myPrintDialog.Document = myDocument
myPrintDialog.Document.DocumentName = "OrderVoucher.xaml"
myPrintDialog.ShowDialog()
But in the dialog I see only a blank page.
Of course I have a mistake in my mentality of building my code but I don't know where is that.
I also need to admit that is the first time in my life which I'm trying to print from Visual Studio 2010.
Now Please I need the best assistance you can give me.
P.S.
For the moment i want to print in my default Laser printer.
But in the final stage i will have to print in an Olivetti PR2 (Bank printer) which will be connected in the com: port.
That will be the day if I succeed :)
但是在对话框中我只看到一个空白页。
当然,我在构建代码时的心态有误,但我不知道那是哪里。
我还需要承认,这是我一生中第一次尝试从 Visual Studio 2010 打印。
现在,我需要您能给我的最佳帮助。
PS
目前我想用我的默认激光打印机打印。
但在最后阶段,我将不得不在连接到 com: 端口的 Olivetti PR2(银行打印机)中打印。
如果我成功,那将是那一天:)
回答by Qqbt
Thats going to be a pretty long study session for you.Here's a great,great guide to learn basic printing:
这对你来说将是一个相当长的学习课程。这是学习基本印刷的一个很棒的指南: