public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crptPurchaseOrderReport1 rpt = new crptPurchaseOrderReport1(); rpt.Site = this.Site; return(rpt); }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crptPurchaseOrderReport1 rpt = new crptPurchaseOrderReport1(); rpt.Site = this.Site; return rpt; }
/// <summary> /// Function to print PurchaseOrderReport in curresponding Crystal report /// </summary> /// <param name="dsPurchaseOrderReport"></param> /// <param name="strTotal"></param> public void PurchaseOrderReportPrinting(DataSet dsPurchaseOrderReport, string strTotal) { try { DataTable dtblTotalAmount = new DataTable(); dtblTotalAmount.Columns.Add("Grandtotal", typeof(string)); DataRow dr = dtblTotalAmount.NewRow(); dr[0] = strTotal; dtblTotalAmount.Rows.InsertAt(dr, 0); crptPurchaseOrderReport1 crptPurchaseOrderReport1 = new crptPurchaseOrderReport1(); foreach (DataTable dtbl in dsPurchaseOrderReport.Tables) { if (dtbl.TableName == "Table") { crptPurchaseOrderReport1.Database.Tables["dtblCompany"].SetDataSource(dtbl); } else if (dtbl.TableName == "Table1") { crptPurchaseOrderReport1.Database.Tables["dtblPurchaseOrderReport"].SetDataSource(dtbl); } } crptPurchaseOrderReport1.Database.Tables["dtblTotal"].SetDataSource(dtblTotalAmount); this.crptViewer.ReportSource = crptPurchaseOrderReport1; SettingsSP spSettings = new SettingsSP(); if (spSettings.SettingsStatusCheck("DirectPrint") == "No") { base.Show(); this.BringToFront(); } else { crptPurchaseOrderReport1.PrintToPrinter(1, false, 0, 0); } } catch (Exception ex) { MessageBox.Show("CRV" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }