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

Report formatting to be more horizontal 1

Status
Not open for further replies.

GCL2007

IS-IT--Management
Dec 11, 2007
167
US
I'm trying to format a Crystal report so the output does not report in the typical vertical format. I'm trying to report two fields from my table, metal and volume.
Currently it is reported as:
METAL VOLUME
Gold .23
Silver .09
Bronze .08
etc

In an effort to save vertical space on my form, I would prefer to report in a more horizontal manner.

Gold: .23 Silver: .09 Bronze .08 etc..

Any thoughts on how I might do that
 
You could format the detail section to "format with multiple columns". Then go to the layout tab and set the column width and gap--maybe about 2" and .5", and format it to "across then down".

-LB
 
As always, thanks LB....
I'll have to check that out..The data I was working with was in a GH section, and the "format with multiple columns" selection only seems to be in the details section in the version of Crystal I am working with for this project (CR in Visual Studio)
 
Set the detail section to "format with multiple columns" and then in the layout tab, check "format groups with multiple columns". You don't have to have the details displayed. You might have to play around with the field width and gap to force the desired number of columns.

-LB
 
Thanks LB... Looks like your response may work for me...
 
Just had a follow-up question...My report requirements are getting a little more complicated..The "FORMAT WITH MULTIPLE COLUMNS" may work for me, however things have changed a bit...

I can now have multiple values per metal from my above example.
Want it to look something like this
Gold .23 .25 .34 Silver .33 .34 .45 Bronze .21 .11 .04

Can have variable number of metals and variable number of values (likely between 1 and 3)

I got this to work (kind of) by using Format with multiple columns and setting the metal text to "Suppress if Duplicated". so that is working ok. However, I want to force it not to break on a line break - I want the Silver to be on the same line as it's values, hopefully in a column format...
Not sure if I am making any sense, but was wondering if anyone had thoughts?
 
You can still use the multiple columns. You should have inserted a group on metal, so if you haven't, then do that now. Then create three formulas:

//{@reset} to be placed in the group header:
whileprintingrecords;
stringvar x := "";

//{@accum} to be placed in the detail section:
whileprintingrecords;
stringvar x;
x := x + totext({table.value},1)+" ";

//{@display} to be placed in the group footer:
whileprintingrecords;
stringvar x;

Drag the groupname into the group footer, add {@display} next to it. Then suppress the details and the group header, but leave the details section formatted to multiple columns and in the layout tab, make sure that you have checked "format groups with multiple columns". This will neaten up the display so that items are aligned, too.

-LB
 
Many thanks.....
I think this will work for me - think I have one more question... I'm liking this a lot - but is there any way to get the 'columns' of values to line up better... some values may be 2 decimal places, others 5, others text, etc... not really lining up nicely

C 4 5.4 4.4
Gl 3.9 3.5 3
Fe BAL BAL BAL
Ag 6.6 5.5 5

I'm ok with where I am, but is there a way to columnize this a bit?
Thks for everything...

 
Yes, but it now looks like you are not showing more than one metal per "line"?

-LB
 
Also, can you verify that you ARE grouping and placing the formulas in the group footer? The groupnames should be aligned, with only the values perhaps out of alignment because of the decimals or text. Why not at least format to the same decimals consistently?

If you use a non-proportional font, like Courier New, you could change the accum formula the following, assuming that {table.field} is a string that returns values like "3.4" or "BAL":

//{@accum} to be placed in the detail section:
whileprintingrecords;
stringvar x;
stringvar y := "";
if not isnumeric({table.field}) then
y := {table.field} else
y := totext(val({table.field}),1);
x := x + y +space(6-len(y)); //Increase/decrease the 6 to change the spaces between values

-LB
 
Thanks LB and you are correct (and I am an idiot)...
I had somehow turned off the Format Groups with Mult Columns flag.... Now, hopefully am back on track... Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top