Normal Topic Reports w/Subreports (Read 4308 times)
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Reports w/Subreports
Mar 1st, 2005 at 10:12pm
Print Post Print Post  
Erika, Ray, or Mark?

I am trying to hide a subreport under certain conditions, but can't seem to do it.

I have tried using Visibility() on the subreport element in the parent report, which passes the testing in designer. But, it causes a warning when I try to run the report, saying that the programming has failed to compile.

While attempting to approach the visibility issue from within the subform itself using @FormResultSetTotal("Children"), I found that the total is correct when I run the subform report by itself, but it is not correct when run within the parent report. When run within the parent report, the total always shows the total related to the first parent record's number of children. All subsequent records show the same value, even though the number of subrecords that are printing varies indicating the true number of subrecords. This is demonstrated in the report below.

Quote:
------------------------------------------------------------------------
603-623-4564
Rick St Onge
Sally Prescott
1223 Mast Rd, PO Box 234
Manchester NH 03102-0234

Email: rsnfmly2432@aol.com

Subform Count: 5

CHILDREN     Count
1stkidsname     5
2ndKidsname     5
3rdkidsname     5
4thKidsname     5
5thkidsname     5

------------------------------------------------------------------------
603-487-5776
John Doe
3 Stage Rd
Northwood NH

Email:

Subform Count: 5

CHILDREN  Count
                          5

------------------------------------------------------------------------
603-228-5786
Paul Charpentier
Nancy Charpentier
834 Duncan St
Concord NH 03303

Email: charpentiersofconcordnh@hotmail.com

Subform Count: 5

CHILDREN    Count
James             5
Rachel            5
Stephanie      5

------------------------------------------------------------------------
603-736-2445
Jane Parker
83 Orchard Ln
Epsom NH 03234

Email: jparkergardener@earthlink.com

Subform Count: 5

CHILDREN Count
                                       5

------------------------------------------------------------------------
603-788-6574
Bruce Yeaton
Gertrude Davis-Yeaton
63 Pendelton Ln
Loudon NH 03307

Email: bruceyeatonyakeefan@direcway.com

Subform Count: 5

CHILDREN  Count
Bonnie                        5





So, basically I have two questions:

1) Should Visibility() work on a subreport element? (It seems to work on other types of elements in a report.)

2) Why does @FormResultSetTotal() keep giving the count of only the first parent record's subreport total?

I hope I have explained myself clearly. If not, I'm sure you'll let me know. Smiley

Thanks.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Reports w/Subreports
Reply #1 - Mar 1st, 2005 at 11:27pm
Print Post Print Post  
Quote:
1) Should Visibility() work on a subreport element? (It seems to work on other types of elements in a report.)


No. Visibility does not work on a subreport element.

Quote:
2) Why does @FormResultSetTotal() keep giving the count of only the first parent record's subreport total?

The key word here is Form. As in @FormResultSetTotal(). A subreport and a subform are not the same thing and do not get their records the same way. In what event are you calling @FormResultSet Total?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Reports w/Subreports
Reply #2 - Mar 2nd, 2005 at 12:57am
Print Post Print Post  
Quote:
In what event are you calling @FormResultSet Total?

Well, actually I'm calling from two places: 1) in the subreport itself, and 2) in the subreport element within the parent report.

It's only in both places because I was troubleshooting. I didn't really expect it to work in the parent report, but it did give me the same results as from the subreport.

I did however, expect it to work in the subreport. It works for the first subreport, but not the rest.

Oh, you did say EVENT, didn't you. Embarrassed  In the On Print event in the reports.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Reports w/Subreports
Reply #3 - Mar 2nd, 2005 at 3:53pm
Print Post Print Post  
I've solved my initial problem of getting the report to look the way I want. Sorry to bother you with this.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Reports w/Subreports
Reply #4 - Mar 2nd, 2005 at 4:40pm
Print Post Print Post  
Quote:
I've solved my initial problem of getting the report to look the way I want. Sorry to bother you with this.


No bother at all! Is there still something you need us to look at, or are you all set?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Reports w/Subreports
Reply #5 - Mar 2nd, 2005 at 10:52pm
Print Post Print Post  
Quote:
Is there still something you need us to look at, or are you all set?

I'm all set, thanks. It turns out that the solution was so simple, I don't know how I overlooked it. Embarrassed

I guess I started down the path of using Visibility(), and when that didn't work, I began trying to figure out why; which got me completely side-tracked.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged