cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

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.