FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FastReport - pictures
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
FastReport - pictures
Posted: Sun Sep 13, 2009 04:04 PM

I saw a demo where pictures are coming from memo fields.
Is it possible to insert pictures with links.
Thanks in advance
Otto

Posts: 44
Joined: Mon Nov 12, 2007 01:50 PM
Re: FastReport - pictures
Posted: Sun Sep 13, 2009 05:53 PM
Hi Otto,

Code on Fast-Report:

Code (fw): Select all Collapse
picture.filelink:=imagen


where imagen is field with path and name image, or imagen is memo with path and name, etc.

Code (fw): Select all Collapse
picture.filelink:=path+imagen


do not know if this what you mean with "link"

Greetings
Ernesto
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: FastReport - pictures
Posted: Sun Sep 13, 2009 06:02 PM
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

Posts: 44
Joined: Mon Nov 12, 2007 01:50 PM
Re: FastReport - pictures
Posted: Sun Sep 13, 2009 10:48 PM
Hello Otto,

My english is very poor, I sorry.

Example1:
Code for your .prg
Code (fw): Select all Collapse
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 (fw): Select all Collapse
procedure ReportHOnStartReport(Sender: TfrxComponent);
begin
  Picture1.FileLink:=<Imagen>;    //path of img and name file img
end;



Example2:
Code for your .prg
Code (fw): Select all Collapse
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 (fw): Select all Collapse
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 (fw): Select all Collapse
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
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: FastReport - pictures
Posted: Mon Sep 14, 2009 06:02 AM

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

Continue the discussion