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

CR10 - Subreport variable and group select issues

Status
Not open for further replies.

Almie

Technical User
Nov 28, 2006
39
0
0
US
My report consist of a Main report and a subreport. I am trying to get a list of cases where their is a victim on the case, but no Restitution assessment exists for the Defendant.
Subreport - I have pulled a Case list where Defendant has been assessed Restitution ( Recievable type: "R"). 6 Group created: (court,location,case_type,case_number,Party,ID)

Case number, Party/ID, Rec_type: R, $##.##



Shared variable: shared stringvar v_true := totext(if isnull(case_number) or (case_number) = "" then true else false)
--Variable was placed on last group (ID)


Main report:I have pulled a Case list where there is a Victim record existing.

Case number, PartyName, Party type: V



Variables from subreport defined in main report and placed in group 6 (ID) :
shared stringvar v_true ; v_true


When linking subreport to Main Report - subreport results displays a blank subreport box for cases with no Restitution assessments and subreport box with data where the case has assessments.

I would like to only see those cases that have blank subreport box.

When I try creating a group selection
{@v_true} = true

I get an error message "A string is required here".

When I try {@v_true} = totext(true)

I get "This formula cannot be used because it must be evaluated later".



Can anyone help?



 
Grouping happends early on, while subreports are only run while the report is printing. Subreport output cannot be accessed except from a section below the section that runs the subreport.

Can you move the function up into the main report? That should be quicker anyway.

If you can't, is it possible to reverse the design, subreport function as main report and the incompatible bit of the main report to a subreport?

Failing that, an SQL Command can assemble data from several sources. That depends on your database and Crystal version, which it's always helpful to give. (8, 8.5, 9, 10, 11 or whatever.)

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I would link the sub by the case number, and put a reset formula in the main report in a section before the one in which the sub is located (in GH4_a if the sub is in GH4_b):

whileprintingrecords;
shared stringvar caseno;
if not inrepeatedgroupheader then
caseno := "";

In the sub, put a formula in the report footer:

whileprintingrecords;
shared stringvar caseno := {table.case_number};

Then in the main report, show the case # in GH4_c and in the section expert use a suppression formula like this:

whileprintingrecords;
shared stringvar caseno;
caseno <> ""

Add this same suppression formula to the inner group sections.

You can suppress GH4_a, and for GH4_b where the sub is located, format the section "suppress blank section". Also format the sub itself to "suppress blank subreport" (on the format subreport->subreport tab),and within the sub, suppress all sections. This will allow GH4_b to not display also.

-LB
 
I put the version of Crystal on the subject line...CR10 and
am using a Informix database. Sorry, should have added it to my text.
Table 1 - has Victim information
Table 2 - has Recievable information (Restitution assessments)


I tried reversing the design, but there are about 80 other receivable type that could possibly exists on the case.

Here are the results of two cases where there is a Victim on the case, and first case has Restitution assessment and the second case does not have Restitution assessment.

variable:v_true
Group6 - Case 3222 [Subreport: D-1 Mary false R-$300]
detail V 1 Chuck
Group footer6 - false (variable v_true)
-----------------------------------------------------------
variable:v_true
Group6 - Case 3225 [Subreport: true ]
detail V 1 Walmart
Group footer6 - true (variable v_true)

I would like to see only the case with "true" which are cases that do not have Restitution assessments.

Can you filter on the shared variabler results that was pulled in from the subreport?


 
No, I must have been typing when you were responding...thank you for you response. I will try your suggestion and post my results. Thanks again for your time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top