Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Long string needed, how to beat limit "No more than 256 characters"? 2

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi guys,
There is a limitation for string variables in Crystal Reports, 256 characters. But I need to create formula which should return a string much bigger that this limit. Is there a possibility to do it? Is it possible, for example, to create hidden Text object with this long string and then somehow reference to it in formula? Is there a memo object in Crystal Report?
Thanks.
 
You will have to create a separate string for each 256 chars, and then you can put them into an empty text object (insert - text object) to make them appear as one.

If any of the text is static, it can be put into the text object. Text objects don't have a length limit. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Thanks for response, but I don't need this long string in Text box. I mentioned Text box as a possible storage for a long string. I need to create formula which will be used in Cross-Tab as RowName and which should return a long string. I created text box with this long string, and was asking about possibility to somehow reference to it in formula, or another idea to do it. Thanks.
 
Sorry, there is no way to get into a formula or as the row of a cross-tab. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
I have never done this before but how about this for an idea?

Create a string array...each element can have up to 256 characters. Assign your message to each element of the array in 256 characters of your message.

then in a formula just "Join" the array!...this should produce a continuous string...over 256 limit

Perhaps this will help

Jim
 
Jim,

Up to a point. The problem is that you can't output the array elements as one string. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
yeah I suppose the 254 char rule still applies (not 256)...this was a solution for multi-parameter input display as I recall....

 
I am making an upload file (text) to another system.

I have made a text object of all the fields required, separated by '|', the largest individual field I have is varchar2(240). My total length is well beyond 600 char.
I have reduced the fonts, stretched the object as far as it will go.

I cannot have it truncate or wrap(insert crlf).


 
What version of CR?
Which export format option are you using? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
I have cr 8.5 professional.
I am using text. The receipient is expecting a text file.

Thanks for responding so quickly.

 
Dear Truba,

Since I don't know the formula that you need to produce the long string field, I am making a guess here.

Depending on the ODBC that you use to connect to your database you have several options in SQL Expressions.

I am reporting on a SQL 2000 database using the Microsoft SQL driver and the following saves as a valid SQL expression without errors (enclosing the statement in open and close parens seems to make a difference in success!)

(case when Incident."Open Date & Time" is not null then convert(varchar(10), Incident."Open Date & Time", 101) end)

The above converts a date-time to a date text field.

You won't see any of the options for case when etc in the SQL expression builder - but if you can design your statement in Query Analyzer and get the syntax right - it will work when pasted into the SQL expression editor (kudos to Synapsevampire for pointing me in this direction in the past).

I have succesfully cast fields to 8000 characters and then inserted them into the report.

The SQL Expression component is very, very dependant upon the ODBC driver. Also, don't build the expression there - because as soon as you error - it might not recover. It is persnickety in the extreme.

However, once you get it right - it works like a charm.

So give an example of what you need to get your string, the odbc driver you are using and the database you are reporting on and we can give this a whirl!

ro
Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
If you can upgrade to CR9, the length limit has increased to 64k, and you wont' have a problem any more.

Re the suggestion on "Join" - in Cr8.5 it will fail if the result is more than 254 chars. Editor and Publisher of Crystal Clear
 
I assume that you are creating several formulas, and then appendint them in a text object on your report layout. That is the only way to output a 600 character string in v8.x. Going to v9 solves that part of the problem, but doesn't solve the width of paper problem.

Text format (unlike delimited formats) involve a paper size. You need to configure a printer (doesn't have to exist) that is wide enough to give you room for your 600 characters. I don't think landscape legal will do it, but there are printers out there that handle wider sizes. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Thanks so much for responding.

I think I have solved it by going to the character separated values export. I will keep your suggestion in mind. We do a lot of data exports.

Thanks again. :)
 
Hi kenhamady,

I have a some thing similar kind of problem any tips would be of great help..

Here is my problem..

I would like to know how to use Memo datatype fields in the linked multiple recordsets .

The report's datasource is multiple recordsets logical linked to each other. The report is grouped (but not on the memo field). When the report is generated all the other information is shown as desired other than the data in the memo fields. In case of memo field, only the value in the first record keeps repeating in all the records on the report, where as the record seems to be having the correct data.

If the memo field is changed to string (just to test)it works.

Does Crystal report accept memo fileds in multiple recordsets?

Thanks in advance..
- NK

 
I don't think I have tried passing a Memo as part of a recordset. Does the memo pass correctly in a single recordset?

Actually, I don't think a single Crystal Report can accept multiple recordsets and link them together correctly. When I have tried this the recordset became a cartesian product. I would combine the recordsets into one recordset in your app and pass that recordset to the report (which should be redesigned ot use a single larger recordset).

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top