예제 #1
0
        private void btnShowReport_Click(object sender, EventArgs e)
        {
            if (int.TryParse(Convert.ToString(cmbSession.SelectedValue), out tryparse))
            {
                sessionID = tryparse;
            }
            dt = bal.GetIPORequestToBlockIPOAmount(sessionID);
            crIPORequestToBlockIPOAmount cr = new crIPORequestToBlockIPOAmount();
            frmReportViewer view            = new frmReportViewer();

            cr.SetDataSource(dt);
            view.crvReportViewer.ReportSource = cr;
            view.Show();
        }
예제 #2
0
        private void ShowReport()
        {
            SpotMarketShareBuySellBAL objBAL      = new SpotMarketShareBuySellBAL();
            DataTable       data                  = new DataTable();
            frmReportViewer rptviewer             = new frmReportViewer();
            crSpotMarketShareBuySellReport objrpt = new crSpotMarketShareBuySellReport();

            data = objBAL.GetSpotMarketcShareBuySellReport(dtpStartDate.Value, dtpEndDate.Value);
            objrpt.SetDataSource(data);
            ((TextObject)objrpt.Section2.ReportObjects["txtFromDate"]).Text = dtpStartDate.Value.ToString("dd/MM/yyyy");
            ((TextObject)objrpt.Section2.ReportObjects["txtToDate"]).Text   = dtpEndDate.Value.ToString("dd/MM/yyyy");
            rptviewer.crvReportViewer.ReportSource = objrpt;
            rptviewer.Text = "Spot Market Share Buy/Sell Report";
            rptviewer.Show();
        }
