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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling Stored procedure from crystal reports truncates strings to 255

Status
Not open for further replies.

redss

Programmer
Oct 20, 2002
195
0
0
I have a crystal report (using seagate info designer 7.0.2.200) that simply displays the results of a stored procedure (from SQL Server 2000).

Problem: a long text string (varchar) that the stored procedure sends, gets truncated to 255 characters in my crystal report.

Is there a way to get crystal to display more than 255 characters of a varchar string?
 
I think the 255 limit is a feature of Crystal, only extended in Crystal 9

Madawc Williams
East Anglia, Great Britain
 
254 is a limit for Crystal formula output, and you also can't use fields over 254 for sorting, grouping or selecting records.

A varchar exceeding 254 which is placed in the details should display just fine.

As Madawc stated, this was not corrected until CR 9.

-k
 
You can display more than 255 characters by splitting the field in the SQL Procedure and returning 255 character "chunks".

e.g. SELECT Table.Longstring FROM Table

could be coded as:

SELECT

decode(truncate(length(Table.Longstring)/255)-10,-1,'',
substr(Table.Longstring,2550,255)) S10,

decode(truncate(length(Table.Longstring)/255)-9,-1,'',
substr(Table.Longstring,2295,255)) S9,

decode(truncate(length(Table.Longstring)/255)-8,-1,'',
substr(Table.Longstring,2040,255)) S8 ...

FROM

Table


I hate to think how slow this would be, but it would achieve the required result.
 
I think what you mean is to parse it in SQL code, which shouldn't cause horrible performance.

A SQL Expression works for this.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top