Пример #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            TaxDetailsForCashMemo rpt = new TaxDetailsForCashMemo();

            rpt.Site = this.Site;
            return(rpt);
        }
Пример #2
0
        private void CashMemoPrint()
        {
            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_CashMemoOrderPrint rpt = new rpt_CashMemoOrderPrint();
                            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)
                                        {
                                            TaxDetailsForCashMemo Subrpt = new TaxDetailsForCashMemo();
                                            Subrpt.SetDataSource(Subdt);
                                            rpt.Subreports[0].SetDataSource(Subdt);
                                        }
                                    }
                                }
                            }
                            catch (Exception)
                            {
                            }

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