I use VS2008 to test Khmer Unicode rendering in Crystal Report.
I. Prepare Crystal Report Render well in report design
First you have to make the crystal report in design time possible to write or view Khmer Unicode
1.1. Copy usp10.dll (version1.465.4001.0) to C:\Program Files\Business Objects\Common\2.8\bin
1.2. Change fonts setting in Crystal Report, at VS2008, create a crystal report and go to Crystal Reports –> Design –> Default Setting –> Go to Fonts Tab, change all element to Kh System
II. View Crystal Report with VS Crystal Report Viewer,
Khmer Unicode is not rendering well.
(Under research)
III. View Crystal Report with Crystal Report View
It’s working very well for me to view Crystal Report with Khmer Unicode characters on form.
Here is the process…
3.1. On design time, add COM control of Crystal Report ActiveX Report Viewer Control of Business Objects; from my pc, it’s a dll at: C:\Program Files\Business Objects\Common\2.8\bin\ crviewer.dll
3.2. Add Reference in the project of craxddrt.dll
3.3. Create Crystal Report and write some code in Khmer Unicode and save it to some where, my example in folder bin/Debug
3.4. Coding to call the report to view in the control:
CRAXDDRT.Application crxApp = new CRAXDDRT.Application(); CRAXDDRT.Report crxReport = new CRAXDDRT.Report(); crxReport = crxApp.OpenReport(Application.StartupPath + "/KhmerUnicodeTest.rpt", null); this.axCrystalActiveXReportViewer1.ReportSource=crxReport; this.axCrystalActiveXReportViewer1.ViewReport();
3.5. Here is the result display
DOWNLOAD: Sample Project: TestCrystalReportViewer
(DLL of USP10.dll attached in the sample folder: Resource)
IV. View Crystal Report by export directly to PDF
It works very well, just have issue with font size.
We just call Crystal Report Object and then export it to disk, here is the coding:
private void btnPrintCrystal_Click(object sender, EventArgs e){ CrystalKhmerUnicode rptCrystal = new CrystalKhmerUnicode(); rptCrystal.SetParameterValue("txtReportTitle","Hello World"); rptCrystal.SetParameterValue("txtTitle", txtTitle.Text); rptCrystal.SetParameterValue("txtArticle", txtArticle.Text); rptCrystal.ExportToDisk(ExportFormatType.PortableDocFormat, "./KhmerUnicode.pdf"); MessageBox.Show("Now report exported to current folder: KhmerUnicode.pdf"); // Direct open pdf reportSystem.Diagnostics.Process.Start("./KhmerUnicode.pdf"); }
Enjoy,
Happy New Year 2009!
Metrey,