Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2001-08-01
9
Medium Priority
?
931 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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 150 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

596 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