SAP Knowledge Base Article - Public

1205809 - Multi line text parameter placed in page header of Crystal Reports 11.5.3.417 generates "SQUARE CHARACTERS" when the CR report will be exported to Excel Data only format.

Symptom

When a multi line text object is placed in the page header and then the crystal report is exported to Excel Data only format we find square boxes in the exported excel file.

Cause

This issue is by design. If your OS system is window 2000, Office XP or Office 2003 will show carriage return as one square box. Because in platform before 2000, they can not decently deal the carriage return( \x0d \x0a), they will display chr(10) as a square box.

Resolution

Use the following macro to modify the content of one cell, if you want to apply it to the whole worksheet, you can easily change it.

This macro need to be run in the Excel file.

 

Sub DoVbLFReplace()
   Dim rangeContent As String
   Dim rangeInd As String
   rangeInd = "A1"
   rangeContent = Application.Range(rangeInd).Value
   Application.Range(rangeInd).Value = Application.Substitute(rangeContent, vbCrLf, vbLf)
   Range(rangeInd).WrapText = True
End Sub

Keywords

crystal reports , 8741788 , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To

Product

SAP Crystal Reports 10.0