ActiveReport 可以跳过打印预览也跳过打印机选择直接打印吗?
ActiveReport 可以跳过打印预览也跳过打印机选择直接打印吗? 回复 1楼a729815303的帖子Private Sub btnPrint()
Load rptInvoice
rptInvoice.dcRptData.RecordSource = "SELECT * FROM Invoices " & " WHERE OrderID= "& Str(lSelectedOrder)
rptInvoice.PrintReport False
Unload rptInvoice
End Sub 回复 1楼a729815303的帖子
测试代码如下:
PageReport pr = new PageReport(new FileInfo(Path.Combine(Application.StartupPath, "..\\..\\PageReport1.rdlx")));
pr.Document.Printer.PrinterName = "Microsoft XPS Document Writer";
pr.Document.Printer.Landscape = true;
pr.Run();
pr.Document.Print(false,false,false);
感谢 回复 4楼a729815303的帖子
:mj72:
为了给你提供更优质的服务,请对本次服务进行评分。我们会认真对待你提出的宝贵意见,谢谢http://gcdn.gcpowertools.com.cn/attachment.aspx?attachmentid=10062 版主, 那如果是在HTML上呢?有个打印按钮. 用JS吗? 还是?
貌似您提供的代码是直接是C/S模式的客户端工具上执行的吧? 回复 6楼qakmak的帖子
是服务端代码,可以通过 Server Button 的 Click 事件来调用3#代码,无法通过javascript代码指定打印机,谢谢
测试代码:
protected void Button2_Click(object sender, EventArgs e)
{
PageReport pr = new PageReport(new FileInfo(this.Server.MapPath("PageReport1.rdlx")));
pr.Document.Printer.PrinterName = "Microsoft XPS Document Writer";
pr.Document.Printer.Landscape = true;
pr.Run();
pr.Document.Printer.Print();
}
为了给你提供更优质的服务,请对本次服务进行评分。我们会认真对待你提出的宝贵意见,谢谢http://gcdn.gcpowertools.com.cn/attachment.aspx?attachmentid=10062 在WPF里应该怎么做呢 ?
WPF也是一样的,直接使用该代码实现静默打印就行。
WPF也是一样的,直接使用该代码实现静默打印就行。
页:
[1]