Data SourcesMoxy uses two delegates to request data for a report. These delegates need to be set before using the ReportBuilder to build a report. They can either be set once and refer to static functions, or they can be set per ReportQuery and refer to a instance of another class. GetDataSourceThis delegate is used to load data associated with a dataSource. Parameters
GetReportOptionsThis delegate is used to load data associated with a report option. For example, an option may provide a list of customer names which need to be populated from the database. Parameters
Examplepublic class ReportService { public static void GetReportQueryData(ReportOption option, ReportContext context, ReportQuery query) { ... } public static void GetReportData(ReportOption option, ReportContext context, ReportQuery query) { ... } } ReportBuilder.DataSourceCallback = new ReportBuilder.GetDataSourceCallback(ReportService.GetReportData); ReportBuilder.ReportOptionsCallback = new ReportBuilder.GetReportOptionsCallback(ReportService.GetReportQueryData); Help comments powered by Disqus |
Click to see Comments