Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 637
  • Last Modified:

Date format changes to MM/dd/yyyy when returned through Web Service

I have a crystal report for VS.net 2003 framework 1.1, developed as a web service that is displaying dates in  system's default short date format (dd/MM/yyyy). When webservice returns the data the report changes the Date format to MM/dd/yyyy instead of systems default (dd/MM/yyyy), set through regional settings. so when i see the reports all the date fields are shown in MM/dd/yyyy format.

I have webservices and clients on the same machine. the database is on SQL Server 2000 which is also on same machine.

I am using Custom Style for all the date fields as I need the format to be the systems default short date as set by the user.
 
In current scenario the Regional Settings of the date format is dd/MM/yyyy. I have also tried culture entries in web.config but the results are same

Does anyone know how to handle this? Thanks in advance.
0
ns21
Asked:
ns21
  • 4
  • 4
  • 2
  • +2
2 Solutions
 
ebolekCommented:
you can set date setting like this in
file, options, field, dates
then pick the format you want

Regards
Emre

0
 
ebolekCommented:
then you will click the date tab. Pick the formay you want. Crsytal will format all the newly created date fields in this format
0
 
frodomanCommented:
Could be that Crystal uses the date format on the server regardless of client settings?
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
ns21Author Commented:
As I said I want the format which is set in the regional settings by the user, I have already mentioned the settings above in the question, If u missed that please re-look. To make it more simple consider this scenario: if client is in canada (dd/mm/yyyy) and weservices are in US (MM/dd/yyyy), the response/report to the client in canada should be in dd/mm/yyyy format but for client in US the reponse/report would be in MM/dd/yyyy format.
 
0
 
ns21Author Commented:
frodoman, but as I mentioned in the Question, I am hosting web services and database on same machine And running the client on the same machine. but the formatting still differs
0
 
ebolekCommented:
check this out
http://support.businessobjects.com/library/kbase/articles/c2006556.asp

By the way We are trying to help you here.What do you mean if u miss please relook. We can miss. If we miss, that can also mean that you didnt explain well
0
 
natlozCommented:
In order to avoid problems...I always explicitly make all date fields in my report to a format that is easily understood by any user from any region...

Eg.

01-Jan-2004
0
 
mlmccCommented:
Good point natloz.

You might want to look at this

http://support.businessobjects.com/library/kbase/articles/c2015327.asp

It implies CE uses the regional setting on the user's machine but otherwise it recommends using a formula to convert dates to formatted text.


mlmcc
0
 
ns21Author Commented:
ebolek thanks for all ur help I appreciate that but seriously speaking the proposed solution should be in context of the question asked.

natloz u r very right, changing the date format to dd-MMM-yy would avoid all sort of problems, I wish i could do that. However the application what I am developing should strictly inherit the culture settings of client irrespective of web server/database server regionals.

mlmcc I had set the registry settings too to dd/mm/yyyy but still the report when returns changes the format to mm/dd/yyyy.
0
 
ns21Author Commented:
ebolek,
For CR version 9, whether the same service is available?  we actually suspected that registry setting could be one of the issue but The registry settings are already being set to dd/mm/yyyy, still the report when returns changes the format to mm/dd/yyyy.
what's the procedure usually u follow to consume a web service report?

mlmcc
I cannot make the dataformat same for all clients.

0
 
frodomanCommented:
>>> I cannot make the dataformat same for all clients.

Then your only option is to send a parameter to the report that specifies the date format and use formulas to convert dates to the format desired.  Basically the same approach that mlmcc gave you the link to above, just modify it to put if...then or case structure so that the format used depends on a parameter field.

frodoman
0
 
ebolekCommented:
to publish the report as web service
1. right click on the rpoject name on the solution explorer
2.click add, add existing items
3.select your project
4.right click on the report sleected from sol. explorer and select publish as web service
5.this add sthe web service to your class
6

To comsume web service
1.right click on project
2. select add web reference
3.click web services on the local machine
4. find the web service you just created
5. click add reference button

put this code
crystalviewer1. reportsource = new localhost.webservice or
crystalviewer1.reportsource = "http://localhost//webservice.asmx"
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 4
  • 4
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now