private void btnPrint_Click(object sender, EventArgs e) { DialogResult res = RadMessageBox.Show("Print Absen Staff. Siap kan kertas di printer." , "Print Absen Staff" , MessageBoxButtons.OKCancel , RadMessageIcon.Question , MessageBoxDefaultButton.Button2); if (res == System.Windows.Forms.DialogResult.OK) { //Print Slip Gaji rptAbsenOther ab = new rptAbsenOther(); ab.ReportParameters[0].Value = "satpam"; ab.ReportParameters[1].Value = rddGBID.SelectedValue; IReportDocument report1 = (IReportDocument)ab; ////set parameters when necessary //// PrinterSettings PrinterSettings printerSettings = new PrinterSettings(); //// Adjust the printer settings if necessary... InstanceReportSource reportSource = new InstanceReportSource(); reportSource.ReportDocument = report1; // Print the report using the printer settings. ReportProcessor reportProcessor = new ReportProcessor(); reportProcessor.PrintReport(reportSource, printerSettings); helper.PrintLog(this.GetType().Name, ab.Name, "Memberid : " + rddMember.Text + "; GBID:" + rddGBID.Text); } }
private void btnPrint_Click(object sender, EventArgs e) { DialogResult res = MessageBox.Show("Print Absen Staff. Siap kan kertas di printer." , "Print Absen Staff" , MessageBoxButtons.OKCancel , MessageBoxIcon.Question , MessageBoxDefaultButton.Button2 , MessageBoxOptions.DefaultDesktopOnly); if (res == System.Windows.Forms.DialogResult.OK) { //Print Slip Gaji rptAbsenOther ab = new rptAbsenOther(); ab.ReportParameters[0].Value = "staff"; ab.ReportParameters[1].Value = rddGBID.SelectedValue; IReportDocument report1 = (IReportDocument)ab; ////set parameters when necessary //// PrinterSettings PrinterSettings printerSettings = new PrinterSettings(); //// Adjust the printer settings if necessary... // Print the report using the printer settings. ReportProcessor reportProcessor = new ReportProcessor(); reportProcessor.PrintReport(report1, printerSettings); helper.PrintLog(this.GetType().Name, ab.Name, "GBID:" + rddGBID.SelectedValue.ToString()); } }