在一个工作表中一次打印5个datagridviews [英] Print 5 datagridviews in one time in one sheet
问题描述
在一张纸上一次打印5个dataGridViews
我尝试过:
嗯,请看下面的代码:
我试过这段代码,它可以工作,但它一次打印一个DataGridView:
private void printTest_Click( object sender,EventArgs e)
{
DGVPrinter printer = new DGVPrinter();
printer.Title = ;
printer.SubTitle = ;
printer.SubTitleFormatFlags = StringFormatFlags.LineLimit |
StringFormatFlags.NoClip;
printer.PageNumbers = true ;
printer.PageNumberInHeader = false ;
printer.PorportionalColumns = true ;
printer.HeaderCellAlignment = StringAlignment.Near;
printer.Footer = ;
printer.FooterSpacing = 15 ;
printer.PrintDataGridView(datagridview1);
}
问题 如果你添加这些代码,每次打开打印窗口, 每个操作。
printer.PrintDataGridView(datagridview2); // 新打印窗口
printer.PrintDataGridView(datagridview3); // 新打印窗口
printer.PrintDataGridView(datagridview4); // 新打印窗口
printer.PrintDataGridView(datagridview5); // 新打印窗口
如果我想在同一页面上同时使用所有5个DataGrridView,只打印一个窗口。我该怎么办?
引用:我该怎么办?
首先要意识到这里有13852,767名成员,你可以和他们交谈,只有一个是相关的。所以在这样的一般论坛中发帖提问,只是说不告诉任何人您所指的是什么解决方案,或者是谁实际编写的,并且已经与您对应。引用:我尝试了你的解决方案,但它不符合我的需要。
请勿在快速回答 - 如果您从文章中获得了代码,那么该文章底部会出现添加评论或问题按钮,这会导致将电子邮件发送给作者。然后他们会被告知你希望与他们交谈。
在这里发布这个依赖于他们匆匆而过并意识到这是为了他们。
Print 5 dataGridViews in one time in one sheet
What I have tried:
Well , please look at the code below:
I tried this code, it works, but it prints one DataGridView at a time :
private void printTest_Click(object sender, EventArgs e)
{
DGVPrinter printer = new DGVPrinter();
printer.Title = "";
printer.SubTitle = "";
printer.SubTitleFormatFlags = StringFormatFlags.LineLimit |
StringFormatFlags.NoClip;
printer.PageNumbers = true;
printer.PageNumberInHeader = false;
printer.PorportionalColumns = true;
printer.HeaderCellAlignment = StringAlignment.Near;
printer.Footer = " ";
printer.FooterSpacing = 15;
printer.PrintDataGridView(datagridview1);
}
The problem is that if you add these pieces of code, it opens the print window each time, for each of these operations.
printer.PrintDataGridView (datagridview2); // new print windows
printer.PrintDataGridView (datagridview3); // new print windows
printer.PrintDataGridView (datagridview4); // new print windows
printer.PrintDataGridView (datagridview5); // new print windows
If I wanted to use all 5 DataGrridView at the same time and on the same page, and just a print window. What should I do ??
Quote:What should I do?
Start by realising there are 13,852,767 members here that you could be talking to, and only one that is relevant. So posting a question in general forum like this and just sayingQuote:I tried your solution, but it does not fit my needs.
Doesn't tell anyone what "solution" you are referring, or who actually wrote it and has been corresponding with you about it.
Don't post this under Quick Answers - if you got the code from an article, then there is a "Add a Comment or Question" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to speak to them.
Posting this here relies on them "dropping by" and realising it is for them.
这篇关于在一个工作表中一次打印5个datagridviews的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!