Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FastReport manually creating non database dependent report

595 views
Skip to first unread message

HBK

unread,
Apr 28, 2004, 7:18:50 AM4/28/04
to
Hi

I have studied Michael Philippenko posting and the manual example
comming with FastReport. I find this "manual" methode very much in my
taste, but still is confused on how to do it ?

Please correct following example:

Drop a title band onto the report, with a frMemoView for pagenumber and
one for pagetitle.
Then drop som different bands one with some pictures and label one with
a rich box etc.

Function MoreData : Boolean;
Begin {read own data} end;

procedure TForm1.frReport1ManualBuild(Sender: TfrPage);
var
i, j: Integer;
begin

?? PageTitleBox := 'My report 1';
Sender.ShowBandByType(btReportTitle);

While MoreData do
begin

?? Picture('pictureA').Assign ... own code to load picture
Sender.ShowBandByName('FixedPictureBand');

?? If RichDataToPrint then
begin
?? RichBox := MyOwnVariable
Sender.ShowBandByName('RichBand'); // Panel will automatically span
needed pages
end;

?? If NewPageAfterWanted.Checked then
Sender.NewPage; // next
?? else Fastreport will continue filling page and create new when needed

end;

end;

Thank you !
HB
Norway

Michael Philippenko

unread,
Apr 28, 2004, 12:21:08 PM4/28/04
to
Dear HBK!

> procedure TForm1.frReport1ManualBuild(Sender: TfrPage);
> var
> i, j: Integer;
> begin

> ?? PageTitleBox := 'My report 1';
> Sender.ShowBandByType(btReportTitle);

You don't need to handle ReportTitle band in this event. Report title, summary, page header/footer
bands are handled automatically. You can handle only databands.

> While MoreData do
> begin
>
> ?? Picture('pictureA').Assign ... own code to load picture
> Sender.ShowBandByName('FixedPictureBand');

var
p: TfrPictureView;
begin
p := TfrPictureView(frReport1.FindObject('pictureA'));
p.Picture.LoadFromFile(...) or
.Assign(...)

That is all.

Wednesday, April 28, 2004, 3:18:50 PM, you wrote:

H> Hi

H> I have studied Michael Philippenko posting and the manual example
H> comming with FastReport. I find this "manual" methode very much in my
H> taste, but still is confused on how to do it ?

H> Please correct following example:

H> Drop a title band onto the report, with a frMemoView for pagenumber and
H> one for pagetitle.
H> Then drop som different bands one with some pictures and label one with
H> a rich box etc.

H> Function MoreData : Boolean;
H> Begin {read own data} end;

H> procedure TForm1.frReport1ManualBuild(Sender: TfrPage);
H> var
H> i, j: Integer;
H> begin

H> ?? PageTitleBox := 'My report 1';
H> Sender.ShowBandByType(btReportTitle);

H> While MoreData do
H> begin

H> ?? Picture('pictureA').Assign ... own code to load picture
H> Sender.ShowBandByName('FixedPictureBand');

H> ?? If RichDataToPrint then
H> begin
H> ?? RichBox := MyOwnVariable
H> Sender.ShowBandByName('RichBand'); // Panel will automatically span
H> needed pages
H> end;

H> ?? If NewPageAfterWanted.Checked then
H> Sender.NewPage; // next
H> ?? else Fastreport will continue filling page and create new when needed

H> end;

H> end;

H> Thank you !
H> HB
H> Norway

--
Best regards,
Michael Philippenko mailto:mic...@fast-report.com
Fast Reports - cross-platform multi-language solutions for developers

http://www.fastexperts.com
http://www.fast-report.com

HBK

unread,
Apr 28, 2004, 6:52:36 PM4/28/04
to
Dear Michael Philippenko

Thank you again for help, I did like this:

Works nice but:

How to have the report title automatically apear on each side when more
data to print then can be shown on one page ?

If I use NewPage and manually do the show..tileband then program has to
know if fits ?

procedure TForm1.frReport1ManualBuild(Sender: TfrPage);
var
i, j: Integer;

p: TfrPictureView;
t: TfrMemoView;
begin
t := TfrMemoView(frReport1.FindObject('Memo1'));
if t <> nil then t.Memo.Text := 'HBs FastReport'; // I like to
control heading on runtime works fine

Sender.ShowBandByType(btReportTitle);
for i := 0 to 7 do
begin

t := TfrMemoView(frReport1.FindObject('Memo2'));
if t <> nil then t.Memo.Text := 'Hei på deg!';

t := TfrMemoView(frReport1.FindObject('Memo3'));
if t <> nil then t.Memo.Text := 'Her er det bilder '+IntToStr(i);

