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 

Objects and Report Tools

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design
View previous topic :: View next topic  
Author Message
Joanna Carter (TeamB)
Guest





PostPosted: Tue Dec 28, 2004 10:26 am    Post subject: Re: Objects and Report Tools Reply with quote



"Quicoli" <paulo (AT) controlm (DOT) com.br> a écrit dans le message de news:
41d12ec2$1 (AT) newsgroups (DOT) borland.com...

Quote:
How do you build your reports ? Do you adapt object into DataSets or
have some different approach ?

If I use a reporting tool it is ReportBuilder which allows the concept of a
JIT dataset or as they call it pipeline.

I derive from the base JIT pipeline class and simply create a dataset that
pulls data from an object list.

I design Report classes that are handled by a Custom Handler inside the OPF
to avoid the slowdown that can come with auto-generated SQL over multiple
joins. It is list of instances of these report classes that I use to feed
the pipeline.

Joanna

--
Joanna Carter (TeamB)

Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker



Back to top
Roman Kaßebaum
Guest





PostPosted: Tue Dec 28, 2004 10:45 am    Post subject: Re: Objects and Report Tools Reply with quote



Quicoli schrieb:
Quote:
To develop these reports i'm using FastReport tool, and it is
DataSet based, like others tools i know (Rave, QuickReport ...)

How do you build your reports ? Do you adapt object into DataSets or
have some different approach ?

I also use the FastReport. It has a fantastic UserDataSet which allows
use to fill the Report with objects. BTW filling the report "manually"
is much more faster than filling the report the normal way.

--
Roman


Back to top
Quicoli
Guest





PostPosted: Tue Dec 28, 2004 11:03 am    Post subject: Objects and Report Tools Reply with quote



Hi friends !

i'm building an OO aplication.... and now i have to
delivery some reports....

To develop these reports i'm using FastReport tool, and it is
DataSet based, like others tools i know (Rave, QuickReport ...)

How do you build your reports ? Do you adapt object into DataSets or
have some different approach ?

Thanks, and a happy new year !




--
Paulo R. Quicoli
---------------------
Analista Programador
Control-M Informática Ltda.
Back to top
Roman Kaßebaum
Guest





PostPosted: Tue Dec 28, 2004 12:21 pm    Post subject: Re: Objects and Report Tools Reply with quote

Quicoli schrieb:
Quote:
I read about FastReport UserDataSet, and i didnt like its approach of
comparing texts:

procedure TForm1.frxReport1GetValue(VarName: String; var Value: Variant);
begin
if CompareText(VarName, 'element') = 0 then
Value := ar[ArrayDS.RecNo];
end;

Do you use it that way ?

My idea is to adapt my objects in a dataset and use this dataset in a
report tool.

Thanks!


No, I use it in a different way.

I have persistent objects, e.g TPerson. I also have lists of these
objects, e.g. TPersonList.

I use the reports in DataModules, because for reports you don't need forms.

The FastReport has a TUserDataSet. I use the events CheckEof, First,
Next and Prior of the TUserDataSet.

This means that I have an index for the position in the TPersonList. In
the First event the index is initialized, in Next and Prior it is
incremented or decremented. CheckEof checks that the index is not bigger
than the count of the TPersonList.

In the events First, Next and Prior I call a function FillReport in
which I fill the report with the TPerson form the TPersonList at the
position index.

The fastest way to fill the report is to have a field for every element
of the report, e.g.:

TMyReport = class(TDataModule)
udReport: TfrUserDataset;
frReport: TfrReport;
procedure udReportCheckEOF(Sender: TObject; var Eof: Boolean);
procedure udReportFirst(Sender: TObject);
procedure udReportNext(Sender: TObject);
procedure udReportPrior(Sender: TObject);
private
FPersonList: TPersonList;
FIndex: Integer;

FName: TfrMemoView;
...
end.

The fields should be initialized:
procedure TMyReport.Init;
begin
FName := frReport.FindObject('frName') as TfrMemoView;
...
end;

After that the fields can be filled easy:
procedure TMyReport.FillReport
var
pPerson: TPerson;
begin
pPerson := FPersonList[FIndex];

FName.Memo.Text := pPerson.Name;
//Faster could be FName.Memo.Clear and .Add
//Use a function for this.
...
end;

These reports a very very fast.

--
Roman

Back to top
Quicoli
Guest





PostPosted: Tue Dec 28, 2004 12:57 pm    Post subject: Re: Objects and Report Tools Reply with quote

Roman Kaßebaum wrote:

Quote:
I also use the FastReport. It has a fantastic UserDataSet which allows
use to fill the Report with objects. BTW filling the report "manually"
is much more faster than filling the report the normal way.

--
Roman


I read about FastReport UserDataSet, and i didnt like its approach of
comparing texts:

procedure TForm1.frxReport1GetValue(VarName: String; var Value: Variant);
begin
if CompareText(VarName, 'element') = 0 then
Value := ar[ArrayDS.RecNo];
end;

Do you use it that way ?

