private void LoadReport() { ShareListBAL shareBal = new ShareListBAL(); DataTable dtParticipatoryInfo = new DataTable(); dtParticipatoryInfo = shareBal.GetParticipatoryInfo(); ShareListBO shareListBo = new ShareListBO(); shareListBo.DtTo = dtTo; shareListBo.DtFrom = dtFrom; shareListBo.WorkStation = workStation; DataTable dataTable = new DataTable(); RecordLevelFilteringBAL recordLevelFilteringBAL = new RecordLevelFilteringBAL(); string TempWorkstation = ""; int resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Workstation_wise_Trade_Share_List); int criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId); if (workStation == "All") { TempWorkstation = recordLevelFilteringBAL.FilterWorkStation_All(workStation, resourceId, criteriaId); if (TempWorkstation == "All") { dataTable = shareBal.GetShareInfo(shareListBo); } else { dataTable = shareBal.GetShareInfo(shareListBo); dataTable.Rows.Clear(); } } else { dataTable = shareBal.GetShareInfo(shareListBo); TempWorkstation = recordLevelFilteringBAL.FilterWorkStation(workStation, resourceId, criteriaId); if (TempWorkstation == "") { dataTable.Rows.Clear(); } } crShareReport crShareListReport = new crShareReport(); ((TextObject)crShareListReport.ReportDefinition.ReportObjects["txtCompanyName"]).Text = dtParticipatoryInfo.Rows[0]["Name"].ToString(); ((TextObject)crShareListReport.ReportDefinition.ReportObjects["txtBranchName"]).Text = dtParticipatoryInfo.Rows[0]["Branch_Name"].ToString() + " Branch" + dtParticipatoryInfo.Rows[0]["Address"].ToString(); if (shareListBo.DtFrom != null && shareListBo.DtTo != null) { ((TextObject)crShareListReport.ReportDefinition.Sections[2].ReportObjects["txtReportDuration"]).Text = "From " + shareListBo.DtFrom.ToShortDateString() + " To " + shareListBo.DtTo.ToShortDateString(); } crShareListReport.SetDataSource(dataTable); CrvShareList.ReportSource = crShareListReport; }
public void ShowTradeSummeryReport() { _workStation = ""; _branchId = GlobalVariableBO._branchId; _FromDate = dtpFrom.Value; _toDate = dtpTo.Value; _marketType = chkMarketType.Checked; _workStation = ddlWorkStation.Text; if (_workStation == "All") { _workStation = "0"; } TradeSummeryBAL tradeSummeryBal = new TradeSummeryBAL(); RecordLevelFilteringBAL recordLevelFilteringBAL = new RecordLevelFilteringBAL(); GetCommonInfo(); resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Trade_Summery_Report_default); criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId); if (_marketType) { crSpotTradeSummery crSpotTradeSumm = new crSpotTradeSummery(); SpotTradeSummeryReportViewer spotTradeSummeryReport = new SpotTradeSummeryReportViewer(); DataTable dtSpotTradeSummery = new DataTable(); string TempWorkstation = ""; // SetExistingPrevillizeState(); // FilterAllWorkStation if (_workStation == "0") { TempWorkstation = recordLevelFilteringBAL.FilterWorkStation_All(_workStation, resourceId, criteriaId); if (TempWorkstation != "") { dtSpotTradeSummery = tradeSummeryBal.GetSpotTradeSummery(_FromDate, _toDate); } //else if (!isAllLimit && !isAllHide && !isExistLimit && !isExistHide) //{ // dtSpotTradeSummery = tradeSummeryBal.GetSpotTradeSummery(_FromDate, _toDate); //} else { dtSpotTradeSummery = tradeSummeryBal.GetSpotTradeSummery(_FromDate, _toDate); dtSpotTradeSummery.Rows.Clear(); } } else { dtSpotTradeSummery = tradeSummeryBal.GetSpotTradeSummery(_FromDate, _toDate); TempWorkstation = recordLevelFilteringBAL.FilterWorkStation(_workStation, resourceId, criteriaId); if (TempWorkstation == "") { dtSpotTradeSummery.Rows.Clear(); } } crSpotTradeSumm.SetDataSource(dtSpotTradeSummery); ((TextObject)crSpotTradeSumm.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName; ((TextObject)crSpotTradeSumm.ReportDefinition.Sections[2].ReportObjects["txtDuration"]).Text = "From " + _FromDate.ToString("dd-MMM-yyyy") + " To " + _toDate.ToString("dd-MMM-yyyy"); ((TextObject)crSpotTradeSumm.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber; spotTradeSummeryReport.crvSpotTradeSummery.ReportSource = crSpotTradeSumm; spotTradeSummeryReport.crvSpotTradeSummery.DisplayGroupTree = false; spotTradeSummeryReport.Show(); } else { crTradeSummery crTradeSumm = new crTradeSummery(); TradeSummeryReportViewer tradeSummeryReport = new TradeSummeryReportViewer(); DataTable dtTradeSummery = new DataTable(); DataTable dtCashFlow = new DataTable(); string TempWorkstation = ""; //int resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Trade_Summery_Report_default); //int criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId); if (_workStation == "0") { //isAllLimit = recordLevelFilteringBAL.Check_All_Limit(resourceId, criteriaId); //isAllHide = recordLevelFilteringBAL.Check_All_Hide(resourceId, criteriaId); //isExistLimit = recordLevelFilteringBAL.isExistLimit(resourceId, criteriaId); //isExistHide = recordLevelFilteringBAL.isExistHide(resourceId, criteriaId); TempWorkstation = recordLevelFilteringBAL.FilterWorkStation_All(_workStation, resourceId, criteriaId); if (TempWorkstation != "") { dtTradeSummery = tradeSummeryBal.GetTradeSummery(_workStation, _FromDate, _toDate); dtCashFlow = tradeSummeryBal.GetCashflowReport(_FromDate, _toDate); } else { dtTradeSummery = tradeSummeryBal.GetTradeSummery(_workStation, _FromDate, _toDate); dtCashFlow = tradeSummeryBal.GetCashflowReport(_FromDate, _toDate); dtTradeSummery.Rows.Clear(); dtCashFlow.Rows.Clear(); } } else { dtCashFlow = tradeSummeryBal.GetCashflowReport(_FromDate, _toDate); TempWorkstation = recordLevelFilteringBAL.FilterWorkStation(_workStation, resourceId, criteriaId); if (TempWorkstation == "") { dtCashFlow.Rows.Clear(); } dtTradeSummery = tradeSummeryBal.GetTradeSummery(TempWorkstation, _FromDate, _toDate); } crTradeSumm.SetDataSource(dtTradeSummery); ((TextObject)crTradeSumm.ReportDefinition.Sections[2].ReportObjects["txtDuration"]).Text = "From " + _FromDate.ToString("dd-MMM-yyyy") + " To " + _toDate.ToString("dd-MMM-yyyy"); ((TextObject)crTradeSumm.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName; ((TextObject)crTradeSumm.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber; crTradeSumm.Subreports[0].SetDataSource(dtCashFlow); tradeSummeryReport.crvTradeSummery.ReportSource = crTradeSumm; tradeSummeryReport.Show(); } }