cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

ted_ueda
Employee
Employee
0 Kudos

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

Former Member
0 Kudos

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.

ted_ueda
Employee
Employee
0 Kudos

Hello Brian,

I'm training this week, and won't be able to dig deeper into this currently.

If you have a support contract with SAP Business Objects, would you be able to open a SAP Incident? Or when you're back from TechEd?

Sincerely,

Ted Ueda

Former Member
0 Kudos

Hi Ted,

I don't have a support contract. But no worries, if you get a chance to check it out, then great. But if you can't that's fine.

Brian

ted_ueda
Employee
Employee
0 Kudos

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

Former Member
0 Kudos

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!

ted_ueda
Employee
Employee
0 Kudos

Regret the ugliness - only spent a bit of time on it, and didn't find any other way.

Sincerely,

Ted Ueda

Answers (0)