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