BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

FastReport manually creating non database dependent report

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Reporting-Charting
View previous topic :: View next topic  
Author Message
HBK
Guest





PostPosted: Wed Apr 28, 2004 11:18 am    Post subject: FastReport manually creating non database dependent report Reply with quote



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
Back to top
Michael Philippenko
Guest





PostPosted: Wed Apr 28, 2004 4:21 pm    Post subject: Re: FastReport manually creating non database dependent repo Reply with quote



Dear HBK!

Quote:
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.

Quote:
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:michael (AT) fast-report (DOT) com
Fast Reports - cross-platform multi-language solutions for developers

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


Back to top
HBK
Guest





PostPosted: Wed Apr 28, 2004 10:52 pm    Post subject: Re: FastReport manually creating non database dependent repo Reply with quote



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 wrote:
Quote:
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.


Back to top
Michael Philippenko
Guest





PostPosted: Fri Apr 30, 2004 12:57 pm    Post subject: Re[2]: FastReport manually creating non database dependent r Reply with quote

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:
Quote:
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.




--
Best regards,
Michael Philippenko mailto:michael (AT) fast-report (DOT) com
Fast Reports - cross-platform multi-language solutions for developers

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


Back to top
HBK
Guest





PostPosted: Sat May 01, 2004 12:28 pm    Post subject: Re: FastReport manually creating non database dependent repo Reply with quote

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



Michael Philippenko wrote:
Quote:
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.






Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Reporting-Charting All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.