OLE-object and report designer
-
Hi Wilfred, I believe it is possible to extract the OLE-object as an Image (e.g. create a System.Drawing.Image out of it) and insert it into the report. You should be able to do this with an embedded script in the RPX itself. Unfortunately, programming and debugging embedded scripts in RPX files can get very tricky, as the script editor in the Report Designer does not have intellisense or links to help documentation. Also, our reporting does not tolerate exceptions in the report or allow the compiled code to access the Geocortex.Logging classes, so you'll have to "code defensively" to ensure you get the report built. 0 -
0
-
Hi Josh,
It's the same process as dynamically setting the text in a text control, except you are setting a System.Drawing.Image attribute.
I have attached an example RPX file that dynamically inserts a random image from the Internet (from gravatar, for easy implementation). I'm using a WebClient request to download the image; if your images can be loaded from disk things will be easier.
For a production site, please implement better error handling - WebClient can throw a vast number of exceptions (can't find file, bad URL, etc) that are all being swallowed and discarded by my code.
This RPX file can be loaded as a main Print Template into the REST elements. I haven't tried it with the ADF. It also exposes a minor issue with our REST printing - you must have a _MainMap Image on your template for it to work. (Mine is hidden)
Regards,
-Malcolm
(https://support.geocortex.com/Data/Sites/1/userfiles/20/missingperson.zip) Attachment: MissingPerson.zip
0 -
I am interested in viewing the sample report you have generated, but the link fails.
Is there a way I can get a copy of this report?
Thanks
Cathy
0 -
Hi Cathy,
The forum doesn't like serving RPX files (since they are actually XML). I've put it in a ZIP file and now the link works.
Regards,
-Malcolm
0
Please sign in to leave a comment.
Comments
5 comments