Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Grow only on newline character Post Reply Post New Topic
Author Message
tottgwn
Newbie
Newbie


Joined: 24 Mar 2011
Online Status: Offline
Posts: 1
Quote tottgwn Replybullet Topic: Grow only on newline character
     Posted: 24 Mar 2011 at 7:53am
I am rewriting a report to use arrays instead of subreports as suggested on slides 24 and 25 of this link. However, I'm running into a problem when displaying the arrays. In order to display the array on the report, I add all of the strings (delimited by newline characters) into a text box that has "Can Grow" set to true. This works in most cases except when one of the strings in the array is too long to fit in one line in the text box - here it wraps around and takes up two lines (where I want it to be truncated and only take up one line).

Is there any way to output an array in such a way that each element only takes up one line on the report and is truncated if it doesn't fit the width of the text box?
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 25 Mar 2011 at 2:53am
Sure.

In your formula when you're concatenating strings together to create your really long string for display, you can choose to concat the first y characters rather than the entire string.

ie:

for x := 1 to count(temp_array) do
   new_str := new_str & ' ' & temp_array[x][1 to 10] & chrw(13);

Edited by Keikoku - 25 Mar 2011 at 2:54am
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum