Image
Hi guys, i wanna apply the text from text field in report to an image object path. Text field have name "path" and image object have name "image". I was type this code:
I'm using Delphi, any idea how to fix this? [img]style_emoticons/<#EMO_DIR#>/dry.gif" style="vertical-align:middle" emoid="<_<" border="0" alt="dry.gif" /> thanks in advance ....[/img]
image.picture.loadfromfile(path.text);
but with no success, i got error message...I'm using Delphi, any idea how to fix this? [img]style_emoticons/<#EMO_DIR#>/dry.gif" style="vertical-align:middle" emoid="<_<" border="0" alt="dry.gif" /> thanks in advance ....[/img]
Comments
you need datasetname."fieldname" enclosed in <>
so this is not what you want
image.picture.loadfromfile(path.text);
image.picture.loadfromfile('+<datasetname."path"><datasetname."text">+');
i tried this too, but on this way picture fields on report loading only last path in database, i want to make some kind of report with all images in database
if you are only getting the last picture loaded there is something else wrong.
Ok here is my project, i want to apply paths from "Slika" cells to images in report
1 your tfrx reportcomponent clear the dataset property, since you have the mdband connected to it.
2 in your report write code in the opb event of the masterdataband
procedure MasterData1OnBeforePrint(Sender: TfrxComponent);
begin
picture1.picture.clear;
picture1.picture.loadfromfile(<frxDBDataset1."Slika">);
end;
note you will probably want to write a Custom fileexists function so that you can check if the file exixts before trying to load it or you will get an error if the file does not exist.