cancel
Showing results for 
Search instead for 
Did you mean: 

Unicode Characters breaking Crystal Report

Former Member
0 Kudos

We have a report, and it works fine UNLESS someone puts in a "funny" character. 

For example, if the user types in 5' 10" in Microsoft Word, then copy and pastes those characters into a database field on our form, instead of normal quotes, the Microsoft Word "smart" quotes are stored in the database. 

When the Crystal Reports tries to render those special characters, the report breaks. 

To add to the complexity, this works fine if my server is Windows 2008R2, and breaks if my server is Windows 2012R2.

Is there a way to fix all my Crystal Reports so they do not break on these special characters?

Is this a font issue, and if it is, what font should I be using, or do I need to install a font on my server.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member183750
Active Contributor
0 Kudos

What version of CR? Please be precise; in the designer look the Help menu -> About.

Are you viewing the report in the designer, web app, infoview, etc.?

- Ludek

Former Member
0 Kudos

We are running Crystal Reports 2013 on a Windows 2012r2 server.

Our application is web based, and I have some ASP.net code which uses the

   CrystalDecisions.CrystalReports.Engine.ReportDocument

object to create a report.

On my older Window 2008r2 server, using an older version of Crystal Reports (2008), the same report, using the same Oracle Database source, the report works fine.

All the viewing of the report is done via web pages using the ASP.net code.

former_member183750
Active Contributor
0 Kudos

Hi Stephen


Are you the developer of the app? Or was it provided by 3rd party?

- Ludek

Former Member
0 Kudos

I am the developer of the APP.  The ASP.net code was originally written by me for Crystal 2008 on a Windows 2008r2 server.  I have since modified it to work on with Crystal Reports 2013 on a Windows 2012 server.  The primary changes were to the web.config file to use reference the newer components, and also to fully qualify the ByteArray definitions to use the fully  Crystal Reports path.

The code is written in VB.net (for running on an IIS  7.0 ASP.net server.

If need be, I could send or post the entire source code.  But will only post if asked, since it will make my reply very long.

former_member183750
Active Contributor
0 Kudos

OK. Crystal Reports 2013 is actually v. 14.1.x.

SAP Crystal Reports, Developer Version for Visual Studio .NET (CRVS) is v. 13.x

I needed to get that straight as Crystal Reports 2013 (v.14.1.x) does not install any SDKs.

Now, I'd like to make sure you are using the latest Service Pack for CRVS which you can find here:

I am a bit concerned by this:


The primary changes were to the web.config file to use reference the newer components, and also to fully qualify the ByteArray definitions to use the fully  Crystal Reports path.

As normally you do not need to modify these manually (assumption). Simply opening the app on a computer that has CRVS should do all the update automatically.

One more idea:

Download Crystal Reports 2013 eval from here:

SME Free Trials | SME Software | SAP

See if the report works there.

- Ludek

Former Member
0 Kudos

The reports work, as long as the data does not contain a special character. 

The character I found which broke my reports is the smart quotes used in Microsoft Word.  The user typed the comment into Word, and then used Copy/Paste to move that comment into the original web form.  When the data on the webform was saved, the special character was saved.

Then when the user runs a report which contains that data record, the special character breaks the Crystal Reports.  All reports are now broken on the website until I reset the IIS Server.

As for changes to the web.config.  The old web.config looked like:

   <add assembly="CrystalDecisions.Web, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.Shared, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.ReportSource, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.Enterprise.Framework, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.Enterprise.Desktop.Report, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.CrystalReports.Engine, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.Enterprise.InfoStore, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.Enterprise.Viewing.ReportSource, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/><add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
   <add assembly="CrystalDecisions.ReportAppServer.CommonObjectModel, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.ReportAppServer.DataDefModel, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.ReportAppServer.ObjectFactory, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.ReportAppServer.ReportDefModel, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.CrystalReports.TemplateEngine, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>

And the new web.config looks like:

   <add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
   <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
   <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
   <add assembly="CrystalDecisions.ReportAppServer.CommonObjectModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
   <add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
   <add assembly="CrystalDecisions.ReportAppServer.ReportDefModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

As you can see, the Web.config is just updated for the newer version.

former_member183750
Active Contributor
0 Kudos

Can you attach a sample report with saved data? (Rename the rpt to txt. Hit "Use advanced editor" and attach.)

- Ludek

Former Member
0 Kudos

I have attached a copy of the report with Data (this data is clean so the report would run.)

FYI -- all data in this report is Test / Demo data and is not real.

former_member183750
Active Contributor
0 Kudos

Hi Stephen

One crucial question that I should have asked earlier; what does it mean when you say the report "breaks"? E.g., in the report you attached, what am I looking for?

- Ludek

Former Member
0 Kudos

When this snippet of code is run, when there is a special character.

    try
          myBytes = rcd.PrintOutputController.Export(CrReportExportFormatEnum.crReportExportFormatPDF)
   catch expdf as exception
   oFileStream.WriteLine("Error in PrintOutputController.Export  myBytes.length=[" & myBytes.Count.ToString  & "]" & vbCrLf & "" & expdf.Message)
   end try

I see the error thrown with this message

Error in PrintOutputController.Export  myBytes.length=[0]

    The system cannot find the path specified.

When all the characters are "normal", then this same code runs fine.

FYI rcd is

     Dim rcd As ISCDReportClientDocument = rd.ReportClientDocument

and

     Dim rd As New CrystalDecisions.CrystalReports.Engine.ReportDocument()

Former Member
0 Kudos

Here is a version of the report (with saved data) with some bad characters  (Look for the database field @hc_location_detailed_URI)

former_member183750
Active Contributor
0 Kudos

Hi Stephen

I've done a fair amount of research on smart quotes and the issue you are seeing appears to be rather ubiquitous when it comes to retrieving the data from databases (not just into CR). From what I have read, most database vendors do not recommend using smart quotes in their databases. I have seen documented issues with Oracle, MS SQL, IBM and other databases.

Would turning off the "smart" quotes be an option?

Change curly quotes to straight quotes and vice versa

- Ludek

Former Member
0 Kudos

Unfortunately I have to allow "smart" quotes.  Our users demand this option.  And it worked with Crystal Reports 2008 on our Windows 2008r2 server.  So removing a feature/option will not sit well with our clients.

former_member183750
Active Contributor
0 Kudos

Stephen, what's the actual database?

Are you running the CR 2013 and CR 2008 on the same computer?

- Ludek

former_member292966
Active Contributor
0 Kudos

Hi Stephen,

I've been following this thread with great interest.  As Ludek mentioned, several databases don't support the Smart Quote characters.  HTML has issues with them as well.

If turning off Smart Quotes in Word is not an option, I was thinking about creating an update or insert trigger in your database that would search for the Smart Quotes and replace them with straight quotes.

This document was for PHP but the logic would be similar for your trigger.

string - How to replace Microsoft-encoded quotes in PHP - Stack Overflow

This article gives a better description of the Smart Quote codes.

Turn off Word&amp;#039;s smart quotes - TechRepublic

Something has definitely changed but I think your previous version worked by chance.  This current version is erring out as expected, based on the documentation I found as well. 

Hope this helps,

Brian