tech_question
asked on
how to change date and time format during runtime according to the country ?
how can I change the date and time format during runtime in crystal using Crystal API? eg: 01/10/2008 in US and 10/01/2008 in UK. Is there a way with the local OS date time settings we can set this value during runtime ?
Crystal by default uses the local or system default setting. Are you formatting the field?
mlmcc
mlmcc
ASKER
actually during runtime if I do the below code, it works great. Now: I am stuck with one more problem though with regards to special fields. Can we replace the word "Page" in the PageNofM special field during runtime. As I see crystal API , I cannot set any text for this field? if I change the language setting for the OS, will the text "Page" change according to the specification? One more option is just use the number and put a text object and change this during runtime, but we do not want to change these reports manually.
var crDayMonthYear = 1;
reportObject.DateOrder = crDayMonthYear; it works great
var crDayMonthYear = 1;
reportObject.DateOrder = crDayMonthYear; it works great
As far as I know you can't change the field.
You could create your own field in a formula using the PageNumber and TotalPageCount special fields.
mlmcc
You could create your own field in a formula using the PageNumber and TotalPageCount special fields.
mlmcc
ASKER
to do this programatically - the only alternative is to supress it, then use the PageNumber object and throw in a text field "Page" before it or use a formula field. I do not understand why would Crystal not support this - what if we install Crystal XI in native language - eg: in spanish - will we still have this problem during run time?
I don't know if the word page will change to the appropriate language. I don't see why not.
mlmcc
mlmcc
ASKER
OK I need one more clarification. When I got back data in Chinese and opened the report, the data was all square brackets in crystal, I did some research and installed Arial Unicode MS font and then reloaded the report and it works great. Question is - is Arial Unicode MS a universal unicode font or each font has Unicode Font that we have to install. eg: if the report text field is using Tahoma font, do we need to install the corresponding Unicode Font ? What is the best practise here so that we need not touch the report for each country deployment ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok I did use Arial UNICODE MS and it works beautiful but I am trying to set this during runtime by accessing cssClass property. I named a cssClass that I have in the stylesheet but I cannot see the change. I tried to do in the report, right clicked the text object, format text, common , css CLass Name and put the class name here. I cannot see the change either. Does this work in Crystal XI ? or what am I missing here ?
I have not used style sheets so I don't know if it works or not. It is supposed to.
mlmcc
mlmcc
http://www.computing.net/answers/programming/vb6-date-format/12131.html