Runtime picture's in a report
Hello,
In my report I have a Image object and the picture that must be showned
depends on the value of a text item in the report. At design time is the
value of this textitem is unknown, so we have to place the picture at
runtime when the value is known.
How can I place at runtime a picture in a report? A numeric value is also
available so the case statement can use a numeric value if that is
nescessary.
See the example below:
case textcode of
'user1': picture := pictureA;
'user2': picture := pictureB;
'user3': picture := pictureC;
end;
Regards
Hanjo Willems
iSOFT Nederland B.V.
In my report I have a Image object and the picture that must be showned
depends on the value of a text item in the report. At design time is the
value of this textitem is unknown, so we have to place the picture at
runtime when the value is known.
How can I place at runtime a picture in a report? A numeric value is also
available so the case statement can use a numeric value if that is
nescessary.
See the example below:
case textcode of
'user1': picture := pictureA;
'user2': picture := pictureB;
'user3': picture := pictureC;
end;
Regards
Hanjo Willems
iSOFT Nederland B.V.
This discussion has been closed.
Comments
Once you know which picture you need to display, you can simply call the
TppImage.Picture.LoadFromFile or LoadFromStream routines to manually
load the correct image. Note that this must be done before the image
prints (the best place would be in the Band.BeforePrint event or earlier
(Report.BeforePrint).
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
A couple of options..
Store the pictures in a database and then use DBImage to print them.
Store the picture filenames in a database and then use DBImage to print
them. (If DBImage is connected to string field that contains the filename of
a picture, it will load it from file automatically.)
If you don't want to store the pictures or picture filenames in a database,
consider using a JITPipeline to return the values, then it will still work
like above.
-
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com