1
votes

I need some help regarding rdlc report in mvc 4.

In my project i have a rdlc report when the user clicks on a button. I will show the report in another tab.

When the user clicks on the button how can I send the print request directly to the default printer which is configured in the system environment without showing a print preview dialogue?

1

1 Answers

0
votes
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);