예제 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            TaxDetailsForBulkOrder rpt = new TaxDetailsForBulkOrder();

            rpt.Site = this.Site;
            return(rpt);
        }
예제 #2
0
 private void DuplicateTokenPrint()
 {
     try
     {
         using (SqlConnection con = new SqlConnection(ConnString))
         {
             using (SqlCommand cmd = new SqlCommand("GetBulkOrderForPrintingByOrderID", con))
             {
                 AppConfiguration a = new AppConfiguration();
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.AddWithValue("@OrderID", a.OrderID);
                 cmd.Parameters.AddWithValue("@InvoiceCopyOf", "<< Duplicate Copy >>");
                 cmd.CommandTimeout = 0;
                 con.Open();
                 SqlDataAdapter da = new SqlDataAdapter(cmd);
                 DataTable      dt = new DataTable();
                 da.Fill(dt);
                 if (dt.Rows.Count > 0)
                 {
                     rpt_TokenDuplicatePrint rpt = new rpt_TokenDuplicatePrint();
                     rpt.SetDataSource(dt);
                     try
                     {
                         using (SqlConnection Subcon = new SqlConnection(ConnString))
                         {
                             using (SqlCommand Subcmd = new SqlCommand("GetTaxGroupingDetailsForInvoiceByOrderID", Subcon))
                             {
                                 Subcmd.CommandType = CommandType.StoredProcedure;
                                 Subcmd.Parameters.AddWithValue("@OrderID", a.OrderID);
                                 Subcmd.CommandTimeout = 0;
                                 Subcon.Open();
                                 SqlDataAdapter Subda = new SqlDataAdapter(Subcmd);
                                 DataTable      Subdt = new DataTable();
                                 Subda.Fill(Subdt);
                                 if (Subdt.Rows.Count > 0)
                                 {
                                     TaxDetailsForBulkOrder Subrpt = new TaxDetailsForBulkOrder();
                                     Subrpt.SetDataSource(Subdt);
                                     rpt.Subreports[0].SetDataSource(Subdt);
                                 }
                             }
                         }
                     }
                     catch (Exception)
                     {
                     }
                     crystalReportViewer1.ShowGroupTreeButton = false;
                     crystalReportViewer1.ToolPanelView       = ToolPanelViewType.None;
                     crystalReportViewer1.ReportSource        = rpt;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Alert Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }