Print Page | Close Window

Shrink fields

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=14631
Printed Date: 06 Apr 2025 at 3:19pm


Topic: Shrink fields
Posted By: aspfun
Subject: Shrink fields
Date Posted: 10 Oct 2011 at 8:54am
In detail section, I added 5 [Member Address], like [Addresss01], [Address02]...[Address05] from MemberHistory table.

In real data, member has various record. For example, some members have only one address but some members have more than 3 addresses.

I added 5 controls as below:

Address01

Address02

Address03

Address04

Address05

How to shrink detail section based on member's address records so that next section data will close detail section?

For example, if one member only has one address, detail section should only display address01 and the another 4 addresses should be supress and shrink.



Replies:
Posted By: lockwelle
Date Posted: 12 Oct 2011 at 8:09am
create a formula and have that use hard crlf (chrw(13)+chrw(10)) at the end of each viable address line, then display the formula with 'Can Grow' checked.
 
for example
local stringvar adress:="";
if not isnull({table.address1}) then adress:=adress + chrw(13) + chrw(10) +{table.address1};
//repeat for other address lines changing the field name
//display result
mid(adress, 3)  //strip off the initial crlf
 
HTH



Print Page | Close Window