I have intranet win.forms (click once) application with custom built-in reporting module (40+ WinWord & Excel reports). Module is in separated assembly and abstracted via interfaces. We have sources and continue to support it.
Common interfaces look like:
IReportProvider {
// introspection stuff
IEnumerable<ReportCategoryInfo> GetReportGroups();
IEnumerable<ReportInfo> GetReports(Guid categoryId);
...
// common function
ReportResult CreateReport(Guid reportId, ReportParamCollection prms, ..)
}
ReportInfo describes basic info & parameters required. UI is auto generated to let user choose report parameters.
class ReportInfo {
public Guid Id { get; set; }
public string Title { get; set; }
public List<ReportParameterInfo> Params { get; set; }
...
}
and ReportResult provides binary report representation as well as binary type (is it Word2003, Excel2003, e.t.c)
class ReportResult {
public byte[] Document { get; set; }
public ReportType DocumentType { get; set; }
public List<string> Warnings { get; set; }
...
}
There is no authentication requirements and word/excel representation is the must. PDF is not welcomed.
Problem is - every time report is added/corrected we update reporting module and publish new application version ('cos they are tied together).
I want to:
- avoid new application versions when reports are updated.
- We also have to add intranet web interface to reporting.
I am going to refactor present code the following way:
- Extract reporting functionality into separate WCF service
- Put report template files (excel & word templates) out of application and put to folder accessible to reporting service only.
- New WCF service will provide introspection interfaces (what reports are present and what parameters are required) and method to retrieve binary report representation (word or excel)
- There should be two clients that communicate with WCF service: Win.Forms for present client and Web one. Client will provide reporting navigation UI-interface to let user fill parameters and receive report file back. Win.Forms client will execute WinWord or Excel to show report received.
What do you think of that?