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
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 report
System.Diagnostics.Process.Start("./KhmerUnicode.pdf");
}
Enjoy,
Happy New Year 2009!
Metrey,
hi thanks your post that give knowledge. but but problem when create this project as package that it have error
ReplyDeleteHi Ing,
ReplyDeleteWhat errors you have? Can you describe it so that I can try to help? It can be different VS version usage etc.
Well done Metrey!
ReplyDeleteIt works perfectly.
Thanks a lot for sharing.
It run properly, Thanks for your posting but could you tell me how to set parameter value to report and bound it from dataset.
ReplyDeletethanks in advance
Savada Sin (savadasin@gmail.com)
This comment has been removed by the author.
ReplyDeleteHi
ReplyDeletethank for your pasting this problem ,put when I package it and running it on another machine
thate alert the message box System.Runtime.InteropServices.COMException (0x80040154) how can I solve this problem
thank in advance
mala(tml.developer@gmail.com)
Hey! I successfully use what u told. But then I have another problem. When the report is loaded, it appears to ask for refresh/change the sever name! (we use in different computer).Thanks for help.
ReplyDeleteHi! Thank for your posting. but i still got problem with when i change crystal report location at run time. may u give some advise ? (sokheng.siv@gmail.com)
ReplyDeleteHow about in Microsoft Report (the one in VS)?
ReplyDeleteAt runtime it won't render Khmer Unicode correctly.
Any one know how to fix this?
@Prasart: Microsoft Report not yet support unicode; hope we can find a solution
ReplyDeletehow to change several databases for one crystal report at runtime in C# coding
ReplyDeleteHi! Bong Metrey.
ReplyDeletei have problem with Khmer Unicode with Crystal Report. i had done successul with ur forum with it.it can render and preview successful, but one more problem is that: when i try connect data from sql 2005 and drag field in crystal report, when render project it always alert me to input password of user sa in sql 2005 unless i had input it when connect to sql 2005 already.
so,the problem is should not show to input password again when render crystal report.
thx in advance.
Hello . i m nt able to download this project..
ReplyDeleteHi,
ReplyDeleteThere is CRAXDDRT in VS 2008, but I develop with VS 2010. what can I do?
Hi, thank for your post. It works well for me when I follow you but I have got other problem. The problem is that in the report, it doesn't have tool to export data to other application like word or excel.
ReplyDeleteCould you show me how to make it work? Thank you in advance.
Your article is using CRAXDDRT.dll and CRViewer.dll which is not the pure .net framework. It is an ActiveX that we used to deal with in VB 6. What about if we need a pure .net application? How can we render Khmer unicode?
ReplyDeleteThanks,
thank it good for me.
ReplyDeletehow about Ms report viewer in VS 2008 ? can any 1 know how to fix khmer unicode with it te ?
ReplyDeleteyou can't use report of vb.net you must use crystal report with business object.any problem please go to(setha.info)
DeleteI have problem for display my crystal reports in VS2008 it doesn't display well if I use align justify.Can you help please?(visothchhim@gmail.com)
ReplyDeleteis any one help me I want to access Anu Script Telugu words into crystal report
ReplyDeleteI have a problem, I have stored telugu words in Access Database,typed with anu script manager, when I try to access in crystal report, it is showing junk values.
ReplyDeletelink dead , please reupload
ReplyDeletepublic CRAXDDRT.Application crxApp = null;
ReplyDeletepublic CRAXDDRT.Report crxReport = null;
crxApp = new CRAXDDRT.Application();
crxReport = new CRAXDDRT.Report();
crxReport = crxApp.OpenReport(_retportPathAndName);
crxReport.DiscardSavedData();
crxReport.Database.Tables[1].SetLogOnInfo(".", "DBLibrary", "sa",
"123456");
crxReport.Database.SetDataSource(dt,null); this.axCrystalActiveXReportViewer1.ReportSource = crxReport;
this.axCrystalActiveXReportViewer1.ViewReport();
////////////////////////////////////////
my code above it working to show khmer unicode in crystal reports
for i open first time but for second time it has error at
"crxReport.Database.SetDataSource(dt,null);"
i don't know why it was generated error like this.
Error Message " Attempt to read or write Protected Memory This is often an indicating that other memory is corrupt"
please help me.i can not solve this problem.
best regards
Dear all, I no longer maintenance this blog this topic is now move to blog: http://osify.com/2008/12/khmer-unicode-with-crystal-report-in-c-application/#.Ug8PrH8iyR4
ReplyDeleteAny specific question, you can ask me at: http://ask.osify.com/