I had an interesting question from a new customer last week. They use Crystal Reports to analyse some data, but want users to be able to add comments to the report after itâs been run. No point adding them before, as the comments were a quote for work that was only known to be required after the report had run.
My initial thoughts were to just use the new parameter panel in Crystal 2008, that looks great until you look at the workflow imposed by the user interface. Click here, click there, type a bit, click a bit more, donât forget to click the last button or nothing happens â ugh. Suggest whoever designed that bit looks up âcognitive walkthroughâ.
Instead, I went back to some code I wrote a couple of years ago. Itâs a simple viewer application that just allow you to view and refresh reports. Simple addition of a button on the toolbar and a panel at the bottom. Click the button, panel appears, comments added, click OK â Bingo. The comments appear in the pre-defined section of the report. Hardest part was persuading the viewer to refresh its contents without refreshing all the data, otherwise the comment wouldnât appear. Turned out to be two lines of code, you just have to find the right two lines!
Oh, forgot to mention, had to be in Korean too.
This customer only wanted the comment to be used for printing one time. What would be really interesting would be to have a continuing comment section that users could add to over multiple runs. Even more interesting would be to use the Enterprise SDK to allow users to add comments to instances after the report has been scheduled. Iâd need to use a custom viewer to open the report using the Report Application Server (RAS) rather than the pageserver as the RAS SDK is much richer. Easy enough to change the report while itâs being viewed, slightly harder to save it back. Only part Iâm not sure about is whether or not RAS would detect that the report had changed so needed to clear its cache. Turning off the caching isnât too sensible due to performance. Restarting RAS every time isnât too clever either! I need to dig around in the SDK to find if anything is in there â one for the Christmas break methinks.