FastReport - pictures

Post Reply
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

FastReport - pictures

Post by Otto »

I saw a demo where pictures are coming from memo fields.
Is it possible to insert pictures with links.
Thanks in advance
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
ermatica
Posts: 44
Joined: Mon Nov 12, 2007 1:50 pm
Location: España

Re: FastReport - pictures

Post by ermatica »

Hi Otto,

Code on Fast-Report:

Code: Select all

picture.filelink:=imagen
 
where imagen is field with path and name image, or imagen is memo with path and name, etc.

Code: Select all

picture.filelink:=path+imagen
 
do not know if this what you mean with "link"

Greetings
Ernesto
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: FastReport - pictures

Post by Otto »

Hello Ernesto,
Thank you for your help.
I am not sure how I could insert a picture if the DataField “Graphic” is not like in the example a memo field but a character field with the path to the picture.
Thanks in advance
Otto

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
ermatica
Posts: 44
Joined: Mon Nov 12, 2007 1:50 pm
Location: España

Re: FastReport - pictures

Post by ermatica »

Hello Otto,

My english is very poor, I sorry.

Example1:
Code for your .prg

Code: Select all

img:="c:\Fotos\image.jpg"
FrPrn:=FrReportManager():New("FRSysth.dll")
...
FrPrn:AddVariable("MisVariables","Imagen","'"+img+"'")
...
 
And your Fast-Report add Picture (not DataSet, no DataField), in page "Code", on event

Code: Select all

procedure ReportHOnStartReport(Sender: TfrxComponent);
begin
  Picture1.FileLink:=<Imagen>;    //path of img and name file img
end;
 

Example2:
Code for your .prg

Code: Select all

alias->field_1 :="c:\Fotos\image.jpg"

FrPrn:=FrReportManager():New("FRSysth.dll")
...
FrPrn:SetWorkArea("Alias" , nArea)
...
 
And your Fast-Report add Picture (not DataSet, no DataField), in page "Code", on event

Code: Select all

procedure ReportHOnStartReport(Sender: TfrxComponent);
begin
  Picture1.FileLink:=<ALIAS."field_1">;
end;
 

Example3 (for Test):
Only on your Fast-Report add Picture (no DataSet, no DataField), in page "Code"

Code: Select all

var
  img: string;

procedure ReportHOnStartReport(Sender: TfrxComponent);
begin
  img:='c:\imagen.jpg';
  Picture1.FileLink:=<img>;
end;
 
If that's not what you want?
Greetrings
Ernesto
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: FastReport - pictures

Post by Otto »

Hello Ernesto,
thank you very much. I think example 2 is what I need.
I will test the examples and report back.
Starting with a new tool is not that easy but FR seems to be a very mighty tool and the results are great.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
Post Reply