Reputation: 3162
I have a VB.NET application which needs to generate reports (invoices) which contains optional images. The images are going to be loaded into 1 of 6 places on the report, but will reside on the client PC (deployed with the application). I've been trying to access the ICROleObject object, which is what's placed onto the report, but I can't locate this interface in the object browser, even. As this is the object's interface, I figured that it would let me access it if only I could cast it:
CType(r.ReportDefinition.ReportObjects("picTL"), ICROleObject)Any ideas where I would find this, or if I'm even approaching this correctly?
Upvotes: 0
Views: 8477
Reputation: 399
My approach has been setting a Crystal Reports Parameter to define which image should be visibile and then customize the Suppress formula using this parameter. I had a crystal reports exception in exporting report which was caused by manipulating report objects from outside the report, even if print preview was working fine.
Upvotes: 1
Reputation:
You should cast it as a PictureObject instead. The type "PictureObject" is found in the CrystalDecisions.CrystalReports.Engine namespace.
Ex:
Dim pic = CType(rapportCourant.ReportDefinition.ReportObjects("Picture1"), PictureObject) pic.ObjectFormat.EnableSuppress = True
You can then suppress ou enable the picture object as you need it.
Upvotes: 1