Solved

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

Posted on 2001-08-01
9
904 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Execute a crystal report from vb2010 3 39
VS2010 and Crystal Reports Loading Image at runtime 8 64
Crystal report highlighting 5 28
Crystal Reports Version 7 4 0
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…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now