p := TfrPictureView(frReport1.FindObject('picture1'));
p.Picture.LoadFromFile('c:\arb.jpg');

Sender.ShowBandByName('Band2'); // Had to be here otherwise Memo3
was not updated ?
Sender.ShowBandByName('Band3');

// if i <> 3 then Sender.NewPage;
end;
end;

Best Regards
HB
Norway

Michael Philippenko

unread,
Apr 30, 2004, 8:57:05 AM4/30/04
to
Dear HBK!

MP> How to have the report title automatically apear on each side when more
MP> data to print then can be shown on one page ?

Use Page footer band instead of Report title.

MP> If I use NewPage and manually do the show..tileband then program has to
MP> know if fits ?

FastReport forms new page itself, if current band does not fit in the page.
You can also use NewPage method to insert page break.

Thursday, April 29, 2004, 2:52:36 AM, you wrote:

H> Dear Michael Philippenko

H> Thank you again for help, I did like this:

H> Works nice but:

H> How to have the report title automatically apear on each side when more
H> data to print then can be shown on one page ?

H> If I use NewPage and manually do the show..tileband then program has to
H> know if fits ?

H> procedure TForm1.frReport1ManualBuild(Sender: TfrPage);
H> var
H> i, j: Integer;

H> p: TfrPictureView;
H> t: TfrMemoView;
H> begin
H> t := TfrMemoView(frReport1.FindObject('Memo1'));
H> if t <> nil then t.Memo.Text := 'HBs FastReport'; // I like to
H> control heading on runtime works fine

H> Sender.ShowBandByType(btReportTitle);
H> for i := 0 to 7 do
H> begin

H> t := TfrMemoView(frReport1.FindObject('Memo2'));
H> if t <> nil then t.Memo.Text := 'Hei på deg!';

H> t := TfrMemoView(frReport1.FindObject('Memo3'));
H> if t <> nil then t.Memo.Text := 'Her er det bilder '+IntToStr(i);

H> p := TfrPictureView(frReport1.FindObject('picture1'));
H> p.Picture.LoadFromFile('c:\arb.jpg');

H> Sender.ShowBandByName('Band2'); // Had to be here otherwise Memo3
H> was not updated ?
H> Sender.ShowBandByName('Band3');

H> // if i <> 3 then Sender.NewPage;
H> end;
H> end;

H> Best Regards
H> HB
H> Norway

H> Michael Philippenko wrote:
>> Dear HBK!
>>
>>
>>>procedure TForm1.frReport1ManualBuild(Sender: TfrPage);
>>>var
>>> i, j: Integer;
>>>begin
>>
>>
>>>?? PageTitleBox := 'My report 1';
>>> Sender.ShowBandByType(btReportTitle);
>>
>>
>> You don't need to handle ReportTitle band in this event. Report title, summary, page header/footer
>> bands are handled automatically. You can handle only databands.
>>
>>
>>>While MoreData do
>>> begin
>>>
>>>?? Picture('pictureA').Assign ... own code to load picture
>>> Sender.ShowBandByName('FixedPictureBand');
>>
>>
>> var
>> p: TfrPictureView;
>> begin
>> p := TfrPictureView(frReport1.FindObject('pictureA'));
>> p.Picture.LoadFromFile(...) or
>> .Assign(...)
>>
>> That is all.
>>

--

HBK

unread,
May 1, 2004, 8:28:26 AM5/1/04
to
Thank you !

That worked great, and when I did this the report title showed up nicely
on first page:

t := TfrMemoView(frReport1.FindObject('Memo1'));

if t <> nil then t.Memo.Text := 'HBs FastReport';

frReport1.ShowReport;

I am convinced, FastReport are very good and in taste of an oltimer
programmer like me !

Best Regards
HB
Norway

delphi.b...@gmail.com

unread,
Apr 11, 2019, 4:24:04 PM4/11/19
to
why you use all this lines of codes .......??????

PLEASE GO AND JUST WATCH How i make this happen without coding just a binding and virtual table that load all input data from any non dataAware component and report their data contents inside a simple frxreport.
LINK HERE: https://youtu.be/DY14Oq49G4c
and here is the origin question link : https://www.easydelphi.com/qa/1872/%D8%A7%D8%B8%D9%87%D8%A7%D8%B1-%D9%82%D9%8A%D9%85-edit1-edit2-edit3-%D9%81%D9%8A-%D8%A7%D9%84%D9%81%D8%A7%D8%B3%D8%AA-%D8%B1%D8%A8%D9%88%D8%B1%D8%AA

0 new messages