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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding the subreport section with a passed variable?

Status
Not open for further replies.

cabjork

Technical User
Feb 24, 2008
9
US
I have an excel spreadsheet (left) joined with an employee database (right) on SS# and have had to use a subreport to pull over just the data I need to compare. I have finally gotten the data to come across correctly by grouping on SS#, putting my subreport in a details A section, my passed variable called "totalVar" in a details B section and a zero reset called "totalVar reset" up in the group header. Howevever my current problem is that the only row of data I want to see and export is the details B section, where I have all the fields I need including the accurate passed variable. However, I cannot figure out a way to hide or suppress the details A section which then produces an empty data row when I do an export. Any suggestions on placement or formatting of the passed variable, passed variable reset and the subreport to continue to get accurate data and avoid the empty data rows produced by the the section holding just the subreport?
 
This depends upon your version of CR, which you should always identify. In higher versions, you can suppress all sections within the subreport, format the subreport (format->subreport->subreport tab->check "suppress blank subreport"), and then also format the detail_a section to "suppress blank section". This will eliminate the detail_a section from view, but still allow the shared variable to pass.

What you cannot do is suppress the subreport object or the section that contains it.

-LB
 
LB,

Excellent! The one piece I was missing was

"In higher versions, you can suppress all sections within the subreport, format the subreport (format->subreport->subreport tab->check "suppress blank subreport")"

I had not seen that check box before and it seems to have done the trick. FYI, this was my first post to the forum, but in the future, I will know to include that I am using version XI. Thanks for your help!

Chris
 
ok, now that I got the first suppressed subreport with a passed variable to work in CRXI, I tried to add an additional subreport, also linked on the SSN field, however, I seem to have some problem with my linking. I get the pop up error message "The field name is not known" highlighting the SSN field in my subreport (bolded below) - even though I set up my addional sub-report linking to link on that field. Here is the text from the record selection window that pops up highlighting the "ARC_SSN" field which it says is "not known"

isnull({V_EMPL_BENEFITS.EMP_BEN_TERM_DATE}) = True and
{V_EMPL_BENEFITS.BEN_DESC} like "*UHC*"
and
{V_EMPL_BENEFITS.SOCIALSECURITY#} = {?Pm-Dispatcher_.SS#}
and
{ARC_.SSN } = {?Pm-Dispatcher_.SS#}
{V_EMPL_BENEFITS.SOCIALSECURITY#} = {?Pm-Dispatcher_.SS#}
{ARC_.SSN } = {?Pm-Dispatcher_.SS#}
{V_EMPL_BENEFITS.SOCIALSECURITY#} = {?Pm-Dispatcher_.SS#}


FYI, all these record selection formulas come from my subreports and the subreport links (as parameters). I have no record selection formulas in my main report. Am I creating problems by trying to link two subreports on the same "Dispatcher_.SS#" field in main report? Would it help if I created a duplicate "Dispather SS#2" data column so each subreport would have to link on ths same field? Let me know if you have any idea what I am missing.

Chris

 
Why do you have those repeating lines at the end? There is no problem linking two subreports on the same field. But do you mean to require that two different fields in the sub link to the same SSN from the main report?

-LB
 
I frankly don't know where the repeating lines came from but I assume from my multiple attempts to get my links to work. I cleared out that section of the record selection formula and started my subreport links over from scratch and they seem to work now. However, my new passed stringVar from my second subreport does not seem to be working. It is populating all 470 rows of data the first value of the stringVar, "Dean Health" . When my numberVar returned zero for every row I fixed it with the sub report in the section above my results and the

WhilePrintingRecords;
Shared NumberVar TotalVar := 0

in the group header and it worked.

With the second subreport, I basically did the same thing (used the same sections) except now my passed variabe is a string so I changed my reset to

WhilePrintingRecords;
Shared StringVar PlanVar := ""

But I must be missing something because as I said, every row returns the same string value, when this field should be null for approx 440 of my 470 rows.

Chris
 
The subreports should be in the detail_b section, with resets in detail_a, and shared results in detail_c.

-LB
 
LB,

I moved all my subreport stuff into the three details sections. It didn't solve my passed StringVar problem, but it tidied up my report organization. I finally realized that I was missing some key parentheses in the record select for my 2nd subreport. Once I fixed this basic record selection problem, my 2nd passed subreport variable worked perfectly. Thank you nevertheless for your initial questions/comments. I can't tell you how impressed I have been with the calibre of your contributions during my brief tenure on the board.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top