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!

Section Expert or new formula? 3

Status
Not open for further replies.

dWd123

Programmer
Jan 19, 2011
10
0
0
US
Hi,

I am new to Crystal Report and this forum. Hope I can get this "simple" thing over with your generous help as quick as possible.

I'd like to see displays similar to the following:

Date1 rate1ForDate1 rate2ForDate1 rate3ForDate1
Date2 rate1ForDate2 rate2ForDate2 rate3ForDate2
Date3 rate1ForDate3 rate2ForDate2 rate3ForDate3
Date4 rate1ForDate4 rate2ForDate4 rate3ForDate4

However, the best I can get is like this:

Date1 rate1ForDate1 rate2ForDate1 rate3ForDate1 Date2 rate1ForDate2 rate2ForDate2 rate3ForDate2 Date3 rate1ForDate3 rate2ForDate2 rate3ForDate3 Date4 rate1ForDate4 rate2ForDate4 rate3ForDate4

GroupHeader Date
Detail rate
GroupFooter (empty)

Do I need to create a formula for “new line” after each group? Or, it is just some settings in Section Expert need to be tweaked?

Thank you in advance.

-dWd123
 
You appear to be using multiple column formatting. Are there always three instances of rate per group?

-LB
 
Hi LB,
I saw your name popup in many threads with very helpful suggestions. And here you are again, I really appreciate it, not just for myself, but also others who feel benefited.


To answer your question, the instances of rate are not fixed . It could be none, could be up to 15 per group.

I unchecked "Format with multiple columns" on "Details" section and the result became:

Date1
rate1ForDate1
rate2ForDate1
rate3ForDate1
Date2
rate1ForDate2
rate2ForDate2
rate3ForDate2

Any ideas?




 
Hi,
If the rateXForDateX are all fields in the same record
then you could place those fields in the Group Header and supress the Details section.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
What would you expect to see if there were 15 rates (which wouldn't fit in one row)?

-LB
 
Thank you Turkbear.
They are not same record. I tried to place rateXForDateX in the GH anyway, just for the sake of experiment. The outcome is not what I wanted.
 
Thank you lbass,

Before I mislead you further to how many columns, shall we focus on the original questions, please? What do I need to do to make a line break at the end of group change?

FROM --------
GroupHeader Date
Detail rate
GroupFooter (empty)

Date1 rate1ForDate1 rate2ForDate1 rate3ForDate1 Date2 rate1ForDate2 rate2ForDate2 rate3ForDate2 Date3 rate1ForDate3 rate2ForDate2 rate3ForDate3 Date4 rate1ForDate4 rate2ForDate4 rate3ForDate4

TO --------
Date1 rate1ForDate1 rate2ForDate1 rate3ForDate1
Date2 rate1ForDate2 rate2ForDate2 rate3ForDate2
Date3 rate1ForDate3 rate2ForDate2 rate3ForDate3
Date4 rate1ForDate4 rate2ForDate4 rate3ForDate4

Thanks.
 
You need to answer my question first.

-LB
 
If it has columns morn than a row can fit, it should look something like this:

Date1 rate1ForDate1 rate2ForDate1 rate3ForDate1 rate4ForDate1 rate5ForDate1 rate6ForDate1 rate7ForDate1 rate8ForDate1
[tab][tab][tab]rate9ForDate1 rate10ForDate1
Date2 rate1ForDate2 rate2ForDate2 rate3ForDate2 rate4ForDate2 rate5ForDate2 rate6ForDate2 rate7ForDate2 rate8ForDate2
[tab][tab][tab]rate9ForDate2 rate10ForDate2
Date3 rate1ForDate3 rate2ForDate2 rate3ForDate3 ...
 
There are different ways of doing this, but try this first and see if it meets your needs.

Group on date, and then drag the groupname into the detail section and add the rate field next to it. Suppress the group header. In the section expert, format the detail section to "format with multiple columns". In the layout tab, set the width and gap so that both fields appear in each column. Set it for across and then down. Do NOT check "format groups with multiple columns."

Next select the date field->format field->suppress->x+2 and enter:

not onfirstrecord and
{table.date} = previous({table.date})

-LB
 
Hi,
The only way I know of to get multiple records
horizontally after a group field is to insert a subreport ( based on the same table and linked by DATE and with the 'multiple column ' format set ) into the Group Header section to the right of the Group name ( DATE1, etc)
Supress the detail section and the result should look like you want.

GROUPNAME [subreport fields...]



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thank you LB and Turkbear.

Since the idea from Turkbear is a bit more complicated, I followed the suggestion from LB and it works like a charm.

However, while the results are correctly showing but the display is a bit off:

Date1 rate1ForDate1 rate2ForDate1 rate3ForDate1 rate4ForDate1 rate5ForDate1 rate6ForDate1 rate7ForDate1 rate8ForDate1
(blank row)
Date2 rate1ForDate2 rate2ForDate2 rate3ForDate2 rate4ForDate2 rate5ForDate2 rate6ForDate2 rate7ForDate2 rate8ForDate2 ...
(blank row)
Date3 rate1ForDate3

It seems a blank row underneath the rate, how do I remove it? Also, how do I expand the (shadowed)working area in detail section?

 
I thought you wanted the blank row, but that would be the group footer, so just suppress it. To change the width of each column, increase the width in the layout tab and in design mode, readjust the fields on the left. If you mean you need to make the whole report wider, you just have to adjust the margins and/or change to landscape mode or change to a wider printer driver.

-LB
 
Bingo.

I am glad I came to the right place for my CR question. You guys are awesome. Thank you!!!
 
Hi,
Nice solution LB, as usual...A star for you for showing me a better way.

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top