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

Value for Variable is not showing when hidden

Status
Not open for further replies.

alex35

Technical User
Oct 15, 2001
15
US
I use a variable in a report. The variable is passed from a subreport to the main report. I noticed that the value for the final variable is displayed on the main report when the sub report is visible (not Suppressed). The variable becomes zero when the sub report is not visible (Suppressed).

I don't want to show the details of the sub report, but only want to show the final value of the variable in the main report.

Below is the coding for the variable:

WhilePrintingRecords;
Shared NumberVar MDNCount;
if {?Pm-MA.MATTER_NO} = {MA.MATTER_NO} and {MA.ZSTART_DATE} = {?Pm-Max of MA.ZSTART_DATE} and {MA.ZHANDLING} in ['M','D','N']
then MDNCount := MDNCount + 1 else MDNCount

Below is the formula that used to display the value of the variable in the main report:

WhilePrintingRecords;
Shared NumberVar MDNCount

Version of Crystal Reports is 9.0


Thanks in Advance,
William
 
You're using conflicting terminology, the title says hidden, the post says suppressed, these are very different so please clarify.

Shrink the subreport up to a itty bitty size and eliminate the border. You can even change the font in the subreport to a white on white.

You might also hide the subreport, I think that works, it's just the suppress that logically doesn't. I rarely use subreports these days as they are very inefficient. the only time I do is when I'm ganging multipole unrelated reports into a single container.

Whatever the subreport is doing, SQL can do more efficiently.

-k
 
Well, you can't hide subreports either, although depending upon your report format, you could try formatting the section above where the subreport is located to "Underlay following sections."

You can suppress all sections within a subreport so they do not display. You just can't suppress the section of the main report in which the subreport is located. So resizing is about the best you can do, along with the possible use of the underlay feature.

-LB
 
I shrunk the subreport to its smallest possible height (.04 inches) that Crystal accepted. Because there are close to 12,000 records retrieved in report, blank pages are appearing on the report. In addition, it takes awhile to process as well.

Taking your advice, I have attemted to do this report using SQL Command. I am using "INTERSECT" set operator, but Crystal Reports does not seem to support it. Below is the SQL statement:

SELECT MATTER_NO, Max(ZSTART_DATE), ZHandling
FROM MA
WHERE ZDISPOSITION_DATE IS NULL
GROUP BY MATTER_NO
INTERSECT
SELECT MATTER_NO, ZSTART_DATE, ZHandling
FROM MA
WHERE ZHANDLING in ('D', 'J', 'M', 'N', 'P')

Does Crystal Reports use a different format for the INTERSECT set operator.

FYI: The goal here is to retrieve records for each Matter_No with the most current Start_Date (Max(ZStart_Date for Matter_No).

Thanks, again,
William
 
Dump the subreport completely. You do not need it, nor the variable.

Create a simple report that lists all the records, grouped by Matter_no. Insert a maximum summary of Zstart_Date into the group footer.

The go to report, edit selection formula group and enter a simple formula:

{ZStart_date}=maximum({Zstart_date},{Matter_no})

This will only show those records that have the maximum Zstart_date for each Matter_no. If there is more than one record with the maximum date for that group, all will show.





Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
In 9 you have a new option. If you right click on the subreport from the main report and bring up formatting, one of the tabs is "subreport". You can select "suppress blank supreport" there, and then select "suppress blank sections" for the section of the main report that it is in. The only trick then is to make sure the subreport is blank while still performing the calcs you want. I had a couple reports that had the same situation you do. Switching to 9 and using this functionality did the trick. Better databases would be nicer :) but at least it was doable.

Lisa
 
That did the trick. Thanks dgillz.

I still would like to know if Crystal supports the INTERSECT Set Operator. If so, what is the proper syntax? This would prevent me from having to use so many subreports.

Thanks, again,
William
 
I have never heard of INTERSECT and I don't know what it is supposed to do. I am sure one of the programmers here will be able to help.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
A SQL Command just passes the SQL, so if it works in your database, it should work in the Add Command.

If you're using an ODBC driver, the ODBC driver may be causing the problem.

Rather than posting what you're trying to do, try posting database type, connectivity used, example data and expected output, you may find that others have another approach to the problem.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top