public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crptProductStatisticsFastMoving rpt = new crptProductStatisticsFastMoving(); rpt.Site = this.Site; return(rpt); }
/// <summary> /// Function to print ProductStatisticsReport in curresponding Crystal report /// </summary> /// <param name="dsProductStatistics"></param> /// <param name="strLevels"></param> internal void ProductStatisticsReport(DataSet dsProductStatistics, string strLevels) { try { crptProductStatisticsReport crptProductStatisticsReport = new crptProductStatisticsReport(); crptProductStatisticsFastMoving crptProductStatisticsFastMoving = new crptProductStatisticsFastMoving(); crptProductStatisticsMaximumLevel crptProductStatisticsMaximumLevel = new crptProductStatisticsMaximumLevel(); crptProductStatisticsMinimumLevel crptProductStatisticsMinimumLevel = new crptProductStatisticsMinimumLevel(); crptProductStatisticsNegativeStock crptProductStatisticsNegativeStock = new crptProductStatisticsNegativeStock(); crptProductStatisticsReorderLevel crptProductStatisticsReorderLevel = new crptProductStatisticsReorderLevel(); crptProductStatisticsSlowMoving crptProductStatisticsSlowMoving = new crptProductStatisticsSlowMoving(); crptProductStatisticsUnUsed crptProductStatisticsUnused = new crptProductStatisticsUnUsed(); foreach (DataTable dtbl in dsProductStatistics.Tables) { if (dtbl.TableName == "Table") { if (strLevels == "Minimum Level") { crptProductStatisticsMinimumLevel.Database.Tables["dtblCompany"].SetDataSource(dtbl); } if (strLevels == "Maximum Level") { crptProductStatisticsMaximumLevel.Database.Tables["dtblCompany"].SetDataSource(dtbl); } if (strLevels == "Negative Stock") { crptProductStatisticsNegativeStock.Database.Tables["dtblCompany"].SetDataSource(dtbl); } if (strLevels == "Reorder Level") { crptProductStatisticsReorderLevel.Database.Tables["dtblCompany"].SetDataSource(dtbl); } if (strLevels == "UnUsed") { crptProductStatisticsUnused.Database.Tables["dtblCompany"].SetDataSource(dtbl); } if (strLevels == "Fast Movings") { crptProductStatisticsFastMoving.Database.Tables["dtblCompany"].SetDataSource(dtbl); } if (strLevels == "Slow Movings") { crptProductStatisticsSlowMoving.Database.Tables["dtblCompany"].SetDataSource(dtbl); } } else if (dtbl.TableName == "Table1") { if (strLevels == "Minimum Level") { crptProductStatisticsMinimumLevel.Database.Tables["dtblProductStatistics"].SetDataSource(dtbl); } if (strLevels == "Maximum Level") { crptProductStatisticsMaximumLevel.Database.Tables["dtblProductStatistics"].SetDataSource(dtbl); } if (strLevels == "Negative Stock") { crptProductStatisticsNegativeStock.Database.Tables["dtblProductStatistics"].SetDataSource(dtbl); } if (strLevels == "Reorder Level") { crptProductStatisticsReorderLevel.Database.Tables["dtblProductStatistics"].SetDataSource(dtbl); } if (strLevels == "UnUsed") { crptProductStatisticsUnused.Database.Tables["dtblProductStatistics"].SetDataSource(dtbl); } if (strLevels == "Fast Movings") { crptProductStatisticsFastMoving.Database.Tables["dtblProductStatistics"].SetDataSource(dtbl); } if (strLevels == "Slow Movings") { crptProductStatisticsSlowMoving.Database.Tables["dtblProductStatistics"].SetDataSource(dtbl); } } } if (strLevels == "Minimum Level") { this.crptViewer.ReportSource = crptProductStatisticsMinimumLevel; } if (strLevels == "Maximum Level") { this.crptViewer.ReportSource = crptProductStatisticsMaximumLevel; } if (strLevels == "Negative Stock") { this.crptViewer.ReportSource = crptProductStatisticsNegativeStock; } if (strLevels == "Reorder Level") { this.crptViewer.ReportSource = crptProductStatisticsReorderLevel; } if (strLevels == "UnUsed") { this.crptViewer.ReportSource = crptProductStatisticsUnused; } if (strLevels == "Fast Movings") { this.crptViewer.ReportSource = crptProductStatisticsFastMoving; } if (strLevels == "Slow Movings") { this.crptViewer.ReportSource = crptProductStatisticsSlowMoving; } SettingsSP spSettings = new SettingsSP(); if (spSettings.SettingsStatusCheck("DirectPrint") == "No") { base.Show(); this.BringToFront(); } else { crptProductStatisticsReport.PrintToPrinter(1, false, 0, 0); } } catch (Exception ex) { MessageBox.Show("PSR" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crptProductStatisticsFastMoving rpt = new crptProductStatisticsFastMoving(); rpt.Site = this.Site; return rpt; }