FastReport - pictures

FastReport - pictures

Postby Otto » Sun Sep 13, 2009 4: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm

Re: FastReport - pictures

Postby ermatica » Sun Sep 13, 2009 5:53 pm

Hi Otto,

Code on Fast-Report:

Code: Select all  Expand view

picture.filelink:=imagen
 


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

Code: Select all  Expand view

picture.filelink:=path+imagen
 


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

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

Re: FastReport - pictures

Postby Otto » Sun Sep 13, 2009 6: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

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm

Re: FastReport - pictures

Postby ermatica » Sun Sep 13, 2009 10:48 pm

Hello Otto,

My english is very poor, I sorry.

Example1:
Code for your .prg
Code: Select all  Expand view

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  Expand view

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



Example2:
Code for your .prg
Code: Select all  Expand view

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  Expand view

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  Expand view

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
ermatica
 
Posts: 44
Joined: Mon Nov 12, 2007 1:50 pm
Location: España

Re: FastReport - pictures

Postby Otto » Mon Sep 14, 2009 6: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 89 guests