cancel
Showing results for 
Search instead for 
Did you mean: 

How to resolve empty boxes problem for export if characters are japanese?

Former Member
0 Kudos

In our project, we are using Vs.net2008 and CrystalReport2008 component to develop reporting func. The datasource is using Pull Mode. It's Access 2003 (support unicode).

The problem here is that while exporting data contains Japanese characters to PDF/XLS/Doc, they are all displayed as empty boxes. After some search thru internet, it seems CR only support Unicode on some special Font. So we tried to set the font to ""MS UI Gothic" dynamically in .Net code, that indeeds solve the empty boxes problem. But our customers are unsatisified about that change because it makes the report looks ugly. (font is inconsistent).

Is there a better way to handle this?

The code I used is as follows:

private static void SetReportObjectFont(ReportDocument rd)

{

// modify field font to "MS UI Gothic" to solve problems of only show the empty boxes instead of japanese characters while exporting

foreach (ReportObject obj in rd.ReportDefinition.ReportObjects)

{

FieldObject field = obj as FieldObject;

if (field != null)

{

if (field.DataSource != null)

{

if (field.DataSource.ValueType == FieldValueType.PersistentMemoField || field.DataSource.ValueType == FieldValueType.StringField)

{

if (field.Font != null)

{

System.Drawing.Font ft = new System.Drawing.Font("MS UI Gothic", field.Font.Size, field.Font.Style, field.Font.Unit, field.Font.GdiCharSet, field.Font.GdiVerticalFont);

try

{

field.ApplyFont(ft);

}

catch { }

}

}

}

}

}

}

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Mark,

You can use any unicode compliant font that will work with Crystal - like Arial Unicode MS. Test it to make sure it works, and then format the whole report to use this font for consistency.

Sincerely,

Dan Kelleher

0 Kudos

Also so your app has access to all fonts go into Control Panel, double click on Regional and Language settings and check on the option in the Language Tab - Install files for complex scipts.... Then under the Advanced Tab check on the option Default User Account settings. This way all users and applcications have full access to all fonts.

Answers (0)