Dynamically load images from file system in Crystal Report (VS 2008 version)
I have a VB.NET application that needs to generate reports (invoices) containing additional images. Images will be uploaded to 1 of 6 locations in the report, but will be on the client PC (deployed with the application). I am trying to access the ICROleObject object that is placed in the report, but I cannot find this interface in the object browser, not even. Since it is an object interface, I figured it would allow me to access it if I could use it:
CType (r.ReportDefinition.ReportObjects ("picTL"), ICROleObject)Any ideas where I would find this, or if I even approached this correctly?
I have tried following the directionshttp://www.idautomation.com/crystal/streaming_crystal.html and this won't work with the .NET 2008 embedded version of Crystal. Also no solution will be found inhttp://www.a1vbcode.com/a1vbcode/vbforums/Topic25620-3-1.aspx#bm25974 although this looks a little more promising and is exactly the one I'm trying to simulate after.
If I need to use a dataset and a series of subscriptions, I would guess that ... but this method just doesn't seem as simple as this one.
source to share
Instead, you should use it as a PictureObject. The "PictureObject" type is in the CrystalDecisions.CrystalReports.Engine namespace .
Example:
Dim pic = CType (rapportCourant.ReportDefinition.ReportObjects ("Picture1"), PictureObject ) pic.ObjectFormat.EnableSuppress = True
Then you can disable the object you want.
My approach is set to Crystal Reports parameter to determine which image should be visible, and then adjust the Suppress Formula using this option. I got a crystal reports exception when exporting a report, caused by manipulating report objects from outside the report, even though the print preview was working fine.
source to share