public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
     crptStockJournalReport rpt = new crptStockJournalReport();
     rpt.Site = this.Site;
     return rpt;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Function to print StockJournalReport in curresponding Crystal report
        /// </summary>
        /// <param name="dsStockJournalReport"></param>
        internal void StockJournalReportPrint(DataSet dsStockJournalReport)
        {
            try
            {

                crptStockJournalReport crptStockJournalReportObj = new crptStockJournalReport();

                foreach (DataTable dtbl in dsStockJournalReport.Tables)
                {
                    if (dtbl.TableName == "Table1")
                    {
                        crptStockJournalReportObj.Database.Tables["dtblCompany"].SetDataSource(dtbl);
                    }
                    else if (dtbl.TableName == "Table2")
                    {

                        crptStockJournalReportObj.Database.Tables["dtblStockJournalReport"].SetDataSource(dtbl);

                    }


                }
                this.crptViewer.ReportSource = crptStockJournalReportObj;
                SettingsSP spSettings = new SettingsSP();

                if (spSettings.SettingsStatusCheck("DirectPrint") == "No")
                {
                    base.Show();
                    this.BringToFront();
                }
                else
                {
                    crptStockJournalReportObj.PrintToPrinter(1, false, 0, 0);
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show("" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }