By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,509 Members | 1,301 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,509 IT Pros & Developers. It's quick & easy.

supplying different business objects as data to crystal reports

P: n/a
hi,

I posted here earlier with a great reply:
http://www.microsoft.com/communities...044&sloc=en-us

Something like this works nicely:
List<Personps = new List<Person>();
ps.Add(new Person("Gideon",15));
CrystalReport11.SetDataSource(ps);
crystalReportViewer1.ReportSource = CrystalReport11;

After adding this class to the database expert I can link Persons properties
to the report.

Now what if I have
class AccountLine{
Description
Amount
Date
}

I make a crsytal report the same way as I did above it works fine, I can
make a report with list of payments .

NOW, I need to add a total on the *bottom* of the whole list, so if the list
of payments if four pages long, the total should be at the end of the fourth
page, so I made:
class Total{
Amount
}

But if I add it to the database expert it doesn't work at all, even the
AccountLine data doesn't show up.

Is there no decent way of making fields in the report and specifying the
data that goes in there.

I hope my quesition is clear.

Thanks so much

Gideon

Oct 18 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a

Unforunately, one work around I've seen is

Create a strong dataset.
Loop over your custom business objects / collection and populate rows in the
strong dataset.
Add your aggregate data to a different table in the strong dataset.
Use that as the CR datasource.
(Oh yeah, create your report against the XSD of the strong dataset)

Yeah, that sucks.

ActiveReports has a much better implementation.....it allows binding to
IList(s).


"giddy" <gi***@discussions.microsoft.comwrote in message
news:0A**********************************@microsof t.com...
hi,

I posted here earlier with a great reply:
http://www.microsoft.com/communities...044&sloc=en-us

Something like this works nicely:
List<Personps = new List<Person>();
ps.Add(new Person("Gideon",15));
CrystalReport11.SetDataSource(ps);
crystalReportViewer1.ReportSource = CrystalReport11;

After adding this class to the database expert I can link Persons
properties
to the report.

Now what if I have
class AccountLine{
Description
Amount
Date
}

I make a crsytal report the same way as I did above it works fine, I can
make a report with list of payments .

NOW, I need to add a total on the *bottom* of the whole list, so if the
list
of payments if four pages long, the total should be at the end of the
fourth
page, so I made:
class Total{
Amount
}

But if I add it to the database expert it doesn't work at all, even the
AccountLine data doesn't show up.

Is there no decent way of making fields in the report and specifying the
data that goes in there.

I hope my quesition is clear.

Thanks so much

Gideon

Oct 20 '08 #2

P: n/a


"sloan" wrote:
>
Unforunately, one work around I've seen is

Create a strong dataset.
Loop over your custom business objects / collection and populate rows in the
strong dataset.
Add your aggregate data to a different table in the strong dataset.
Use that as the CR datasource.
(Oh yeah, create your report against the XSD of the strong dataset)

Yeah, that sucks.
Thanks!
ActiveReports has a much better implementation.....it allows binding to
IList(s).
(Was more happy about this answer)
Active reports huh? Think its better when it comes to feeding business
objects? I mean, can I just reference business objects or better yet create
place holders and fill them up on my own?
The product does look good, but does it have some muck ups like CR?

(Should have posted a thread here asking for CR alternatives)

Thanks so much

Gideon
Oct 21 '08 #3

P: n/a

I can only add this:

I hate Crystal Reports.

I like Active Reports.

//Think its better when it comes to feeding business
objects?
Yes. It was better 4 years ago, and has only gotten better.

The dll deployment is pretty easy.

The last version I used, you had to do a

ActiveReport.SetLicenseKey "ABC123ABC123ABC123ABC123ABC123ABC123" ; << Where
this was a key given to you(your company).
That was the only snapfu with them at all.
Crystal Reports would be alot better if you could turn OFF the "Pull" model.
Too much hacking with that model.

The PUSH model is better with CR, and I can live with it when I have to.

But ActiveReports are much better.


"giddy" <gi***@discussions.microsoft.comwrote in message
news:B9**********************************@microsof t.com...
>

"sloan" wrote:
>>
Unforunately, one work around I've seen is

Create a strong dataset.
Loop over your custom business objects / collection and populate rows in
the
strong dataset.
Add your aggregate data to a different table in the strong dataset.
Use that as the CR datasource.
(Oh yeah, create your report against the XSD of the strong dataset)

Yeah, that sucks.

Thanks!
>ActiveReports has a much better implementation.....it allows binding to
IList(s).
(Was more happy about this answer)
Active reports huh? Think its better when it comes to feeding business
objects? I mean, can I just reference business objects or better yet
create
place holders and fill them up on my own?
The product does look good, but does it have some muck ups like CR?

(Should have posted a thread here asking for CR alternatives)

Thanks so much

Gideon

Oct 21 '08 #4

P: n/a
I can only add this:

I hate Crystal Reports.

I like Active Reports.
I would have to agree, active report has a MUCH better model. Although, I
didn't find any docs on their model and its sad they didn't just add XML
comments, would be easier to figure things out. Also, v3.0, it seems has no
external files, the whole report is a class.

But! Alas! I can't possibly afford it! The App I'm building costs a fraction
of Active reports price tag!
I guess I'll have to stick to CR! Your dataset solution worked nicely.
Sadly, CR doesn't even have a way a printing a table(grid with borders).

Thanks so much

Gideon
Yes. It was better 4 years ago, and has only gotten better.

The dll deployment is pretty easy.

The last version I used, you had to do a

ActiveReport.SetLicenseKey "ABC123ABC123ABC123ABC123ABC123ABC123" ; << Where
this was a key given to you(your company).
That was the only snapfu with them at all.
Crystal Reports would be alot better if you could turn OFF the "Pull" model.
Too much hacking with that model.

The PUSH model is better with CR, and I can live with it when I have to.

But ActiveReports are much better.
Oct 22 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.