on 09-07-2008 6:58 AM
I created a Add-In with no problems and it all works well. But when I run my add-in, Crystal Reports switches to design mode and stays there. But when I run the Add-In that is in the downloadable sample, it also goes into design mode but then automatically switches back to preview mode so that I can see the effects on my report. I looked through the code but don't see anything that would be the cause for why it goes into preview mode.
How do I get my add-in to go back into preview mode after it runs?
Thanks.
Just a thought - but is your Add-In flushing saved data from the report?
Saved data report should open in Preview mode.
Sincerely,
Ted Ueda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Ted. I just tested this idea (I'm busy at TechEd all week) and it doesn't work. The report has saved data. In fact, I ran both the sample add-in on my report and my custom add-in on the same report. The sample reopens in preview mode and my custom add-in leaves it in design mode. So it can't be a report setting. Has to be something to do with the custom add-in, but I just don't see anything. My custom add-in modifies the record selection formula to filter on sales amount. The sample add-in highlights sub-reports to be yellow. I wonder if there are certain actions that don't allow the report to re-open in preview mode? Strange.
Briefly tested -
I think it's the report state after the ReportClientDocument.Save() rather than any configurations in the Designer or settings in the report.
The record selection formula is updated, but not the report view on Save.
If I add lines to export the report (to force a report refresh) before the ReportClientDocument.Save(), then it comes back up in Preview.
Filter filter = new FilterClass();
filter.FreeEditingText = "{Employee.Employee ID} > 12";
reportClientDocument.DataDefController.RecordFilterController.Modify(filter);
reportDocument.ExportToDisk(ExportFormatType.PortableDocFormat, "C:\\testcraddin.pdf");
Sincerely,
Ted Ueda
That worked. However, having to export the report is pretty lame just to get it to refresh. So I played with the code and I called the Refresh() method of both the ReportDocument object and the ReportClientDocument, but this didn't help. Very odd. Anyway, at least this is a solution. Hopefully, BOBJ will clean this up a bit on a future update.
Thanks!
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.