Ejemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rpt_BulkOrderPrint rpt = new rpt_BulkOrderPrint();

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 2
0
        private void TaxInvoicePrint()
        {
            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", a.InvoiceCopyOf);
                        cmd.CommandTimeout = 0;
                        con.Open();
                        SqlDataAdapter da = new SqlDataAdapter(cmd);
                        DataTable      dt = new DataTable();
                        da.Fill(dt);
                        if (dt.Rows.Count > 0)
                        {
                            rpt_BulkOrderPrint rpt = new rpt_BulkOrderPrint();
                            rpt.SetDataSource(dt);
//                            rpt.SetParameterValue("@InvoiceCopyOf", a.InvoiceCopyOf);

                            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)
                            {
                            }

                            //                            Load_CrystalReport_TaxData();
//                            TaxInvoicePrint_TaxData();
                            crystalReportViewer1.ShowGroupTreeButton = false;
                            crystalReportViewer1.ToolPanelView       = ToolPanelViewType.None;
                            crystalReportViewer1.ReportSource        = rpt;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Alert Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }