Solved

how to change date and time format during runtime according to the country ?

Posted on 2008-06-22
10
937 Views
Last Modified: 2008-07-17
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 ?
0
Comment
Question by:tech_question
  • 5
  • 4
10 Comments
 
LVL 6

Expert Comment

by:psychic_zero
ID: 21843727
If you're looking solution in VB, here might be help a bit

http://www.computing.net/answers/programming/vb6-date-format/12131.html
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 21847728
Crystal by default uses the local or system default setting.  Are you formatting the field?

mlmcc
0
 

Author Comment

by:tech_question
ID: 21858006
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
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 21858202
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
0
 

Author Comment

by:tech_question
ID: 21861539
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?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 100

Expert Comment

by:mlmcc
ID: 21861790
I don't know if the word page will change to the appropriate language.  I don't see why not.

mlmcc
0
 

Author Comment

by:tech_question
ID: 21900272
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 ?
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 21900837
To display UNICODE characters you will need to load a unicode font.  I am not sure if all fonts have a unicode version or not.

mlmcc
0
 

Author Comment

by:tech_question
ID: 21917120
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 ?  
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 21919787
I have not used style sheets so I don't know if it works or not.  It is supposed to.

mlmcc
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now