Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Avoiding SubReports

Status
Not open for further replies.

LikePork

Programmer
Aug 13, 2004
42
CA
Hello, I'm working with CR for VS.net and using the push method (with manually filled ADO.net datasets) to get the data into the report.

I'm trying to avoid subreports by creating generic records instead of having several different tables to represent the data. The records look like:

Type = integer / number
Code = integer / number
Description = string
Amount = string

With Type being an indicator as to exactely what kind of record it is. There are 3 different types of records, and I'd like to display them on one Page in the following format

Type 1 Header
Type 1 Records "Code Description Amount"
Type 1 Summary

Type 2 Header
Type 2 Records "Description Amount"

Type 3 Header
Type 3 records "Code Amount"
Type 3 Summary "formula to sum type 3 amounts"

the headers being TextObjects, Summary's being formulas to get sums and such.

To begin I sort the records by Type, then to achieve the headers I'm attemping to use several sections with supression formulae. I keep trying to set Booleans as flags but am not getting the desired results. I'm not really sure whether to evaluate whileprinting/reading?

I'd like to know if anyone has done stuff like this befor (to prove to me that it is possible), or maybe if someone knows whether having several supressed sections and formulae like this will slow this down, compared to having 3 subreports instead (to justify doing it the easy way for me). Thanks in advance for any ideas.
 
I've done something like that before. This assumes you've got 3 Types:

Group on Type, then add: 2 additional Group Headers (so you have GH1a, GH1b, and GH1c); 2 extra Details sections (so you've got DetailsA, B and C); and 2 extra Group Footers (GF1a, GF1b, GF1c).

The 'A' sections would only print for Type 1, the 'B' sections for Type 2, and the 'C' sections for Type 3. You can do that with suppression formulas for each section. For instance, the 'A' sections would have a suppression formula like this:
[tt]
{Table.Type} <> 1
[/tt]
The Headers, Details, and Footers can then be formatted however you need them to be for each Type. With this layout, you should be able to do straight summaries, and be able to avoid any formulas using evaluation time.

-dave
 
I never considered the headers could work like that. A much simpler solution than what I was trying to do. Thanks a lot I'll try it out. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top