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

Show detail values within a group

Status
Not open for further replies.
Apr 11, 2008
68
GB
I have a report which lists stock on display within a group of retail stores.

I have grouped the items based on their product code, so that there is one line for each product code, and used a if/then formula to put either 1 or 0 into the respective columns across the page for each store, to mark if the store has the item on display.

At detail level, I have used a sub-report to show the colour of the item, but when I group the detail records based on product code, I don't know how I can create a field which shows the colours of the items that are included in the group????

Normally, all stores show the same colour of a product, but when they don't, I want to show the colours in the format 'Colour A / Colour B etc.' - I don't need to indicate which store has which colour, just show all colours currently on display within the company.

Can anyone help? I fear that as the colour is drawn from a sub-report this will be difficult!

Thanks in advance.
 
A Sharev Variable will return the value from a subreport in a form that can be used by the main report, though only in a section below the section calling the subreport.

If you don't have too many colours, you could accumulate totals for each.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Thanks Madawc

Since I posted the original query, I've now successfully created an additional field in the two relevant tables, so that I can link them directly without needing to use a subreport. This means that every product code at every store now has a detail value for colour.

However, my original query about showing these colours if I group by product code remains - is it possible to show the values of a field at detail level within the group it is in?

i.e. - Desired result

Product Code Store A Store B Store C Colour

Detail Product 1 1 0 0 Red stripe
Detail Product 1 0 1 0 Red stripe
Detail Product 1 0 0 1 Orange stripe

Group Product 1 1 1 1 Red stripe, Orange stripe

Thanks


Peter
 

For the store values, you can just insert a maximum on the store formula at the group level. For the colors, create three formulas:

//{@reset} for the product code group header:
whileprintingrecords;
stringvar x;
if not inrepeatedgroupheader then
x := "";

//{@accum} for the detail section:
whileprintingrecords;
stringvar x := x + {table.colour} + ", ";

//{@display} for the product code group footer:
whileprintingrecords;
stringvar x;
if len(x)>2 then
left(x,len(x)-2)

This will display the colors in a comma-delimited string in the group footer.

-LB
 
Hello Crystal MVPs

I am am using Crystal Reports XI and I have created a report that displays treatment services in the detail section of the report, e.g., service type, duration of treatmet, frequency of treatment, therapist providing treatment. What I want to do is create a mock cross tab report that list of all the types of services and display and X when service type is selected and corresponding values in the fields when a service is selected and the fields will be blank if no service is selected (see chart below). The problem is that when there are multiple selections only the last entry appears in the chart. The mock cross tab is in the report footer. thanks for any help you can give

talib

Service Type Frequency Duration Therapist
Assessment X 1-3 Times 1 Month Jan Jones
Case Management
Individual Counseling X 2 x week 6 Months Fred Flintstone
Group Counseling
Crisis Intervention



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top