예제 #3
0
 private void btnPDF_Click(object sender, EventArgs e)
 {
     if (ultraGrid1.ActiveRow != null)
     {
         DialogResult result = ShowSavePDF();
         if (result == DialogResult.Cancel)
         {
             return;
         }
         string          fileName = this.saveFileDialog1.FileName;
         int             id       = int.Parse(this.ultraGrid1.ActiveRow.Cells["ID"].Value.ToString());
         frmReportViewer frm      = new frmReportViewer();
         frm.ShowPDF(id, fileName);
         frm.ShowDialog();
     }
 }
        private void btnShow_Click(object sender, EventArgs e)
        {
            IPOReportBAL bal = new IPOReportBAL();
            DataTable    dt  = new DataTable();

            int Session_Id = (int)cmbsessionName.SelectedValue;

            dt = bal.GetIpoSummaryOfApplicationBySessionId(Session_Id);

            crIPOSummaryOfTheApplications crRpt = new crIPOSummaryOfTheApplications();
            frmReportViewer viewer = new frmReportViewer();

            crRpt.SetDataSource(dt);
            viewer.crvReportViewer.ReportSource = crRpt;
            viewer.Show();
        }
        private void ShowReport()
        {
            ZgroupBuySellReportBAL objBAL    = new ZgroupBuySellReportBAL();
            DataTable              data      = new DataTable();
            frmReportViewer        rptviewer = new frmReportViewer();
            crZ_groupBuySellReport objrpt    = new crZ_groupBuySellReport();
            int zgroupId;

            zgroupId = objBAL.GetZgroupCompanyId();
            data     = objBAL.GetZgroupShareBuySellReport(zgroupId, dtpStartDate.Value, dtpEndDate.Value);
            objrpt.SetDataSource(data);
            ((TextObject)objrpt.Section2.ReportObjects["txtFromDate"]).Text = dtpStartDate.Value.ToString("dd/MM/yyyy");
            ((TextObject)objrpt.Section2.ReportObjects["txtToDate"]).Text   = dtpEndDate.Value.ToString("dd/MM/yyyy");
            rptviewer.crvReportViewer.ReportSource = objrpt;
            rptviewer.Text = "Z-group share Buy/Sell Report";
            rptviewer.Show();
        }
        private void btnShowReport_Click(object sender, EventArgs e)
        {
            DataTable dt         = new DataTable();
            string    App_ID     = txtAppliationNo.Text;
            int       Session_Id = Convert.ToInt32(cmbSessionName.SelectedValue);
            crIPOForwardingLetterAfterResult crobj = new crIPOForwardingLetterAfterResult();
            frmReportViewer view = new frmReportViewer();

            dt = R_Bal.GetIPOForwardingLetterDataAfterResult(Session_Id, App_ID);
            string Add = dt.Rows[0]["Company_Addr"].ToString();

            Add.Replace("\n", "Dhaka");
            dt.Rows.Add("Add");
            crobj.SetDataSource(dt);
            view.crvReportViewer.ReportSource = crobj;
            view.Show();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            string ParentChildGroupCode = TxtCustCode.Text;
            //string NonParentChildCode = cmbnonGroupCode.Text;
            DataTable         dt   = new DataTable();
            CrParentChildInfo rpt  = new CrParentChildInfo();
            frmReportViewer   view = new frmReportViewer();

            dt = bal.GetAllChild_ShareAndMoney_Information(ParentChildGroupCode);

            rpt.SetDataSource(dt);
            GetCommonInfo();
            ((TextObject)rpt.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName;
            ((TextObject)rpt.ReportDefinition.Sections[2].ReportObjects["txtAddress"]).Text     = _branchAddress;
            ((TextObject)rpt.ReportDefinition.Sections[2].ReportObjects["txtReportName"]).Text  = "All Account Information";
            view.crvReportViewer.ReportSource = rpt;
            view.Show();
        }
예제 #8
0
        private void ShowMonthlyExpenseReport(DateTime FromDate, DateTime ToDate)
        {
            try
            {
                AssetInformationBAL     objAssetInfoBal          = new AssetInformationBAL();
                DataTable               dtMonthlyExpenseInfo     = new DataTable();
                cr_MonthlyExpenseReport objcrMonthlyExpenseInfo  = new cr_MonthlyExpenseReport();
                frmReportViewer         objfrmMonthlyExpenseInfo = new frmReportViewer();
                RecordLevelFilteringBAL recordLevelFilteringBAL  = new RecordLevelFilteringBAL();
                int TempBranchId = -2;

                dtMonthlyExpenseInfo = objAssetInfoBal.GetMonthlyCapexReport(FromDate, ToDate);

                int branchid   = Int32.Parse(dtMonthlyExpenseInfo.Rows[0][10].ToString());
                int resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Monthly_Expense_List);
                int criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId);


                TempBranchId = Convert.ToInt32(recordLevelFilteringBAL.FilterBranchID(branchid.ToString(), resourceId, criteriaId));
                if (TempBranchId == -1)
                {
                    dtMonthlyExpenseInfo.Rows.Clear();
                }

                objcrMonthlyExpenseInfo.SetDataSource(dtMonthlyExpenseInfo);

                ((TextObject)objcrMonthlyExpenseInfo.ReportDefinition.Sections[2].ReportObjects["txtFromDate"]).Text = "Fom: " + dtpFromDate.Value.ToString("MM-dd-yyyy");
                ((TextObject)objcrMonthlyExpenseInfo.ReportDefinition.Sections[2].ReportObjects["txtToDate"]).Text   = "To: " + dtpToDate.Value.ToString("MM-dd-yyyy");

                GetCommonInfo();
                ((TextObject)objcrMonthlyExpenseInfo.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName;
                ((TextObject)objcrMonthlyExpenseInfo.ReportDefinition.Sections[2].ReportObjects["txtAddress"]).Text     = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;


                objfrmMonthlyExpenseInfo.Text = "Monthly Expense Report";
                objfrmMonthlyExpenseInfo.crvReportViewer.ReportSource = objcrMonthlyExpenseInfo;
                objfrmMonthlyExpenseInfo.Show();
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #9
0
        private void btnViewReport_Click(object sender, EventArgs e)
        {
            if (ultraGrid2.ActiveRow != null)
            {
                int             id  = int.Parse(this.ultraGrid2.ActiveRow.Cells["ID"].Value.ToString());
                frmReportViewer frm = new frmReportViewer();
                frm.View(id);
                frm.ShowDialog();

                LoadData();
                foreach (UltraGridRow row in this.ultraGrid2.Rows)
                {
                    if (row.Cells["ID"].Value.ToString() == id.ToString())
                    {
                        row.Activate();
                        break;
                    }
                }
            }
        }
예제 #10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ExpenseOrPayment"></param>
        /// <param name="sorting">NEW added Sorting</param>
        private void MonthlyexpenseReport(string ExpenseOrPayment, string sorting)
        {
            ExpenseEntryBAL bal = new ExpenseEntryBAL();
            DataTable       dt  = new DataTable();

            dt = bal.GetMonthlyExpenseReport((DateTime)dt_FromDate.Value, (DateTime)dt_ToDate.Value, ExpenseOrPayment);
            crExpenseMonthly cr = new crExpenseMonthly();
            frmReportViewer  objreportviewer = new frmReportViewer();

            cr.SetDataSource(dt);
            GetCommonInfo();

            ((TextObject)cr.ReportDefinition.Sections[2].ReportObjects["txtcompanyname"]).Text = _CommpanyName;
            ((TextObject)cr.ReportDefinition.Sections[2].ReportObjects["txtaddress"]).Text     = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;;

            ((TextObject)cr.ReportDefinition.Sections[2].ReportObjects["txtfromDate"]).Text = dt_FromDate.Value.Date.ToShortDateString();
            ((TextObject)cr.ReportDefinition.Sections[2].ReportObjects["txtto"]).Text       = dt_ToDate.Value.Date.ToShortDateString();
            ((TextObject)cr.ReportDefinition.Sections[2].ReportObjects["Sorting"]).Text     = sorting;
            objreportviewer.crvReportViewer.ReportSource = cr;
            objreportviewer.Show();
        }
예제 #11
0
        private void GetCurrentAssetList()
        {
            try
            {
                AssetInformationBAL     objAssetInformationBal  = new AssetInformationBAL();
                DataTable               dtCurrentAssetList      = new DataTable();
                frmReportViewer         objfrmReportViewer      = new frmReportViewer();
                cr_CurrentAssetList     objcrCurrentAssetList   = new cr_CurrentAssetList();
                RecordLevelFilteringBAL recordLevelFilteringBAL = new RecordLevelFilteringBAL();
                dtCurrentAssetList = objAssetInformationBal.GetCurrentAssetInfo();

                int TempBranchId = -2;
                int branchid     = Int32.Parse(dtCurrentAssetList.Rows[0][8].ToString());

                int resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Current_Asset_List);
                int criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId);

                TempBranchId = Convert.ToInt32(recordLevelFilteringBAL.FilterBranchID(branchid.ToString(), resourceId, criteriaId));

                if (TempBranchId == -1)
                {
                    dtCurrentAssetList.Rows.Clear();
                }
                objcrCurrentAssetList.SetDataSource(dtCurrentAssetList);

                GetCommonInfo();
                ((TextObject)objcrCurrentAssetList.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName;
                ((TextObject)objcrCurrentAssetList.ReportDefinition.Sections[2].ReportObjects["txtAddress"]).Text     = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;


                objfrmReportViewer.crvReportViewer.ReportSource     = objcrCurrentAssetList;
                objfrmReportViewer.crvReportViewer.DisplayGroupTree = false;
                objfrmReportViewer.Text = "Current Asset List";
                objfrmReportViewer.Show();
            }
            catch (Exception)
            {
                throw;
            }
        }
 private void ParentChildGroupReport()
 {
     try
     {
         ParentAndChildBAL bal  = new ParentAndChildBAL();
         DataTable         dt   = new DataTable();
         CrParentChildInfo rpt  = new CrParentChildInfo();
         frmReportViewer   view = new frmReportViewer();
         dt = bal.GetAllChild_ShareAndMoney_Information(_custCode);
         rpt.SetDataSource(dt);
         GetCommonInfo();
         ((TextObject)rpt.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName;
         ((TextObject)rpt.ReportDefinition.Sections[2].ReportObjects["txtAddress"]).Text     = _branchAddress;
         ((TextObject)rpt.ReportDefinition.Sections[2].ReportObjects["txtReportName"]).Text  = "All Account Information";
         view.crvReportViewer.ReportSource = rpt;
         view.Show();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #13
0
        private void btnNewPortfolioReport_Click(object sender, EventArgs e)
        {
            //if (ValidationCheck())
            //    return;

            ShareDWBAL            shareDwbal           = new ShareDWBAL();
            ShareLedgerBAL        bal                  = new ShareLedgerBAL();
            MoneyLadgerReportBAL  moneyLedgerReportBal = new MoneyLadgerReportBAL();
            DataTable             dtPort               = new DataTable();
            frmReportViewer       viewer               = new frmReportViewer();
            cr_NewPortfolioWithGL rpt                  = new cr_NewPortfolioWithGL();

            DataTable dtCommission   = shareDwbal.GetCommissionRate(txtCustCode.Text.Trim());
            double    CommissionRate = Convert.ToDouble(dtCommission.Rows[0][0].ToString());

            //string AsOnDateeeeee=Convert.ToString
            dtPort = bal.PortfolioWithActualBEPRealizeGL(txtCustCode.Text.Trim(), CommissionRate, dtToDate.Value);

            DataTable dtCustBasicInfo = moneyLedgerReportBal.GetCustBasicInfo(txtCustCode.Text.Trim());

            ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["txtCustCode"]).Text =
                "Cust. Code: " + dtCustBasicInfo.Rows[0]["Cust_Code"].ToString();
            ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["txtBOID"]).Text =
                "Cust. BO ID: " + dtCustBasicInfo.Rows[0]["BO_ID"].ToString();
            ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["txtCustName"]).Text =
                "Cust. Name: " + dtCustBasicInfo.Rows[0]["Cust_Name"].ToString();
            ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["AsOnDate"]).Text =
                "As On: " + dtToDate.Value.ToString("dd MMMM yyyy") + "";
            GetCommonInfo();
            ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["txtCompanyName"]).Text = _CommpanyName;
            ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["txtBranchName"]).Text  =
                _branchName + ", " + _branchAddress + ", " + "Phone: " + _branchContactNumber;
            ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["txtReportName"]).Text = "Portfolio Statement";
            rpt.SetDataSource(dtPort);
            viewer.crvReportViewer.ReportSource = rpt;
            viewer.Show();
        }
