Ejemplo n.º 1
0
        private void PrintPreview(bool IsPrint)
        {
            string strDateFrom = this.dtpFrom.Value.ToString("dd/MM/yyyy");;
            string strDateTo   = this.dtpTo.Value.ToString("dd/MM/yyyy");;

            string sql = "";

            Hashtable ht = new Hashtable();


            ht.Add("paramCompany", bllUtility.LoggedInSystemInformation.CompanyName);
            ht.Add("paramComAddress", bllUtility.LoggedInSystemInformation.CompanyAddress);
            ht.Add("paramComContact", bllUtility.LoggedInSystemInformation.CompanyContactNo);
            ht.Add("paramRptTitle", "Purchase Statement Report");
            ht.Add("paramDateFrom", strDateFrom);
            ht.Add("paramDateTo", strDateTo);

            sql = "[dbo].[USP_RptPurchaseStatement] '" + strDateFrom.Trim() + "','" + strDateTo.Trim() + "'";
            rptPurchaseStatement irptPurchaseStatement = new rptPurchaseStatement();

            iReportUtility.PrintPreview(irptPurchaseStatement, sql, ht, IsPrint);
        }
        private void PrintPreview(bool IsPrint)
        {
            string supplier_id        = "";
            string manufacturer_id    = "";
            string param_Supplier     = "";
            string param_Manufacturer = "";

            if (cmb_supplier.EditValue == null || cmb_supplier.EditValue.ToString() == "")
            {
                supplier_id    = "0";
                param_Supplier = "Supplier : All";
            }
            else
            {
                supplier_id    = cmb_supplier.EditValue.ToString();
                param_Supplier = "Supplier : " + cmb_supplier.Text;
            }

            if (cmb_manufacturer.EditValue == null || cmb_manufacturer.EditValue.ToString() == "")
            {
                manufacturer_id    = "0";
                param_Manufacturer = "Manufacturer : All";
            }
            else
            {
                manufacturer_id    = cmb_manufacturer.EditValue.ToString();
                param_Manufacturer = "Manufacturer : " + cmb_manufacturer.Text;
            }

            string strDateFrom = bllUtility.FormatDate(dtpFrom);
            string strDateTo   = bllUtility.FormatDate(dtpTo);

            string sql        = "";
            string ReportType = "";

            if (rptDetails.Checked == true)
            {
                ReportType = "Details";
            }
            else
            {
                ReportType = "Summary";
            }

            Hashtable ht = new Hashtable();


            ht.Add("paramCompany", bllUtility.LoggedInSystemInformation.CompanyName);
            ht.Add("paramComAddress", bllUtility.LoggedInSystemInformation.CompanyAddress);
            ht.Add("paramComContact", bllUtility.LoggedInSystemInformation.CompanyContactNo);
            ht.Add("paramRptTitle", "Purchase Statement Report");
            ht.Add("paramDateFrom", strDateFrom);
            ht.Add("paramDateTo", strDateTo);


            sql = "[dbo].[USP_RptPurchaseStatement] '" + strDateFrom.Trim() + "','" + strDateTo.Trim() + "','" + ReportType + "','" + supplier_id + "','" + manufacturer_id + "'";

            if (rptDetails.Checked == true)
            {
                ht.Add("supplier", param_Supplier);
                ht.Add("manufacturer", param_Manufacturer);
                rptPurchaseStatement irptPurchaseStatement = new rptPurchaseStatement();
                iReportUtility.PrintPreview(irptPurchaseStatement, sql, ht, IsPrint);
            }
            else
            {
                rptPurchaseStatementSummary irptPurchaseStatementSummary = new rptPurchaseStatementSummary();
                iReportUtility.PrintPreview(irptPurchaseStatementSummary, sql, ht, IsPrint);
            }
        }