Hi,
this is shanker i am doing one project .Me requirement is print report without showing the telrik report.Its working on developer system .But not worked on other system and server and local server i got this error "external component has thrown an exception" How to solve this problem please give solution of this problem
this my code
if (e.CommandName == "Print")
{
int? fee_receipt_id = int.Parse(e.CommandArgument.ToString());
int? status_code = null;
int? call_user_id = LogonDetails.Instance.sys_lclvar_user_id;
int? call_screen_id = GetScreenId();
int? session_id = LogonDetails.Instance.sys_lclvar_session_id;
string call_ip_address = CommonMethods.CurrentIP;
bool? audit_report_execution = LogonDetails.Instance.sys_lclvar_audit_user_action;
bool? audit_user_action = LogonDetails.Instance.sys_lclvar_audit_user_action;
string status_text = String.Empty;
var printdata = ReportsManager.get_report_fee_receipt(
fee_receipt_id, call_screen_id, call_user_id, session_id, call_ip_address, audit_user_action, audit_report_execution, ref status_code, ref status_text);
if ((!status_code.HasValue) || (status_code.Value != 0))
{
DisplayMessage(false, status_text);
return;
}
string strTitle = LogonDetails.Instance.sys_lclvar_facility_name;
var report = new TelerikComponentsWS.Reports.RepFeeReceipt();
report.DataSource = printdata;
Telerik.Reporting.Drawing.ExternalStyleSheet exx = new Telerik.Reporting.Drawing.ExternalStyleSheet("~\\css\\ReprotStyleSheet.xml");
report.ExternalStyleSheets.Add(exx);
report.ReportParameters[0].Value = strTitle;
using (System.Windows.Forms.PrintDialog printDlg = new System.Windows.Forms.PrintDialog())
{
printDlg.AllowSomePages = true;
printDlg.AllowCurrentPage = false;
printDlg.UseEXDialog = true;
if (System.Windows.Forms.DialogResult.OK == printDlg.ShowDialog())
{
Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
reportProcessor.PrintReport(report, printDlg.PrinterSettings);
}
}
////Telerik.Reporting.Processing
//System.Drawing.Printing.PrinterSettings printerSettings = new System.Drawing.Printing.PrinterSettings();
//// Adjust the printer settings if necessary...
//System.Drawing.Printing.PrintController standardPrintController = new System.Drawing.Printing.StandardPrintController();
//printerSettings.PrinterName = "MyHomePrinter";
//// Print the report using the printer settings.
//Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
//reportProcessor.PrintController = standardPrintController;
//reportProcessor.PrintReport(report, printerSettings);
}
please send replay it's argent
thanks and regards
shanker.B