예제 #14
0
        private void label1_DoubleClick(object sender, EventArgs e)
        {
            frmReportViewer frm = new frmReportViewer(((Label)sender).Text);

            frm.ShowDialog();
        }
예제 #15
0
        private void btnViewReportSet_Click(object sender, EventArgs e)
        {
            SetReportOrder();
            frmReportViewer frmReports   = new frmReportViewer();
            frmReportViewer frmViewWaste = new frmReportViewer();
            bool            isReports    = false;
            int             nViewWaste   = 0;

            this.Cursor = Cursors.WaitCursor;

            bool isWeekly = false;

            //get the count of selected rows and drop each starting at the dropIndex
            foreach (UltraGridRow aRow in ultraGrid1.Selected.Rows)
            {
                isWeekly = Regex.IsMatch(aRow.Cells["SerieName"].Value.ToString(), "weekly", RegexOptions.IgnoreCase);
                if (aRow.Band.Key == "ReportSet")
                {
                    int id = int.Parse(aRow.Cells["ReportMemorized.ID"].Value.ToString());
                    if (aRow.Cells["ReportType"].Value.ToString() == "View Waste")
                    {
                        frmViewWaste.AddPDF(id);
                        nViewWaste++;
                    }
                    else
                    {
                        frmReports.AddLoadParameters(id, isWeekly);
                        isReports = true;
                    }
                }
                else
                {
                    DataView view = _ReportSeries.Tables["ReportSet"].DefaultView;
                    view.RowFilter = "ReportSeries.ID = " + aRow.Cells["ID"].Value;
                    view.Sort      = "Order";
                    foreach (DataRowView viewRow in view)
                    {
                        if (viewRow["ReportMemorized.ID"].ToString() != "")
                        {
                            int id = int.Parse(viewRow["ReportMemorized.ID"].ToString());
                            if (viewRow["ReportType"].ToString() == "View Waste")
                            {
                                frmViewWaste.AddPDF(id);
                                nViewWaste++;
                            }
                            else
                            {
                                frmReports.AddLoadParameters(id, isWeekly);
                                isReports = true;
                            }
                        }
                    }
                }
            }
            this.Cursor = Cursors.Default;
            if (isReports)
            {
                frmReports.SetTitle(ultraGrid1.Rows[0].Cells["SerieName"].Value.ToString());
                frmReports.View();
                frmReports.Show();
            }
            if (nViewWaste > 0)
            {
                if (nViewWaste > 1)
                {
                    DialogResult result = ShowSavePDF();
                    if (result == DialogResult.Cancel)
                    {
                        return;
                    }
                    string fileName = this.saveFileDialog1.FileName;
                    frmViewWaste.ShowPDF(fileName);
                }
                else
                {
                    frmViewWaste.View();
                    frmViewWaste.Show();
                }
            }

            // set task checkboxes
            VWA4Common.UtilitiesInstance utils = new VWA4Common.UtilitiesInstance();
            utils.setTaskCheck(DateTime.Parse(VWA4Common.GlobalSettings.StartDateOfSelectedWeek), true, "reviewreports");
        }
