[ReportWorkshop][Unit] Image file names in fields

Demos, code samples. Only questions related to the existing topics are allowed here.
Post Reply
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

[ReportWorkshop][Unit] Image file names in fields

Post by Sergey Tkachenko »

Question:
In my database, instead of saving the image, I saved the image path.
How can I make Report Workshop display the image for the path?
Answer:
This is not a standard functionality, but it can be implemented with a very simple add-on.
Report Workshop implements standard field types, such as 'int', 'image', 'time', etc.
The attached unit implements 'imagefromfile' field type:
RVReportImageFromFileFieldObject.zip
(1.04 KiB) Downloaded 2517 times
Include it in your project.

Let you have a field named FIELDNAME containing file names of images.
Use this syntax to insert these images in your report:

Code: Select all

{FIELDNAME imagefromfile}
You can use format strings, the same as for normal images, for example:

Code: Select all

{FIELDNAME imagefromfile "width=100"}
Post Reply