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

printing problem in custom button click

0 Answers 101 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 10 Jun 2010, 10:32 AM
Hi ,Every one

I am  doing one project  .My requirement is when i click custom button  than report is printing  with out open report .i worte this code .It's working develop system.But it's not working on server and other system.How to print report in custom button click event .

this is my code  How to find this please give me  any example 


 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); 
 
               
            } 




thanks and regards
shanker.B

No answers yet. Maybe you can help?

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