My idea is to adapt my objects in a dataset and use this dataset in a
report tool.

Thanks!


--
Paulo R. Quicoli
---------------------
Analista Programador
Control-M Informática Ltda.

Back to top
Quicoli
Guest





PostPosted: Tue Dec 28, 2004 1:43 pm    Post subject: Re: Objects and Report Tools (Thanks !!!) Reply with quote

Roman Kaßebaum wrote:
Quote:

No, I use it in a different way.

The fastest way to fill the report is to have a field for every element
of the report, e.g.:

Roman....

Really, really thanks for exposing your code. Thanks !



--
Paulo R. Quicoli
---------------------
Analista Programador
Control-M Informática Ltda.

Back to top
Kyle Cordes
Guest





PostPosted: Wed Dec 29, 2004 3:59 am    Post subject: Re: Objects and Report Tools Reply with quote

"Joanna Carter (TeamB)" <joanna (AT) nospam (DOT) co.uk> wrote in message

Quote:
If I use a reporting tool it is ReportBuilder which allows the concept of
a
JIT dataset or as they call it pipeline.

I derive from the base JIT pipeline class and simply create a dataset that
pulls data from an object list.

I design Report classes that are handled by a Custom Handler inside the
OPF
to avoid the slowdown that can come with auto-generated SQL over multiple
joins. It is list of instances of these report classes that I use to feed
the pipeline.


Joanna,

The enterprise systems we build here, typically have quite complex reports
that are populated by multiple datasets coming out of a stored procedure,
sometimes up to several pages in length.

Though I hate to go "around" the application logic this way, I've found that
SQL is much more succinct for expressing the logic underlying the report,
than Delphi (or other similar language) code.

How do you deal with complex, many-table-join, multi-dataset reports in the
approach you described above? Just bite the bullet, so to speak, and write
as much application code as needed to produce the output?

--
[ Kyle Cordes * [email]kyle (AT) kylecordes (DOT) com[/email] * http://kylecordes.com ]
[ Better processes, better design, better software. Java, ]
[ Delphi, BDE Alternatives Guide, Enterprise apps, and more ]



Back to top
Jim Cooper
Guest





PostPosted: Wed Dec 29, 2004 6:26 am    Post subject: Re: Objects and Report Tools Reply with quote


Quote:
How do you deal with complex, many-table-join, multi-dataset reports in the
approach you described above?

I write separate report objects and/or mappers that use more complex SQL

Cheers,
Jim Cooper

_______________________________________________

Jim Cooper [email]jim (AT) falafelsoft (DOT) com[/email]
Falafel Software http://www.falafelsoft.com
_______________________________________________

Back to top
Joanna Carter (TeamB)
Guest





PostPosted: Wed Dec 29, 2004 8:36 am    Post subject: Re: Objects and Report Tools Reply with quote

"Kyle Cordes" <kyle (AT) kylecordes (DOT) com> a écrit dans le message de news:
41d22b3a$1 (AT) newsgroups (DOT) borland.com...

Quote:
How do you deal with complex, many-table-join, multi-dataset reports in
the
approach you described above? Just bite the bullet, so to speak, and
write
as much application code as needed to produce the output?

Like Jim says, I write classes that describe the complex objects and then
use whatever complex SQL is required inside a Custom Handler in the OPF.

Joanna

--
Joanna Carter (TeamB)

Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker



Back to top
Kyle Cordes
Guest





PostPosted: Wed Dec 29, 2004 10:10 pm    Post subject: Re: Objects and Report Tools Reply with quote

"Joanna Carter (TeamB)" <joanna (AT) nospam (DOT) co.uk> wrote


Quote:
How do you deal with complex, many-table-join, multi-dataset reports in
the
approach you described above? Just bite the bullet, so to speak, and


Quote:
Like Jim says, I write classes that describe the complex objects and then
use whatever complex SQL is required inside a Custom Handler in the OPF.

Ah, OK. This keeps the layer of objects between your DB and report, at the
(hopefully minor, depending on your toolset) expense of maintaining whatever
custom DTOs are needed for the report's data. The SQL itself ends up the
same as in the approach we're using.


--
[ Kyle Cordes * [email]kyle (AT) kylecordes (DOT) com[/email] * http://kylecordes.com ]
[ Better processes, better design, better software. Java, ]
[ Delphi, BDE Alternatives Guide, Enterprise apps, and more ]



Back to top
Charles McAllister
Guest





PostPosted: Thu Dec 30, 2004 2:23 pm    Post subject: Re: Objects and Report Tools Reply with quote

Quicoli wrote:
Quote:
Hi friends !

i'm building an OO aplication.... and now i have to
delivery some reports....

To develop these reports i'm using FastReport tool, and it is
DataSet based, like others tools i know (Rave, QuickReport ...)

How do you build your reports ? Do you adapt object into DataSets or
have some different approach ?
I don't use a report designer to build reports.

I write them all 'by hand', using Rave's print engine (not the designer). It actually is kind of
RAD since I use form inheritance to extend some common report styles.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design 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.