我需要一些关于mvc 4中rdlc报告的帮助。
在我的项目中,当用户点击按钮时,我有一个rdlc报告。我将在另一个标签中显示该报告。
当用户点击按钮时,如何将打印请求直接发送到系统环境中配置的默认打印机而不显示打印预览对话框?
答案 0 :(得分:0)
ReportingSerivceLib.PrintManager objPrintManager = new PrintManager();
IList<ParameterValue> parameters = new List<ParameterValue>();
parameters.Add(new ParameterValue {
Name = "Sales_Bill_ID",
Value = POS_Sales_Bill_MasterObj.POS_Sales_Bill_Master.Sales_Bill_ID.ToString()
});
var imgname1 = db.POS_Sales_Bill_Master.SingleOrDefault(
a => a.Sales_Bill_ID == POS_Sales_Bill_MasterObj.POS_Sales_Bill_Master.Sales_Bill_ID).ATTRIBUTE1;
parameters.Add(new ParameterValue {
Name = "Barcode_Parameter", Value = path + "/barcode/" + imgname1.ToString()
});
parameters.Add(new ParameterValue {
Name = "Report_Code", Value = "RPT_Sales_Bill_Receipt"
});
parameters.Add(new ParameterValue {
Name = "Logo_Parameter", Value = "abcteskfdk"
});
string Rpt_Folder_Name = System.Configuration.ConfigurationManager.AppSettings["ReportPath"];
objPrintManager.PrintReport(Rpt_Folder_Name + "RPT_Sales_Bill_Receipt", parameters.ToArray(), -1, -1);