/// <summary> /// /// </summary> /// <param name="reportModel"></param> /// <param name="list"></param> /// <param name="reportParameters"></param> /// <returns></returns> public static IReportCreator CreatePageBuilder(IReportModel reportModel, IList list, ReportParameters reportParameters) { if (reportModel == null) { throw new ArgumentNullException("reportModel"); } if (list == null) { throw new ArgumentNullException("list"); } ReportEngine.CheckForParameters(reportModel, reportParameters); IDataManager dataMan = DataManager.CreateInstance(list, reportModel.ReportSettings); if (dataMan != null) { Layouter layouter = new Layouter(); return(DataPageBuilder.CreateInstance(reportModel, dataMan, layouter)); } else { throw new MissingDataManagerException(); } }
/// <summary> /// /// </summary> /// <param name="reportModel"></param> /// <param name="dataTable"></param> /// <param name="reportParameters"></param> /// <returns></returns> public static IReportCreator CreatePageBuilder(IReportModel reportModel, DataTable dataTable, ReportParameters reportParameters) { Console.WriteLine("ReportEngine:CreatePageBuilder_3"); if (reportModel == null) { throw new ArgumentNullException("reportModel"); } if (dataTable == null) { throw new ArgumentNullException("dataTable"); } ReportEngine.CheckForParameters(reportModel, reportParameters); IDataManager dataMan = DataManager.CreateInstance(dataTable, reportModel.ReportSettings); if (dataMan != null) { return(DataPageBuilder.CreateInstance(reportModel, dataMan)); } else { throw new MissingDataManagerException(); } }
/// <summary> /// send a Standart (PullModel/FormSheet) Report to printer /// </summary> /// <param name="fileName">Path to ReportFile</param> /// <param name="renderTo">Type of renderer currently only "ToText" is implemented</param> // [Obsolete("use PrintStandardReport (fileName,null)")] // public void PrintStandardReport (string fileName) { // if (String.IsNullOrEmpty(fileName)) { // throw new ArgumentNullException("fileName"); // } // PrintStandardReport (fileName,null); // // } // public void PrintStandardReport(string fileName, ReportParameters reportParameters) { if (String.IsNullOrEmpty(fileName)) { throw new ArgumentNullException("fileName"); } AbstractRenderer renderer = null; try { IReportModel model = LoadReportModel(fileName); // if (this.connectionObject == null) { // this.connectionObject = ReportEngine.PrepareConnectionFromParameters (model.ReportSettings,reportParameters); // } // ReportEngine.CheckForParameters(model, reportParameters); renderer = SetupStandardRenderer(model, reportParameters); ReportEngine.ReportToPrinter(renderer, model); } catch (Exception) { throw; } }