Skip to Content
author's profile photo Former Member
Former Member

In Crystal Reports how to avoid trimming of leading and following white spaces in text fields coming from web service data source.

Hi, We are using Crystal Reports 2008 (Ver 12.3.x.x). We have a web service which send a multi-line memo to the report to get printed. Each line is bundled in a separate object as there are other information as well in the same object. The line can have leading and following white spaces and they should be printed the same way like follows:

'1. This is a Line without leading spaces'

' 2. This is a Line with leading spaces'

' 3. This is a Line with leading and following spaces '

(Please ignore delimiting apostrophe in above text they are just to mark start and end of sentence)

But when the lines are actually printed they are printed as follows:

'1. This is a Line without leading spaces'

'2. This is a Line with leading spaces'

'3. This is a Line with leading and following spaces'

I read somewhere about 'TrimTrailingSpace' registry key to be set as 'No'. I tried that though I think it does not make sense in my case.

Can some one please answer if crystal report provide any control regarding text trimming to the user.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Dec 11, 2014 at 09:29 AM

    Hi Mohammad,

    Leading spaces bring trimmed is a Product Bug Per SAP Note: 1788082 and there does Not seem to be a workaround for it at the moment.

    The Trailing space issue was fixed in Fix Pack 3.5 and SP4 and higher for CR XI R2. Since you're using CR 2008 SP3, I believe this fix covers this version too (although there can sometimes be regression issues). Along with that, you would also need to create a registry Key as described in SAP Note: 1203739.

    Here's a snippet of the above note:

    1. Open the following key 'HKEY_CURRENT_USER\Software\Business Objects\Suite 11.5\Crystal Reports\DatabaseOptions'.
    2. Create a new string value called TrimTrailingSpace.
    3. Right click on TrimTrailingSpace" and select "modify".
    4. Type "No" in the "Value data" field.

    Since you're using CR 2008, the registry path would be:

    HKEY_CURRENT_USER\Software\Business Objects\Suite 12.0\Crystal Reports\DatabaseOptions


    -Abhilash

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 11, 2014 at 10:50 PM

    Thanks Abhilash. We fixed it by our workaround involving replacing spaces by an special sequence at web service level prior sending the data to Crystal Report. In crystal reports we replaced the special sequence back to spaces using formula. Since report itself was not very complex it didn't affect the performance much.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.