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

            rpt.Site = this.Site;
            return(rpt);
        }
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     PettyCashVoucherReport rpt = new PettyCashVoucherReport();
     rpt.Site = this.Site;
     return rpt;
 }
        /*   private void loadGrid()
        {
            core_petty_cash_payment_voucher pcvObj = new core_petty_cash_payment_voucher();
            DataSet ds = pcvObj.SelectMethod(@"SELECT
        pcv.Id_Petty_Cash_Voucher,
        pcv.Id_Petty_Cash_Book,
        pcb.Petty_Cash_Book_Name,
        pcb.Petty_Cash_Book_Code,
        pcb.Available_Balance_Amount,
        pcv.Id_Petty_Cash_Category,
        pcc.Petty_Cash_Category_Name,
        pcc.Petty_Cash_Category_Code,
        pcv.Cash_Out_Amount,
        pcv.Business_Purpose,
        pcv.Received_By,
        pcv.Petty_Cash_Voucher_Remark,
        pcv.Post_Payment,
        CASE WHEN  pcv.Post_Payment=0 THEN 'Post-payment' ELSE 'Pre-payment' END AS Payment_Type,
        pcv.Created_Date,
        pcv.Created_User,
        pcv.Edited_Date,
        pcv.Edited_User
        FROM core_petty_cash_payment_voucher AS pcv
        INNER JOIN core_petty_cash_book AS pcb ON pcv.Id_Petty_Cash_Book=pcb.Id_Petty_Cash_Book
        INNER JOIN core_petty_cash_category AS pcc ON pcv.Id_Petty_Cash_Category=pcc.Id_Petty_Cash_Category
        WHERE pcv.Is_Active='0';", "core_petty_cash_payment_voucher");
            if (ds.Tables["core_petty_cash_payment_voucher"] != null)
            {
                GridView1.DataSource = ds.Tables["core_petty_cash_payment_voucher"];
                GridView1.DataBind();
            }
            else
            {
                GridView1.DataSource = new int[] { };
                GridView1.DataBind();
            }
        } */
        private void getReport()
        {
            PettyCashVoucherReport irpt = new PettyCashVoucherReport();
            if (IsPostBack)
            {
                TextObject pcvID = (TextObject)irpt.ReportDefinition.Sections["Section1"].ReportObjects["Text3"];
                TextObject cashoutamount = (TextObject)irpt.ReportDefinition.Sections["Section3"].ReportObjects["Text21"];
                TextObject receivedby = (TextObject)irpt.ReportDefinition.Sections["Section3"].ReportObjects["Text22"];
                TextObject paymentType = (TextObject)irpt.ReportDefinition.Sections["Section3"].ReportObjects["Text23"];
                TextObject businesssPurpose = (TextObject)irpt.ReportDefinition.Sections["Section3"].ReportObjects["Text24"];
                TextObject pcbName = (TextObject)irpt.ReportDefinition.Sections["Section3"].ReportObjects["Text25"];
                TextObject pcbCode = (TextObject)irpt.ReportDefinition.Sections["Section3"].ReportObjects["Text26"];
                TextObject pccName = (TextObject)irpt.ReportDefinition.Sections["Section3"].ReportObjects["Text27"];
                TextObject pccCode = (TextObject)irpt.ReportDefinition.Sections["Section3"].ReportObjects["Text28"];
                TextObject remark = (TextObject)irpt.ReportDefinition.Sections["Section3"].ReportObjects["Text29"];
                pcbName.Text = ddlPCBName.SelectedItem.Text;
                pcbCode.Text = ddlPCBCode.SelectedItem.Text;
                pccName.Text = ddlPCCName.SelectedItem.Text;
                pccCode.Text = ddlPCCCode.SelectedItem.Text;
                remark.Text = PCV_Remark.Text;
                pcvID.Text = PCV_Id.Text;
                cashoutamount.Text = cashOutAmount.Text;
                receivedby.Text = receivedBy.Text;
                paymentType.Text = RadioButtonList1.SelectedValue.ToString();
                businesssPurpose.Text = businessPurpose.Text;
            }

            // crvPettyCashVoucherReport.ReportSource = null;

            crvPettyCashVoucherReport.EnableDatabaseLogonPrompt = false;

            Session["ReportDocument"] = irpt;
            ReportDocument doc = (ReportDocument)Session["ReportDocument"];

            if (doc != null)
                crvPettyCashVoucherReport.ReportSource = doc;

            crvPettyCashVoucherReport.DataBind();
        }