导出CrystalReport的文件硬编码的格式
1
2
CrystalDecisions.Shared.DiskFileDestinationOptions DiskOpts = new CrystalDecisions.Shared.DiskFileDestinationOptions();//提供属性,以便获取和设置导出到磁盘时的文件名
3
ReportDoc.ExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;//指定导出目标类型
4
switch (ddlFormat.SelectedItem.Text)
5
道出报表方法rt()
2
3
4
5
2。打映的硬编码方式
1
// 指定打印机名称,这里是网络工作站Gigi上的打印机Hp Jet 6
2
string strPrinterName;
3
strPrinterName = @"Canon Bubble-Jet BJC-210SP";
4
// 设置打印页边距
5
PageMargins margins;
6
margins = ReportDoc.PrintOptions.PageMargins;
7
margins.bottomMargin = 250;
8
margins.leftMargin = 350;
9
margins.rightMargin = 350;
10
margins.topMargin = 450;
11
ReportDoc.PrintOptions.ApplyPageMargins(margins);
12
//应用打印机名称
13
ReportDoc.PrintOptions.PrinterName = strPrinterName;
14
// 打印 // 打印报表。将 startPageN 和 endPageN
15
// 参数设置为 0 表示打印所有页。
16
ReportDoc.PrintToPrinter(1, false,0,0);
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
3.完整的代码留下足迹,发给抛下砖头的人,呵呵