Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

CR 2008 Add-Ins - doesn't go back to preview mode afterwards

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.

replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question