public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crInstruWiseBuyList rpt = new crInstruWiseBuyList(); rpt.Site = this.Site; return(rpt); }
public void ShowBuyReport() { _branchId = GlobalVariableBO._branchId; _transDate = Convert.ToDateTime(dtTransactionDate.Value.ToShortDateString()); _CustWise = rdoCustwise.Checked; _InstruWise = rdoInstruWise.Checked; BuyShareListReviewBAL buyShareListReviewBal = new BuyShareListReviewBAL(); DataTable dtBuyShareListReview = new DataTable(); LoadCommonInfo CmmInfo = new LoadCommonInfo(); if (_CustWise) { crCustWiseBuyShareList crBuyShareListReview = new crCustWiseBuyShareList(); CustWiseBuyShareListReportViewer buyShareListReportViewer = new CustWiseBuyShareListReportViewer(); dtBuyShareListReview = buyShareListReviewBal.GetCustWiseBuyShareList(_transDate); _filterdColumnName = dtBuyShareListReview.Columns[0].ToString(); RecordLevelFilteringBAL obj = new RecordLevelFilteringBAL(dtBuyShareListReview, _filterdColumnName, ResourceName.Buy_Sale_Report_Cust_Wise_Buy_Share_List); dtBuyShareListReview = obj.GetRecordLevelFilteredData(); crBuyShareListReview.SetDataSource(dtBuyShareListReview); GetCommonInfo(); ((TextObject)crBuyShareListReview.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName; ((TextObject)crBuyShareListReview.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber; if (_transDate != null) { ((TextObject)crBuyShareListReview.ReportDefinition.Sections[2].ReportObjects["txtReportDuration"]).Text = "Transaction Date: " + _transDate.ToString("dd MMMM,yyyy"); } buyShareListReportViewer.crvBuyShareList.ReportSource = crBuyShareListReview; buyShareListReportViewer.Show(); } else if (_InstruWise) { crInstruWiseBuyList crInstruWiseBuylist = new crInstruWiseBuyList(); InstruWiseBuyReportViewer instruWiseBuyReportViewer = new InstruWiseBuyReportViewer(); dtBuyShareListReview = buyShareListReviewBal.GetInstruWiseBuyShareList(_transDate); _filterdColumnName = dtBuyShareListReview.Columns[2].ToString(); RecordLevelFilteringBAL obj = new RecordLevelFilteringBAL(dtBuyShareListReview, _filterdColumnName, ResourceName.Buy_Sale_Report_Cust_Wise_Buy_Share_List); dtBuyShareListReview = obj.GetRecordLevelFilteredData(); crInstruWiseBuylist.SetDataSource(dtBuyShareListReview); GetCommonInfo(); ((TextObject)crInstruWiseBuylist.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName; ((TextObject)crInstruWiseBuylist.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber; if (_transDate != null) { ((TextObject)crInstruWiseBuylist.ReportDefinition.Sections[2].ReportObjects["txtReportDuration"]).Text = "Transaction Date: " + _transDate.ToString("dd MMMM,yyyy"); } instruWiseBuyReportViewer.crvInstruWiseBuyList.ReportSource = crInstruWiseBuylist; instruWiseBuyReportViewer.Show(); } else { MessageBox.Show("Please Select the report category first."); } }