Solved

Concatenate the string variable into 1 formula cell ! String greater than 254 characters?

Posted on 2001-08-01
9
907 Views
Last Modified: 2012-05-04

I have 3 formula fields in the sub-report Footer. Each act as a footnote to the entire report. In the report I have declared 3 global variables in the main report.
In the report the variable gets a value assigned and maybe none assigned and that displays as the footnote.

E.g:
Variable decleared in the report header as A, B, C
shared stringVar A;
shared stringvar B;
shared stringvar C;

In the report in formula fields they above variables get some value
A - AAA
B - BBB
C - CCC

Now if in the sub-report footer, if I have separate formula cells referencing each of the above than the report displays them.

I want them to be in 1 formula cell with chr(13) - carriage return between them. How can i do that? I tried
shared stringvar A;
shared stringvar B;
shared stringvar C;

A + chr(13) + B + chr(13) + C;

But the above returns only one value and not all the variable value?

Also, if the string A is more than 254 character than what is the next best thing that I can do? Thanks
0
Comment
Question by:moneyfool
  • 6
  • 3
9 Comments
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6341345
Hi moneyfool

At the point where you want your footer variables concatenated, try something along these lines in a formula:

global stringvar FooterA;
global stringvar FooterB;
global stringvar FooterC;
stringvar RetStr := "";

FooterA := trim(FooterA);
FooterB := trim(FooterB);
FooterC := trim(FooterC);

if len(FooterA) > 0 then
  RetStr := FooterA;

if len(FooterB) > 0 then
  if len(RetStr) > 0 then
    RetStr := RetStr + chr(10) + chr(13);
  RetStr := RetStr + FooterB;

if len(FooterC) > 0 then
  if len(RetStr) > 0 then
    RetStr := RetStr + chr(10) + chr(13);
  RetStr := RetStr + FooterC;

RetStr;

Place the variable field where you want to see the concatenated results and be sure to set the Can Grow check mark for that field.

Where are you bumping against the 254 character limit?

DRRYAN3
0
 

Author Comment

by:moneyfool
ID: 6341709
Thanks again. Yes the code does work. But the FooterA variable is more than 254 characters. so thats the issue. whenever A is present the 254 error appears. When A is not present than it is fine since B and C are way less than 254.

I tried using another variable RetStr2 but does not work real well. any ideas?
0
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6342572
In trying to duplicate your problem with the string longer than 254 characters, I cannot find a way to assign more than 254 before getting an error message.  Is it the case that A is less than 254, but when you add B and C to the end it becomes more than 254?
0
ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 

Author Comment

by:moneyfool
ID: 6344919
A is around 200 characters but than B is around 56 characters and C is around 65 characters. So A by itself should be fine, only when added with B or C crosses 254 character limit.

Only B+C is also fine
0
 
LVL 12

Accepted Solution

by:
DRRYAN3 earned 50 total points
ID: 6345656
moneyfool

You will probably have to use arrays of strings, as described here http://support.crystaldecisions.com/kbase/c2009234.asp?AJID=69762431086A3D4EBDB00A2EBA50995B or make use of bands in the footer section to suppress empty footnotes.

Let me know if either of those approaches works.

DRRYAN3
0
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6368836
moneyfool

Did you have any success with arrays of strings?

DRRYAN3
0
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6393749
moneyfool

Feedback please?
0
 

Author Comment

by:moneyfool
ID: 6393771
thanks ryan

was out for few days. the above link is good but needs lot of work around the code. i am still looking into but hopeful that it will work. when i get the code working shall post out. thanks
0
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6393784
Glad to hear it.  DRRYAN3
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question