public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crptProductSearchMaximum rpt = new crptProductSearchMaximum(); rpt.Site = this.Site; return(rpt); }
/// <summary> /// Function to print ProductSearchReport in curresponding Crystal report /// </summary> /// <param name="dsProductSearch"></param> /// <param name="strLevels"></param> internal void ProductSearchReport(DataSet dsProductSearch, string strLevels) { try { crptProductSearchReport crptProductSearchReport = new crptProductSearchReport(); crptProductSearchMinimumStock crptProductSearchMinimumStock = new crptProductSearchMinimumStock(); crptProductSearchMaximum crptProductSearchMaximum = new crptProductSearchMaximum(); crptProductSearchNegativeStock crptProductSearchNegativeStock = new crptProductSearchNegativeStock(); crptProductSearchReorderStock crptProductSearchReorderStock = new crptProductSearchReorderStock(); foreach (DataTable dtbl in dsProductSearch.Tables) { if (dtbl.TableName == "Table") { if (strLevels == "All") { crptProductSearchReport.Database.Tables["dtblCompany"].SetDataSource(dtbl); } if (strLevels == "Minimum Level") { crptProductSearchMinimumStock.Database.Tables["dtblCompany"].SetDataSource(dtbl); } if (strLevels == "Maximum Level") { crptProductSearchMaximum.Database.Tables["dtblCompany"].SetDataSource(dtbl); } if (strLevels == "Negative Stock") { crptProductSearchNegativeStock.Database.Tables["dtblCompany"].SetDataSource(dtbl); } if (strLevels == "Reorder Level") { crptProductSearchReorderStock.Database.Tables["dtblCompany"].SetDataSource(dtbl); } } else if (dtbl.TableName == "Table1") { if (strLevels == "All") { crptProductSearchReport.Database.Tables["dtblProductSearch"].SetDataSource(dtbl); } if (strLevels == "Minimum Level") { crptProductSearchMinimumStock.Database.Tables["dtblProductSearch"].SetDataSource(dtbl); } if (strLevels == "Maximum Level") { crptProductSearchMaximum.Database.Tables["dtblProductSearch"].SetDataSource(dtbl); } if (strLevels == "Negative Stock") { crptProductSearchNegativeStock.Database.Tables["dtblProductSearch"].SetDataSource(dtbl); } if (strLevels == "Reorder Level") { crptProductSearchReorderStock.Database.Tables["dtblProductSearch"].SetDataSource(dtbl); } } } if (strLevels == "All") { this.crptViewer.ReportSource = crptProductSearchReport; } if (strLevels == "Minimum Level") { this.crptViewer.ReportSource = crptProductSearchMinimumStock; } if (strLevels == "Maximum Level") { this.crptViewer.ReportSource = crptProductSearchMaximum; } if (strLevels == "Negative Stock") { this.crptViewer.ReportSource = crptProductSearchNegativeStock; } if (strLevels == "Reorder Level") { this.crptViewer.ReportSource = crptProductSearchReorderStock; } SettingsSP spSettings = new SettingsSP(); if (spSettings.SettingsStatusCheck("DirectPrint") == "No") { base.Show(); this.BringToFront(); } else { crptProductSearchReport.PrintToPrinter(1, false, 0, 0); } } catch (Exception ex) { MessageBox.Show("PS" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crptProductSearchMaximum rpt = new crptProductSearchMaximum(); rpt.Site = this.Site; return rpt; }