protected override bool RenderReport() { try { base.Validate(); this.FilterControl.FilterEditorControl.PostEditor(); this.get_ReportDef().Init(); this.get_ReportDef().Title = "EDI FA Report"; this.get_ReportDef().ReportParameterList.Add(new ReportParameter("ReportFilter", this.FilterControl.GetFilterDisplayText())); CustomEdiFaRptData data = new CustomEdiFaRptData(this.CompId); this.DataGenerator = data; Dictionary <string, DataSet> dictionary = this.DataGenerator.Execute(this.FilterControl.SqlFilterString, null); foreach (KeyValuePair <string, DataSet> pair in dictionary) { this.get_ReportDef().DataSetList.Add(pair.Value); } this.get_ReportDef().PathList.Add(this.BuildReportPath(ApplicationContext.ReportPath + @"\SmEmployeeCustom.rdl")); base.Landscape = false; string errorDescription = null; if (this.get_ReportDef().IsValid(ref errorDescription)) { return(true); } TravMessageBox.Show("invalidReport", errorDescription, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(false); } catch (Exception exception) { ClientContext.HandleError(exception, this); } return(false); }
protected override bool RenderReport() //public override bool RenderReport() { try { base.Validate(); // this.FilterControl.FilterEditorControl.PostEditor(); this.ReportDef.Init();//get_ReportDef() this.ReportDef.Title = "AR Contributions Trial Balance"; #region set report parameters // this.ReportDef.ReportParameterList.Add(new ReportParameter("ReportFilter", this.FilterControl.GetFilterDisplayText())); #endregion #region set report datasets frmArContribTrialBalData data = new frmArContribTrialBalData(this.CompId); this.DataGenerator = data; Dictionary <string, DataSet> dictionary = this.DataGenerator.Execute(this.FilterControl.SqlFilterString, null); foreach (KeyValuePair <string, DataSet> pair in dictionary) { this.ReportDef.DataSetList.Add(pair.Value); } #endregion #region set report paths //this.get_ReportDef().PathList.Add(this.BuildReportPath(ApplicationContext.ReportPath + @"\SmEmployeeCustom.rdl"));//change //this.ReportDef.PathList.Add(this.BuildReportPath("C:\\path\\to\\RDL.rdl")); //this.ReportDef.PathList.Add(this.BuildReportPath(TRAVERSE.Core.ApplicationContext.ReportPath + "\\rptArGroupStatisticCountrySt.rdl")); if (Convert.ToInt32(this.selection.EditValue) == 1) { this.ReportDef.PathList.Add(this.BuildReportPath(TRAVERSE.Core.ApplicationContext.ReportPath + "\\rptArContribTrialBalanceArea.rdl")); } else if (Convert.ToInt32(this.selection.EditValue) == 2) { this.ReportDef.PathList.Add(this.BuildReportPath(TRAVERSE.Core.ApplicationContext.ReportPath + "\\rptARContribTrialBalanceCitySt.rdl")); } else { //nothing } #endregion //base.Landscape = false; //this.Landscape = false; // set report layout #region validate report string errorDescription = null; if (this.ReportDef.IsValid(ref errorDescription)) { return(true); // return base.RenderReport(); } else { TravMessageBox.Show("invalidReport", errorDescription, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(false); //return base.RenderReport(); } #endregion } catch (Exception exception) { //................... ClientContext.HandleError(exception, this); //return true; } return(false); }