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

Detail section not kept together if field set to Can Grow 1

Status
Not open for further replies.

cheyney

Programmer
Jul 16, 2002
335
CA
Hello,

I am using CR v10. I have a formula field that conditionally concatenates database values together with carriage returns. The resulting string will be between 1 and 3 lines. (If it is important, the records that I am concatenating together are not from different database rows, but all from the same row).

I have this formula dragged into a detail section. It is at the bottom of the detail section, right before the section divider. It is initially formatted to 1 line high, with "Can Grow" set to true (0 max lines i.e. no max lines). The detail section itself is set to Keep Together.

This section does not stay together. If the forumula field grows beyond its initial 1 line, these extra lines will move onto the next page.

It would seem that crystal only considers the design-time height of a detail section when determining whether to move it to the next page to enfore the keep together. It does not seem to function properly when the detail section grows due to a formula element that grows. I have tried setting the evaulation time of the formula to WhileReadingRecords to ensure that the height is "known" during the first pass, but no luck.

Does anyone have a solution for this problem? It would be very much appreciated.

Thanks,
Cheyney
 
Dear Cheyney,

If you right click on the field, format field, common tab, what is the Keep Object Together on the actual field?

Checked or, my bet Unchecked? Make it checked, it will force it to stay together.

regards,

ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
ro,

Thanks for your response. Unfortunately this doesn't work - making the formula field's keep together property true does keep the *formula* together, but it does nothing to keep the *section* together. As said before, the detail section itself is set to keep together.

I've read another post that suggests adding a hidden group around my detail section and setting the group's keep together property to true. Although I think this would work, I have multiple detail sections that must each be kept together on their own, and I do not know any way (besides sub reports, but that is a big change in this scenario) to create this kind of group/detail structure in my report.

eg
(group 1)
(detail 1)
(/group1)
(group 2)
(detail 2)
(/group 2)
etc..

Maybe I am missing something?

Cheyney
 
Try this it worked for me.

1. create an empty text box
2. increase the height to the number of fields high
3. move each field into the text box on a new line
4. set the text box to 'Can Grow'

This will treat the text box as one field an allow the 'Keep together' to work.

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top