Recent

Author Topic: [ASK] how to include lrf file into executable?  (Read 3543 times)

yuspleh

  • Newbie
  • Posts: 4
[ASK] how to include lrf file into executable?
« on: June 03, 2014, 12:48:38 am »
can i include lazreport file (.lrf) into my executable files ?
thanks...

taazz

  • Hero Member
  • *****
  • Posts: 5363
Re: [ASK] how to include lrf file into executable?
« Reply #1 on: June 03, 2014, 07:24:18 am »
lazreport has a property that you can check named storeInForm. this way you do not need any external lrf files. If I missed the mark then be more specific.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

yuspleh

  • Newbie
  • Posts: 4
Re: [ASK] how to include lrf file into executable?
« Reply #2 on: June 05, 2014, 01:16:00 am »
thanks for the answer...
so what i mean is if we call report like this :
Code: [Select]
frReport1.LoadFromFile('lazreporttutorial.lrf'); 
frReport1.ShowReport; 

but what i want is not load from file, maybe like this:

Code: [Select]
frReport1.LoadFromForm('lazreporttutorial.lrf'); 
frReport1.ShowReport; 

that when i delete lazreporttutorial.lrf files from my disk,
it's still can be loaded by call them from 'Form' which one
that i've stored Lrf files in them...

so how could we do that ?

ps : sorry for my bad english  :D

taazz

  • Hero Member
  • *****
  • Posts: 5363
Re: [ASK] how to include lrf file into executable?
« Reply #3 on: June 05, 2014, 08:56:27 am »
uses resources and resources streams to do that. Create an RC file with a couple of RCData contents and then use the TResourceStream class to open and read from them and the frReport1.LoadFromStream method.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64