예제 #16
0
        private void GetDailyDaywiseOpexReport(DateTime fromDate, DateTime toDate)
        {
            try
            {
                cr_groupByBranchDailyOpexReport objcrDailyOpex = new cr_groupByBranchDailyOpexReport();
                DataTable               dataTable               = new DataTable();
                frmReportViewer         objReportviewer         = new frmReportViewer();
                RecordLevelFilteringBAL recordLevelFilteringBAL = new RecordLevelFilteringBAL();
                OpexBAL objOpexBal   = new OpexBAL();
                int     TempBranchId = -2;

                int resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Daily_Expenditure_group_By_Branch_Daily_Opex_Report);
                int criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId);

                int branchId = Int32.Parse(ddlBranchList.SelectedValue.ToString());

                if (branchId == 0)
                {
                    TempBranchId = Convert.ToInt32(recordLevelFilteringBAL.FilterWorkStation_All(branchId.ToString(), resourceId, criteriaId));
                    if (TempBranchId == 0)
                    {
                        dataTable = objOpexBal.GetAllBranchDailyOpex(fromDate, toDate, TempBranchId);
                    }
                    else
                    {
                        //dataTable = objOpexBal.GetAllBranchDailyOpex(fromDate, toDate, branchId);
                        //dataTable.Rows.Clear();
                        MessageBox.Show("You are restricted");
                        return;
                    }
                }
                else if (branchId != 0)
                {
                    TempBranchId = Convert.ToInt32(recordLevelFilteringBAL.FilterBranchID(branchId.ToString(), resourceId, criteriaId));
                    if (branchId != TempBranchId)
                    {
                        MessageBox.Show("You are restricted");
                        return;
                    }
                    dataTable = objOpexBal.GetAllBranchDailyOpex(fromDate, toDate, TempBranchId);
                }
                objcrDailyOpex.SetDataSource(dataTable);

                GetCommonInfo();
                ((TextObject)objcrDailyOpex.ReportDefinition.Sections[1].ReportObjects["txtCompanyName"]).Text = _CommpanyName;
                ((TextObject)objcrDailyOpex.ReportDefinition.Sections[1].ReportObjects["txtAddress"]).Text     = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;

                ((TextObject)objcrDailyOpex.ReportDefinition.Sections[1].ReportObjects["txtReportTitle"]).Text = "Day wise Daily Opex ";
                ((TextObject)objcrDailyOpex.ReportDefinition.Sections[1].ReportObjects["txtFromDate"]).Text    = fromDate.ToString("dd-MMM-yyyy");
                ((TextObject)objcrDailyOpex.ReportDefinition.Sections[1].ReportObjects["txtToDate"]).Text      = toDate.ToString("dd-MMM-yyyy");
                ((TextObject)objcrDailyOpex.ReportDefinition.Sections[1].ReportObjects["txtBranchName"]).Text  = ddlBranchList.Text;



                objReportviewer.crvReportViewer.ReportSource = objcrDailyOpex;
                objReportviewer.Text = "Daily Opex Report : Day wise";
                objReportviewer.Show();
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #17
0
        private void GetCustomizedOpexReport(DateTime fromDate, DateTime toDate)
        {
            try
            {
                cr_CustomizedOpex       objcrcustomizedOpex     = new cr_CustomizedOpex();
                DataTable               dataTable               = new DataTable();
                frmReportViewer         objReportviewer         = new frmReportViewer();
                RecordLevelFilteringBAL recordLevelFilteringBAL = new RecordLevelFilteringBAL();
                OpexBAL objOpexBal   = new OpexBAL();
                int     TempBranchId = -2;
                int     BranchId     = Int32.Parse(ddlBranchList.SelectedValue.ToString());
                int     resourceId   = recordLevelFilteringBAL.GetResourceID(ResourceName.Daily_Expenditure_Customized_Opex);
                int     criteriaId   = recordLevelFilteringBAL.GetCriteriaID(resourceId);

                if (BranchId == 0)
                {
                    TempBranchId = Convert.ToInt32(recordLevelFilteringBAL.FilterWorkStation_All(BranchId.ToString(), resourceId, criteriaId));
                    if (BranchId != TempBranchId)
                    {
                        MessageBox.Show("You are restricted");
                        return;
                    }
                    else
                    {
                        dataTable = objOpexBal.GetAllBranchDailyOpex(fromDate, toDate, TempBranchId);
                    }
                }
                else
                {
                    TempBranchId = Convert.ToInt32(recordLevelFilteringBAL.FilterBranchID(BranchId.ToString(), resourceId, criteriaId));
                    if (BranchId != TempBranchId)
                    {
                        MessageBox.Show("You are restricted");
                        return;
                    }
                    else
                    {
                        dataTable = objOpexBal.GetCustomizedOpexReport(fromDate, toDate, TempBranchId);
                    }
                }
                objcrcustomizedOpex.SetDataSource(dataTable);

                GetCommonInfo();
                ((TextObject)objcrcustomizedOpex.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName;
                ((TextObject)objcrcustomizedOpex.ReportDefinition.Sections[2].ReportObjects["txtAddress"]).Text     = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;

                ((TextObject)objcrcustomizedOpex.ReportDefinition.Sections[2].ReportObjects["txtReport"]).Text     = "Daily Opex Report: Customized";
                ((TextObject)objcrcustomizedOpex.ReportDefinition.Sections[2].ReportObjects["txtFrom"]).Text       = fromDate.ToString("MMMM-yyyy");
                ((TextObject)objcrcustomizedOpex.ReportDefinition.Sections[2].ReportObjects["txtTo"]).Text         = toDate.ToString("MMMM-yyyy");
                ((TextObject)objcrcustomizedOpex.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text = ddlBranchList.Text;



                objReportviewer.crvReportViewer.ReportSource     = objcrcustomizedOpex;
                objReportviewer.crvReportViewer.DisplayGroupTree = true;
                objReportviewer.Text = "Daily Opex Report: Customized";
                objReportviewer.Show();
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #18
0
        private void btnPrintReportSet_Click(object sender, EventArgs e)
        {
            VWA4Common.GlobalSettings.PrintViewReportsProgressCancelled = false;
            //get the count of selected rows and drop each starting at the dropIndex
            //this.Cursor = Cursors.WaitCursor;
            try
            {
                //pf = new VWA4Common.ProgressForm();
                //pf.SetupAndShow(this.ParentForm, "Printing Reports", "Creating Report List...", true, true);
                int pd_left = (this.Left + ParentForm.Left) + this.Width / 2;
                int pd_top  = (this.Top + ParentForm.Top) + this.Height / 2;



                VWA4Common.ProgressDialog.ShowProgressDialog("Looking for Reports' Names.", "", "", pd_left, pd_top);

                frmReportViewer frmReports   = new frmReportViewer();
                frmReportViewer frmViewWaste = new frmReportViewer();

                VWA4Common.ProgressDialog.SetLeadin("Report List created");
                VWA4Common.ProgressDialog.SetLeadin("Report List inited");
                bool isViewWaste = false, isReports = false;

                btnPrintReportSet.Enabled = false;

                int nRows = 0, nReports = 1;

                if (ultraGrid1.Selected.Rows.Count > 0)
                {
                    nRows = ultraGrid1.Selected.Rows.Count;
                }
                else
                {
                    nRows = ultraGrid1.Rows.Count;
                }

                double progressTick = (nRows > 0 ? 100 / nRows : 1);
                VWA4Common.ProgressDialog.SetLeadin("Generating Reports");
                try
                {
                    if (ultraGrid1.Selected.Rows.Count > 0)
                    {
                        foreach (UltraGridRow aRow in ultraGrid1.Selected.Rows)
                        {
                            VWA4Common.ProgressDialog.SetStatus("Generating report " + nReports + " of " + nRows, (int)(nReports * progressTick));
                            if (VWA4Common.ProgressDialog.CancelPressed)
                            {
                                VWA4Common.ProgressDialog.CancelPressed = false;

                                btnPrintReportSet.Enabled = true;
                                return;
                            }

                            int id = int.Parse(aRow.Cells["ReportMemorized.ID"].Value.ToString());
                            if (aRow.Cells["ReportType"].Value.ToString() == "View Waste")
                            {
                                frmViewWaste.AddPrint(id);
                                isViewWaste = true;
                            }
                            else
                            {
                                frmReports.AddPrint(id, true);
                                isReports = true;
                            }
                            nReports++;
                        }
                    }
                    else
                    {
                        foreach (UltraGridRow aRow in ultraGrid1.Rows)
                        {
                            VWA4Common.ProgressDialog.SetStatus("Generating report " + nReports + " of " + nRows, (int)(nReports * progressTick));

                            if (VWA4Common.ProgressDialog.CancelPressed)
                            {
                                VWA4Common.ProgressDialog.CancelPressed = false;

                                btnPrintReportSet.Enabled = true;
                                return;
                            }

                            int id = int.Parse(aRow.Cells["ReportMemorized.ID"].Value.ToString());
                            if (aRow.Cells["ReportType"].Value.ToString() == "View Waste")
                            {
                                frmViewWaste.AddPrint(id);
                                isViewWaste = true;
                            }
                            else
                            {
                                frmReports.AddPrint(id, true);
                                isReports = true;
                            }
                            nReports++;
                        }
                    }

                    //FinishProgress();
                }
                finally
                {
                    FinishProgress();
                    btnPrintReportSet.Enabled = true;
                }

                //this.Cursor = Cursors.Default;
                if (isReports)
                {
                    frmReports.Print();
                }
                if (isViewWaste)
                {
                    frmViewWaste.Print();
                }
                if (_IsWeekly)
                {
                    //set checkbox in task
                    VWA4Common.UtilitiesInstance utils = new VWA4Common.UtilitiesInstance();
                    utils.setTaskCheck(DateTime.Parse(VWA4Common.GlobalSettings.StartDateOfSelectedWeek), true, "printweeklyreports");
                }
            }
            catch (Exception ex)
            {
                //Note cancellation throws an exception
                MessageBox.Show(ex.Message);
            }
        }
예제 #19
0
        private void btnPDF_Click(object sender, EventArgs e)
        {
            DialogResult result = ShowSavePDF();

            if (result == DialogResult.Cancel)
            {
                return;
            }

            string fileName = this.saveFileDialog1.FileName;

            try
            {
                //pf = new VWA4Common.ProgressForm();
                //pf.SetupAndShow(this.ParentForm, "Converting Reports to PDF", "Creating Report List...", true, true);
                int pd_left = (this.Left + ParentForm.Left) + this.Width / 2;
                int pd_top  = (this.Top + ParentForm.Top) + this.Height / 2;


                VWA4Common.ProgressDialog.ShowProgressDialog("Looking for Reports' Names.", "", "", pd_left, pd_top);
                VWA4Common.ProgressDialog.SetLeadin("Report List created");

                frmReportViewer frmReports = new frmReportViewer();
                frmReportViewer frmViewWaste = new frmReportViewer();
                bool            isViewWaste = false, isReports = false;
                //this.Cursor = Cursors.WaitCursor;

                btnPDF.Enabled = false;

                int nRows = 0, nReports = 1;

                if (ultraGrid1.Selected.Rows.Count > 0)
                {
                    nRows = ultraGrid1.Selected.Rows.Count;
                }
                else
                {
                    nRows = ultraGrid1.Rows.Count;
                }

                double progressTick = (nRows > 0 ? 100 / nRows : 1);
                VWA4Common.ProgressDialog.SetLeadin("Generating Reports");
                try
                {
                    //get the count of selected rows and drop each starting at the dropIndex
                    if (ultraGrid1.Selected.Rows.Count > 0)
                    {
                        foreach (UltraGridRow aRow in ultraGrid1.Selected.Rows)
                        {
                            VWA4Common.ProgressDialog.SetStatus("Generating report " + nReports + " of " + nRows, (int)(nReports * progressTick));
                            if (VWA4Common.ProgressDialog.CancelPressed)
                            {
                                VWA4Common.ProgressDialog.CancelPressed = false;

                                btnPDF.Enabled = true;
                                return;
                            }

                            int id = int.Parse(aRow.Cells["ReportMemorized.ID"].Value.ToString());
                            if (aRow.Cells["ReportType"].Value.ToString() == "View Waste")
                            {
                                frmViewWaste.AddPDF(id);
                                isViewWaste = true;
                            }
                            else
                            {
                                frmReports.AddPDF(id, true);
                                isReports = true;
                            }
                            nReports++;
                        }
                    }
                    else
                    {
                        foreach (UltraGridRow aRow in ultraGrid1.Rows)
                        {
                            VWA4Common.ProgressDialog.SetStatus("Generating report " + nReports + " of " + nRows, (int)(nReports * progressTick));
                            if (VWA4Common.ProgressDialog.CancelPressed)
                            {
                                VWA4Common.ProgressDialog.CancelPressed = false;

                                btnPDF.Enabled = true;
                                return;
                            }

                            int id = int.Parse(aRow.Cells["ReportMemorized.ID"].Value.ToString());
                            if (aRow.Cells["ReportType"].Value.ToString() == "View Waste")
                            {
                                frmViewWaste.AddPDF(id);
                                isViewWaste = true;
                            }
                            else
                            {
                                frmReports.AddPDF(id, true);
                                isReports = true;
                            }
                            nReports++;
                        }
                    }
                }
                finally
                {
                    FinishProgress();
                    btnPDF.Enabled = true;
                }
                //this.Cursor = Cursors.Default;
                //FinishProgress();
                //btnPDF.Enabled = true;

                if (isViewWaste)
                {
                    if (isReports)
                    {
                        result = ShowSavePDF();
                        if (result == DialogResult.Cancel)
                        {
                            return;
                        }
                    }
                    frmViewWaste.ShowPDF(this.saveFileDialog1.FileName);
                }
                if (isReports)
                {
                    frmReports.ShowPDF(fileName);
                }
            }
            catch (Exception ex)
            {
                //Note cancellation throws an exception
                MessageBox.Show(ex.Message);
            }
        }
예제 #20
0
        //private void GenerateViewReports()
        //{
        //    frmReportViewer frmReports = new frmReportViewer();
        //    frmReportViewer frmViewWaste = new frmReportViewer();
        //    bool isReports = false;
        //    int nViewWaste = 0;
        //    pf.Visible = true;
        //    pf.Value = 0;
        //    //get the count of selected rows and drop each starting at the dropIndex
        //    if (ultraGrid1.Selected.Rows.Count > 0)
        //    {
        //        pf.Maximum = ultraGrid1.Selected.Rows.Count;
        //        foreach (UltraGridRow aRow in ultraGrid1.Selected.Rows)
        //        {

        //            int id = int.Parse(aRow.Cells["ReportMemorized.ID"].Value.ToString());
        //            if (aRow.Cells["ReportType"].Value.ToString() == "View Waste")
        //            {
        //                frmViewWaste.AddPDF(id);
        //                nViewWaste++;
        //            }
        //            else
        //            {
        //                frmReports.AddLoadParameters(id, true);
        //                isReports = true;
        //            }

        //            pf.PerformStep();
        //        }
        //    }
        //    else
        //    {
        //        pf.Maximum = ultraGrid1.Rows.Count;
        //        foreach (UltraGridRow aRow in ultraGrid1.Rows)
        //        {

        //            int id = int.Parse(aRow.Cells["ReportMemorized.ID"].Value.ToString());
        //            if (aRow.Cells["ReportType"].Value.ToString() == "View Waste")
        //            {
        //                frmViewWaste.AddPDF(id);
        //                nViewWaste++;
        //            }
        //            else
        //            {
        //                frmReports.AddLoadParameters(id, true);
        //                isReports = true;
        //            }

        //            pf.PerformStep();
        //        }
        //    }
        //    if (isReports)
        //    {
        //        frmReports.SetTitle(ultraGrid1.Rows[0].Cells["SerieName"].Value.ToString());
        //        frmReports.View();
        //        frmReports.Show();
        //    }
        //    if (nViewWaste > 0)
        //    {
        //        if (nViewWaste > 1)
        //        {
        //            DialogResult result = ShowSavePDF();
        //            if (result == DialogResult.Cancel)
        //                return;
        //            string fileName = this.saveFileDialog1.FileName;
        //            frmViewWaste.ShowPDF(fileName);
        //        }
        //        else
        //        {
        //            frmViewWaste.View();
        //            frmViewWaste.Show();
        //        }
        //    }
        //    }
        //    catch (Exception ex)
        //    {
        //        MessageBox.Show(ex.Message);
        //    }
        //}

        private void btnViewReportSet_Click(object sender, EventArgs e)
        {
            VWA4Common.GlobalSettings.PrintViewReportsProgressCancelled = false;
            try
            {
                //pf = new VWA4Common.ProgressForm();
                //pf.SetupAndShow(this.ParentForm, "Showing Reports", "Creating Report List...", true, true);
                int pd_left = (this.Left + ParentForm.Left) + this.Width / 2;
                int pd_top  = (this.Top + ParentForm.Top) + this.Height / 2;



                VWA4Common.ProgressDialog.ShowProgressDialog("Looking for Reports' Names.", "", "", pd_left, pd_top);
                frmReportViewer frmReports = new frmReportViewer();
                frmReportViewer frmViewWaste = new frmReportViewer();
                int             nRows = 0, nReports = 1;

                if (ultraGrid1.Selected.Rows.Count > 0)
                {
                    nRows = ultraGrid1.Selected.Rows.Count;
                }
                else
                {
                    nRows = ultraGrid1.Rows.Count;
                }


                btnViewReportSet.Enabled = false;


                VWA4Common.ProgressDialog.SetLeadin("Report List created");

                VWA4Common.ProgressDialog.SetLeadin("Report List created");
                bool isReports  = false;
                int  nViewWaste = 0;

                double progressTick = (nRows > 0 ? 100 / nRows : 1);
                VWA4Common.ProgressDialog.SetLeadin("Generating Reports");
                try
                {
                    VWA4Common.ProgressDialog.SetStatus("Generating report " + nReports + " of " + nRows, (int)(nReports * progressTick));
                    //get the count of selected rows and drop each starting at the dropIndex
                    if (ultraGrid1.Selected.Rows.Count > 0)
                    {
                        foreach (UltraGridRow aRow in ultraGrid1.Selected.Rows)
                        {
                            if (_progressCancelled)
                            {
                                btnViewReportSet.Enabled = true;
                                return;
                            }
                            VWA4Common.ProgressDialog.SetStatus("Generating report " + nReports + " of " + nRows, (int)(nReports * progressTick));
                            int id = int.Parse(aRow.Cells["ReportMemorized.ID"].Value.ToString());
                            if (aRow.Cells["ReportType"].Value.ToString() == "View Waste")
                            {
                                frmViewWaste.AddPDF(id);
                                nViewWaste++;
                            }
                            else
                            {
                                frmReports.AddLoadParameters(id, true);
                                isReports = true;
                            }
                            nReports++;
                        }
                    }
                    else
                    {
                        foreach (UltraGridRow aRow in ultraGrid1.Rows)
                        {
                            if (_progressCancelled)
                            {
                                btnViewReportSet.Enabled = true;
                                return;
                            }
                            VWA4Common.ProgressDialog.SetStatus("Generating report " + nReports + " of " + nRows, (int)(nReports * progressTick));
                            int id = int.Parse(aRow.Cells["ReportMemorized.ID"].Value.ToString());
                            if (aRow.Cells["ReportType"].Value.ToString() == "View Waste")
                            {
                                frmViewWaste.AddPDF(id);
                                nViewWaste++;
                            }
                            else
                            {
                                frmReports.AddLoadParameters(id, true);
                                isReports = true;
                            }
                            nReports++;
                        }
                    }
                }
                finally
                {
                    FinishProgress();
                    btnViewReportSet.Enabled = true;
                }
                //FinishProgress();

                //btnViewReportSet.Enabled = true;

                if (isReports)
                {
                    frmReports.SetTitle(ultraGrid1.Rows[0].Cells["SerieName"].Value.ToString());
                    frmReports.View();
                    frmReports.Show();
                }
                if (nViewWaste > 0)
                {
                    if (nViewWaste > 1)
                    {
                        DialogResult result = ShowSavePDF();
                        if (result == DialogResult.Cancel)
                        {
                            return;
                        }
                        string fileName = this.saveFileDialog1.FileName;
                        frmViewWaste.ShowPDF(fileName);
                    }
                    else
                    {
                        frmViewWaste.View();
                        frmViewWaste.Show();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            if (!_IsWeekly)
            {
                //set checkbox in task
                VWA4Common.UtilitiesInstance utils = new VWA4Common.UtilitiesInstance();
                utils.setTaskCheck(DateTime.Parse(VWA4Common.GlobalSettings.StartDateOfSelectedWeek), true, "reviewreports");
            }
        }
        public void ShowCustMoneyLedgerReport()
        {
            _branchId = GlobalVariableBO._branchId;

            _fromDate = Convert.ToDateTime(dtFromDate.Value.ToShortDateString());
            _toDate   = Convert.ToDateTime(dtToDate.Value.ToShortDateString());
            _custCode = txtCustCode.Text;

            MoneyLadgerReportBAL moneyLedgerReportBal = new MoneyLadgerReportBAL();
            DataTable            dtCustmoneyLedger    = new DataTable();
            DataTable            dtCustBasicInfo      = new DataTable();
            LoadCommonInfo       CmmInfo = new LoadCommonInfo();

            crNewCustMoneyLedger crNewCustMoneyledger = new crNewCustMoneyLedger();
            crCustMoneyLedger    crCustMoneyledger    = new crCustMoneyLedger();

            CustMoneyLedgerViewer moneyLedgerViewer = new CustMoneyLedgerViewer();
            frmReportViewer       viewer            = new frmReportViewer();

            RecordLevelFilteringBAL obj = new RecordLevelFilteringBAL(ResourceName.Customer_Money_Ledger);

            if (tempMenuPurpose != newCustomerMoneyBalance)
            {
                string T_custCode = obj.FilterCustCode(_custCode, ResourceName.Customer_Money_Ledger);
                dtCustBasicInfo = moneyLedgerReportBal.GetCustBasicInfo(T_custCode);
            }
            //else if (tempMenuPurpose == newCustomerMoneyBalance)
            //{
            //    dtCustBasicInfo = moneyLedgerReportBal.GetCustBasicInfo(_custCode);
            //}
            if (dtCustBasicInfo.Rows.Count > 0)
            {
                ((TextObject)crCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["txtCustName"]).Text =
                    dtCustBasicInfo.Rows[0]["Cust_Name"].ToString();
                ((TextObject)crCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["txtCustCode"]).Text =
                    dtCustBasicInfo.Rows[0]["Cust_Code"].ToString();
                ((TextObject)crCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["Text6"]).Text =
                    "Balance Before " + dtFromDate.Value.ToString("dd-MMM-yy") + " :";
                ((TextObject)crCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["txtduration"]).Text =
                    "Duration : " + dtFromDate.Value.ToString("dd-MMM-yyyy") + " To " +
                    dtToDate.Value.ToString("dd-MMM-yyyy");
                ((TextObject)crCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["txtreportName"]).Text =
                    "Customer Money Ledger";
            }
            if (tempMenuPurpose == newCustomerMoneyBalance)
            {
                ((TextObject)crNewCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["txtCustCode"]).Text = txtCustCode.Text;

                ((TextObject)crNewCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["txtreportName"]).Text =
                    "Customer Money Ledger";
            }
            if (tempMenuPurpose != newCustomerMoneyBalance)
            {
                string temp_custCode = obj.FilterCustCode(_custCode, ResourceName.Customer_Money_Ledger);

                if (tempMenuPurpose == Interest_Service_Charge)
                {
                    dtCustmoneyLedger = moneyLedgerReportBal.GetInterestServiceCharge(temp_custCode, _fromDate, _toDate);
                }
                else
                {
                    dtCustmoneyLedger = moneyLedgerReportBal.GetCustMoneyLedger(temp_custCode, _fromDate, _toDate);
                }
            }
            else
            {
                dtCustmoneyLedger = moneyLedgerReportBal.GetNewCustMoneyLedger(_custCode, _fromDate, _toDate);
            }
            if (tempMenuPurpose == newCustomerMoneyBalance)
            {
                crNewCustMoneyledger.SetDataSource(dtCustmoneyLedger);
            }
            else
            {
                crCustMoneyledger.SetDataSource(dtCustmoneyLedger);
            }

            GetCommonInfo();
            if (tempMenuPurpose != newCustomerMoneyBalance)
            {
                ((TextObject)crCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text =
                    _CommpanyName;

                ///// Load Branch Name
                ((TextObject)crCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text =
                    "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;
                moneyLedgerViewer.crvCustMoneyLedgerReportViewer.DisplayGroupTree = false;
            }
            else if (tempMenuPurpose == newCustomerMoneyBalance)
            {
                ((TextObject)crNewCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text =
                    _CommpanyName;

                ///// Load Branch Name
                ((TextObject)crNewCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text =
                    "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;
            }
            if (tempMenuPurpose == newCustomerMoneyBalance)
            {
                viewer.crvReportViewer.ReportSource = crNewCustMoneyledger;
                viewer.Show();
            }
            else
            {
                moneyLedgerViewer.crvCustMoneyLedgerReportViewer.ReportSource = crCustMoneyledger;
                moneyLedgerViewer.Show();
            }
        }
예제 #22
0
        private void btnPDF_Click(object sender, EventArgs e)
        {
            DialogResult result = ShowSavePDF();

            if (result == DialogResult.Cancel)
            {
                return;
            }

            string fileName = this.saveFileDialog1.FileName;

            SetReportOrder();
            frmReportViewer frmReports = new frmReportViewer();
            frmReportViewer frmViewWaste = new frmReportViewer();
            bool            isViewWaste = false, isReports = false;

            this.Cursor = Cursors.WaitCursor;

            //get the count of selected rows and drop each starting at the dropIndex
            foreach (UltraGridRow aRow in ultraGrid1.Selected.Rows)
            {
                if (aRow.Band.Key == "ReportSet")
                {
                    int id = int.Parse(aRow.Cells["ReportMemorized.ID"].Value.ToString());
                    if (aRow.Cells["ReportType"].Value.ToString() == "View Waste")
                    {
                        frmViewWaste.AddPDF(id);
                        isViewWaste = true;
                    }
                    else
                    {
                        frmReports.AddPDF(id);
                        isReports = true;
                    }
                }
                else
                {
                    DataView view = _ReportSeries.Tables["ReportSet"].DefaultView;
                    view.RowFilter = "ReportSeries.ID = " + aRow.Cells["ID"].Value;
                    view.Sort      = "Order";
                    foreach (DataRowView viewRow in view)
                    {
                        int id = int.Parse(viewRow["ReportMemorized.ID"].ToString());
                        if (viewRow["ReportType"].ToString() == "View Waste")
                        {
                            frmViewWaste.AddPDF(id);
                            isViewWaste = true;
                        }
                        else
                        {
                            frmReports.AddPDF(id);
                            isReports = true;
                        }
                    }
                }
            }
            this.Cursor = Cursors.Default;

            if (isViewWaste)
            {
                if (isReports)
                {
                    result = ShowSavePDF();
                    if (result == DialogResult.Cancel)
                    {
                        return;
                    }
                }
                frmViewWaste.ShowPDF(this.saveFileDialog1.FileName);
            }
            if (isReports)
            {
                frmReports.ShowPDF(fileName);
            }
        }
예제 #23
0
        private void button1_Click(object sender, EventArgs e)
        {
            frmReportViewer frm = new frmReportViewer(_SelectedLabelText);

            frm.ShowDialog();
        }
예제 #24
0
        //private void GetReport(int BranchID, int CatgId, int FreqId, DateTime fromDate, DateTime toDate, string Grouping)
        //{
        //    try
        //    {
        //        if (Grouping == Indication_ExpenseReports.Expense_Grouping_Monthly)
        //        {
        //            cr_MonthlyOpex objcrmonthlyopex = new cr_MonthlyOpex();
        //            DataTable datatable = new DataTable();
        //            frmReportViewer objreportviewer = new frmReportViewer();
        //            RecordLevelFilteringBAL recordlevelfilteringbal = new RecordLevelFilteringBAL();
        //            ExpenseEntryBAL exbal = new ExpenseEntryBAL();
        //            int tempbranchid = -2;

        //            int resourceid = recordlevelfilteringbal.GetResourceID(ResourceName.Daily_Expenditure_Monthly_Opex);
        //            int criteriaid = recordlevelfilteringbal.GetCriteriaID(resourceid);

        //            if (BranchID == Indication_BrokerBranch.HeadOffice_ID)
        //            {
        //                tempbranchid = Convert.ToInt32(recordlevelfilteringbal.FilterWorkStation_All(BranchID.ToString(), resourceid, criteriaid));

        //                if (BranchID != tempbranchid)
        //                {
        //                    MessageBox.Show("you are restricted");
        //                    return;
        //                }
        //                else
        //                {
        //                    datatable = exbal.GetReport(CatgId, FreqId, BranchID, fromDate, toDate);
        //                }
        //            }
        //            else
        //            {
        //                tempbranchid = Convert.ToInt32(recordlevelfilteringbal.FilterBranchID(BranchID.ToString(), resourceid, criteriaid));
        //                if (BranchID != tempbranchid)
        //                {
        //                    MessageBox.Show("you are restricted");
        //                    return;
        //                }
        //                else
        //                {
        //                    datatable = exbal.GetReport(CatgId, FreqId, BranchID, fromDate, toDate);
        //                }
        //            }
        //            objcrmonthlyopex.SetDataSource(datatable);

        //            GetCommonInfo();
        //            ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtcompanyname"]).Text = _CommpanyName;
        //            ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtaddress"]).Text = "Branch name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;

        //            ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtreport"]).Text = Selected_CategoryType_Name +" Report: Monthly Wise";
        //            ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtfrom"]).Text = fromDate.ToString("dd-mmm-yyyy");
        //            ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtto"]).Text = toDate.ToString("dd-mmm-yyyy");
        //            ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtbranchname"]).Text = _branchName;


        //            objreportviewer.crvReportViewer.ReportSource = objcrmonthlyopex;
        //            objreportviewer.Text = Selected_CategoryType_Name + " Report: Monthly wise";
        //            objreportviewer.Show();
        //        }
        //        else if (Grouping == Indication_ExpenseReports.Expense_Grouping_Daily)
        //        {
        //            cr_DailyOpex objctDailyOpex = new cr_DailyOpex();
        //            DataTable datatable = new DataTable();
        //            frmReportViewer objreportviewer = new frmReportViewer();
        //            RecordLevelFilteringBAL recordlevelfilteringbal = new RecordLevelFilteringBAL();
        //            ExpenseEntryBAL exbal = new ExpenseEntryBAL();
        //            int tempbranchid = -2;

        //            int resourceid = recordlevelfilteringbal.GetResourceID(ResourceName.Daily_Expenditure_Monthly_Opex);
        //            int criteriaid = recordlevelfilteringbal.GetCriteriaID(resourceid);

        //            if (BranchID == Indication_BrokerBranch.HeadOffice_ID)
        //            {
        //                tempbranchid = Convert.ToInt32(recordlevelfilteringbal.FilterWorkStation_All(BranchID.ToString(), resourceid, criteriaid));

        //                if (BranchID != tempbranchid)
        //                {
        //                    MessageBox.Show("you are restricted");
        //                    return;
        //                }
        //                else
        //                {
        //                    datatable = exbal.GetReport(CatgId, FreqId, BranchID, fromDate, toDate);
        //                }
        //            }
        //            else
        //            {
        //                tempbranchid = Convert.ToInt32(recordlevelfilteringbal.FilterBranchID(BranchID.ToString(), resourceid, criteriaid));
        //                if (BranchID != tempbranchid)
        //                {
        //                    MessageBox.Show("you are restricted");
        //                    return;
        //                }
        //                else
        //                {
        //                    datatable = exbal.GetReport(CatgId, FreqId, BranchID, fromDate, toDate);
        //                }
        //            }
        //            objctDailyOpex.SetDataSource(datatable);

        //            GetCommonInfo();
        //            ((TextObject)objctDailyOpex.ReportDefinition.Sections[2].ReportObjects["txtcompanyname"]).Text = _CommpanyName;
        //            ((TextObject)objctDailyOpex.ReportDefinition.Sections[2].ReportObjects["txtaddress"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;

        //            ((TextObject)objctDailyOpex.ReportDefinition.Sections[2].ReportObjects["txtreport"]).Text = Selected_CategoryType_Name+" Report: Daily Wise";
        //            ((TextObject)objctDailyOpex.ReportDefinition.Sections[2].ReportObjects["txtfrom"]).Text = fromDate.ToString("dd-mmm-yyyy");
        //            ((TextObject)objctDailyOpex.ReportDefinition.Sections[2].ReportObjects["txtto"]).Text = toDate.ToString("dd-mmm-yyyy");
        //            //((TextObject)objctDailyOpex.ReportDefinition.Sections[2].ReportObjects["txtbranchname"]).Text = _branchName;


        //            objreportviewer.crvReportViewer.ReportSource = objctDailyOpex;
        //            objreportviewer.Text = Selected_CategoryType_Name + " Report: Daily wise";
        //            objreportviewer.Show();
        //        }
        //        else if (Grouping == Indication_ExpenseReports.Expense_Grouping_Yearly)
        //        {

        //            cr_YearlyOPex objctYearlyOpex = new cr_YearlyOPex();
        //            DataTable datatable = new DataTable();
        //            frmReportViewer objreportviewer = new frmReportViewer();
        //            RecordLevelFilteringBAL recordlevelfilteringbal = new RecordLevelFilteringBAL();
        //            ExpenseEntryBAL exbal = new ExpenseEntryBAL();
        //            int tempbranchid = -2;

        //            int resourceid = recordlevelfilteringbal.GetResourceID(ResourceName.Daily_Expenditure_Monthly_Opex);
        //            int criteriaid = recordlevelfilteringbal.GetCriteriaID(resourceid);

        //            if (BranchID == Indication_BrokerBranch.HeadOffice_ID)
        //            {
        //                tempbranchid = Convert.ToInt32(recordlevelfilteringbal.FilterWorkStation_All(BranchID.ToString(), resourceid, criteriaid));

        //                if (BranchID != tempbranchid)
        //                {
        //                    MessageBox.Show("you are restricted");
        //                    return;
        //                }
        //                else
        //                {
        //                    datatable = exbal.GetReport(CatgId, FreqId, BranchID, fromDate, toDate);
        //                }
        //            }
        //            else
        //            {
        //                tempbranchid = Convert.ToInt32(recordlevelfilteringbal.FilterBranchID(BranchID.ToString(), resourceid, criteriaid));
        //                if (BranchID != tempbranchid)
        //                {
        //                    MessageBox.Show("you are restricted");
        //                    return;
        //                }
        //                else
        //                {
        //                    datatable = exbal.GetReport(CatgId, FreqId, BranchID, fromDate, toDate);
        //                }
        //            }
        //            objctYearlyOpex.SetDataSource(datatable);

        //            GetCommonInfo();
        //            ((TextObject)objctYearlyOpex.ReportDefinition.Sections[2].ReportObjects["txtcompanyname"]).Text = _CommpanyName;
        //            ((TextObject)objctYearlyOpex.ReportDefinition.Sections[2].ReportObjects["txtaddress"]).Text = "branch name:" + _branchName + "," + _branchAddress + ". phone:" + _branchContactNumber;

        //            ((TextObject)objctYearlyOpex.ReportDefinition.Sections[2].ReportObjects["txtreport"]).Text = Selected_CategoryType_Name+ " Report: Yearly wise";
        //            ((TextObject)objctYearlyOpex.ReportDefinition.Sections[2].ReportObjects["txtfrom"]).Text = fromDate.ToString("dd-mmm-yyyy");
        //            ((TextObject)objctYearlyOpex.ReportDefinition.Sections[2].ReportObjects["txtto"]).Text = toDate.ToString("dd-mmm-yyyy");
        //            ((TextObject)objctYearlyOpex.ReportDefinition.Sections[2].ReportObjects["txtbranchname"]).Text = _branchName;


        //            objreportviewer.crvReportViewer.ReportSource = objctYearlyOpex;
        //            objreportviewer.Text = Selected_CategoryType_Name + " Report: Yearly wise";
        //            objreportviewer.Show();
        //        }



        //    }
        //    catch (Exception)
        //    {

        //        throw;
        //    }

        //}

        private void GetReport(int BranchID, int CatgId, int FreqId, DateTime fromDate, DateTime toDate, string Grouping)
        {
            try
            {
                cr_ExpenseReport        objcrmonthlyopex        = new cr_ExpenseReport();
                DataTable               datatable               = new DataTable();
                frmReportViewer         objreportviewer         = new frmReportViewer();
                RecordLevelFilteringBAL recordlevelfilteringbal = new RecordLevelFilteringBAL();
                ExpenseEntryBAL         exbal = new ExpenseEntryBAL();
                bool IsExpensedate            = false;

                int tempbranchid = -2;

                int resourceid = recordlevelfilteringbal.GetResourceID(ResourceName.Daily_Expenditure_Monthly_Opex);
                int criteriaid = recordlevelfilteringbal.GetCriteriaID(resourceid);

                if (rd_ExpenseDate.Checked)
                {
                    IsExpensedate = rd_ExpenseDate.Checked;
                }

                if (BranchID == Indication_BrokerBranch.HeadOffice_ID)
                {
                    tempbranchid = Convert.ToInt32(recordlevelfilteringbal.FilterWorkStation_All(BranchID.ToString(), resourceid, criteriaid));

                    if (BranchID != tempbranchid)
                    {
                        MessageBox.Show("you are restricted");
                        return;
                    }
                    else
                    {
                        datatable = exbal.GetReport(CatgId, FreqId, BranchID, fromDate, toDate, IsExpensedate);
                    }
                }
                else
                {
                    tempbranchid = Convert.ToInt32(recordlevelfilteringbal.FilterBranchID(BranchID.ToString(), resourceid, criteriaid));
                    if (BranchID != tempbranchid)
                    {
                        MessageBox.Show("you are restricted");
                        return;
                    }
                    else
                    {
                        datatable = exbal.GetReport(CatgId, FreqId, BranchID, fromDate, toDate, IsExpensedate);
                    }
                }
                ParameterDiscreteValue pdv = new ParameterDiscreteValue();
                pdv.Value = (object)Grouping;

                objcrmonthlyopex.SetDataSource(datatable);
                GetCommonInfo();

                ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtcompanyname"]).Text = _CommpanyName;
                ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtaddress"]).Text     = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;;

                ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtfrom"]).Text = fromDate.ToString("dd-MMM-yyyy") + " To " + toDate.ToString("dd-MMM-yyyy");
                //((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtto"]).Text = toDate.ToString("dd-mmm-yyyy");
                ((TextObject)objcrmonthlyopex.ReportDefinition.Sections[2].ReportObjects["txtDate"]).Text = IsExpensedate ? "Expense Date" : "Payment Date";
                objcrmonthlyopex.ParameterFields["GroupingDate"].CurrentValues.Add(pdv);
                objreportviewer.crvReportViewer.ReportSource = objcrmonthlyopex;
                objreportviewer.Text = "Expense Report ";
                objreportviewer.Show();
            }
            catch (Exception)
            {
                throw;
            }
        }