views:

212

answers:

1

I have a crystal report viewer in my c# app and I'm making my own implementation of some of the viewer navigation buttons (just so they show up in my toolbar, for visual effect). That bit is working fine, however I want to set the canExecute for these buttons so that they are disabled if for any reason a report is not currently displaying in the viewer.

Thats where I'm stuck; how can I find out if there is a report being displayed? I can't check if the reportsource is set in case the report fails to connect to the database, in that case there is still a reportsource but nothing is showing. Any ideas?

+1  A: 

I've been checking that the reportsource is not null and

crv.GetCurrentPageNumber > 0

to ensure the report is loaded. I believe this property should be set to 1 when it's loaded in the crv. It stays at -1 if for example the user cancelled the parameter prompt.

dotjoe