public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crptSalesOrderReportPrinting rpt = new crptSalesOrderReportPrinting();

            rpt.Site = this.Site;
            return(rpt);
        }
Example #2
0
        /// <summary>
        ///  Function to print  SalesOrderReport in curresponding Crystal report
        /// </summary>
        /// <param name="dsSalesOrderReport"></param>
        /// <param name="strTotal"></param>
        public void SalesOrderReportPrinting(DataSet dsSalesOrderReport, 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);

                crptSalesOrderReportPrinting crptSalesOrderReportObj = new crptSalesOrderReportPrinting();
                foreach (DataTable dtbl in dsSalesOrderReport.Tables)
                {
                    if (dtbl.TableName == "Table1")
                    {
                        crptSalesOrderReportObj.Database.Tables["dtblCompanyReport"].SetDataSource(dtbl);
                    }
                    else if (dtbl.TableName == "Table2")
                    {

                        crptSalesOrderReportObj.Database.Tables["dtblSalesOrderReport"].SetDataSource(dtbl);


                    }

                }
                crptSalesOrderReportObj.Database.Tables["dtblTotal"].SetDataSource(dtblTotalAmount);
                this.crptViewer.ReportSource = crptSalesOrderReportObj;

                SettingsSP spSettings = new SettingsSP();
                if (spSettings.SettingsStatusCheck("DirectPrint") == "No")
                {
                    base.Show();
                    this.BringToFront();
                }
                else
                {
                    crptSalesOrderReportObj.PrintToPrinter(1, false, 0, 0);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("CRV15:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
     crptSalesOrderReportPrinting rpt = new crptSalesOrderReportPrinting();
     rpt.Site = this.Site;
     return rpt;
 }