This is a migrated thread and some comments may be shown as answers.

i face this error external component has thrown an exception

0 Answers 83 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
shanker bangari
Top achievements
Rank 1
shanker bangari asked on 03 May 2010, 07:34 AM

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);
                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.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);
                //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 


No answers yet. Maybe you can help?

General Discussions
Asked by
shanker bangari
Top achievements
Rank 1
Share this question