- 分享
- 0
- 人气
- 0
- 主题
- 17
- 帖子
- 315
- UID
- 199933
- 积分
- 316
- 阅读权限
- 15
- 注册时间
- 2009-2-16
- 最后登录
- 2015-2-26
- 在线时间
- 264 小时
|
PrintDialog MyPrintDialog = new PrintDialog();
MyPrintDialog.AllowCurrentPage = false;
MyPrintDialog.AllowPrintToFile = false;
MyPrintDialog.AllowSelection = false;
MyPrintDialog.AllowSomePages = false;
MyPrintDialog.ShowHelp = false;
MyPrintDialog.ShowNetwork = false;
if (MyPrintDialog.ShowDialog() != DialogResult.OK)
return false;
printDocument1.DocumentName = "Client Reprots";
printDocument1.PrinterSettings = MyPrintDialog.PrinterSettings;
printDocument1.DefaultPageSettings = MyPrintDialog.PrinterSettings.DefaultPageSettings;
printDocument1.DefaultPageSettings.Margins = new Margins(40, 40, 40, 40);
if (MessageBox.Show("Do you want the report to be centered on the page", "InvoiceManager - Center on Page", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
MyDataGridViewPrinter = new DataGridViewPrinter(dataGridView1, printDocument1, true, true, "Client", new Font("Tahoma", 18, FontStyle.Bold, GraphicsUnit.Point), Color.Black, true);
}
else
{
MyDataGridViewPrinter = new DataGridViewPrinter(dataGridView1, printDocument1, false, true, "Client", new Font("Tahoma", 18, FontStyle.Bold, GraphicsUnit.Point), Color.Black, true);
}
return true; |
|