Solved

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

Posted on 2001-08-01
9
903 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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 …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

20 Experts available now in Live!

Get 1:1 Help Now