I have a subreport which displays competitor names (one to many relationship with opportunity). I can display the competitors vertically easily (i.e., by design) but is there a way to display them horizontally as to not take so much room in the report?
Make formulas for the competitors to display a number across, say 6 of them, and set them to pickup their value on the respective detail record line 1,2,3 etc
@Comp1 @Comp2 @Comp3 etc etc
Group by a formula that changes value every 6 records and suppress the detail line and group header.
whileprintingrecords;
global numbervar MyGrouper:= 0;
in page header and
whileprintingrecords;
global numbervar MyGrouper;
if RecordNumber mod 6 =0 then MyGrouper := MyGrouper +1;
MyGrouper
(or is it "mod 6 = 1" ? I always get this backwards)
in detail should work (since it will be suppressed anyway)
In the group footer, add the formulas @Comp1 through 6.
If you are intent on displaying your competitor names in the details section and simply would like to display them in a multiple column format (either down and the across, or across then down) you can simply format the details section for multiple columns by right clicking on the details section (in the gray area on the left) and choosing Format section. In the section expert, make sure the details section is highlighted and toward the bottom of the Common formatting tab should be a check box to 'Format with Multiple Columns'. Check this box and a new tab will pop up allowing you to set your column width, gap between columns, whether you want to print down then across or across then down, etc...
this would probably be a lot easier than using a printtime formulaic method.
Or you could accumulate the names by using formulas like:
//{@accum} to be placed in the detail section of the subreport:
whileprintingrecords;
stringvar names := names + {table.competitor} + ", ";
//{@display} to be placed in the subreport footer:
whileprintingrecords;
stringvar names;
left(names,len(names)-2)
If you are using a CR version below 9.0 the display would have to be less than 255 characters though.
Another approach would be to insert a crosstab using name as the column, no row. Then suppress the column labels and eliminate the grid. Not ideal, but it might meet your needs.
LB,
Thanks for the accumulation formula. It's the cleanest since I had to export the results to Excel. I'd like to thank others for their contributions too.
BPUNC
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.