Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date/Time on reports are not as per format in Regional Settings

Status
Not open for further replies.

makjoshi

Programmer
May 30, 2001
27
JP
Hi,
I have an application developed in .Net which runs as a windows Service and a web client application that interacts with this Service.

This web application uses ActiveXViewer (report viewer) for displaying crystal reports.

In our reports, date and time fields are set to ‘System Default Date/time Format’.

The problem is that when a service is run through code (within Visual Studio 2003 .Net) the date and time for the records on the reports are displayed as per the date & time format set in the regional setting.

But when the application is run as standalone service i.e. when registered through installutil.exe and run from "Service", then the records on the viewer does not show date & time format as per Regional Settings.

Your help on this is appreciable.
Thanks in advance.

-Mak
 
If you want a single reliable format, try something like Totext({your.datetime}, "dd/MM/yyyy"). Otherwise you are vulnerable to the settings on particular machines.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hi Madawc,
Thanks for the reply.
I can not give a fix format as "dd/MM/yyyy".I need to show date and time format as per the format set in the regional settings.

My worry is that, when a service is run through code, it picks up the same format as per regional settings, but when registered as a Windows service,and run from "Servcies", somehow it's loosing the format and display "MM/dd/yyyy" (US setting).

I need to know whether it's an issue with .Net framework or Development environment or with ActiveXViewer and it's dependent files.

Kindly suggest me some workaround.
Thanks,
-Mak
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top