public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crIPoTransferReport rpt = new crIPoTransferReport(); rpt.Site = this.Site; return(rpt); }
private void BtnTransfer_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); crIPoTransferReport objrpt = new crIPoTransferReport(); frmIPOReportViewer viewer = new frmIPOReportViewer(); dt = bal.GetIpoTransferReport(CmbTransaction.Text, dtpformdate.Value, dtpTodate.Value); //dt = bal.GetIpoTransferReport(dtpformdate.Value, dtpTodate.Value); objrpt.SetDataSource(dt); GetCommonInfo(); ((TextObject)objrpt.ReportDefinition.Sections[2].ReportObjects["txtTransferName"]).Text = CmbTransaction.Text; //Date ((TextObject)objrpt.ReportDefinition.Sections[2].ReportObjects["txtfromdate"]).Text = dtpformdate.Value.ToShortDateString(); ((TextObject)objrpt.ReportDefinition.Sections[2].ReportObjects["txttodate"]).Text = dtpTodate.Value.ToShortDateString(); ((TextObject)objrpt.ReportDefinition.Sections[2].ReportObjects["txtReportTitle"]).Text = "Daily Ipo Transfer Report"; ((TextObject)objrpt.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName; ///// Load Branch Name ((TextObject)objrpt.ReportDefinition.Sections[2].ReportObjects["txtAddress"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber; viewer.crystalReportViewer1.ReportSource = objrpt; viewer.Show(); }