Solved

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

Posted on 2004-08-18
15
624 Views
Last Modified: 2008-01-09
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
Comment
Question by:ns21
  • 4
  • 4
  • 2
  • +2
15 Comments
 
LVL 10

Expert Comment

by:ebolek
ID: 11833575
you can set date setting like this in
file, options, field, dates
then pick the format you want

Regards
Emre

0
 
LVL 10

Expert Comment

by:ebolek
ID: 11833609
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
 
LVL 42

Expert Comment

by:frodoman
ID: 11833796
Could be that Crystal uses the date format on the server regardless of client settings?
0
 
LVL 2

Author Comment

by:ns21
ID: 11833812
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
 
LVL 2

Author Comment

by:ns21
ID: 11833880
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
 
LVL 10

Expert Comment

by:ebolek
ID: 11833917
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 7

Expert Comment

by:natloz
ID: 11834194
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
 
LVL 100

Expert Comment

by:mlmcc
ID: 11834377
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
 
LVL 2

Author Comment

by:ns21
ID: 11838488
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
 
LVL 2

Author Comment

by:ns21
ID: 11838556
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
 
LVL 42

Accepted Solution

by:
frodoman earned 25 total points
ID: 11840566
>>> 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
 
LVL 10

Assisted Solution

by:ebolek
ebolek earned 25 total points
ID: 11841007
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 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

18 Experts available now in Live!

Get 1:1 Help Now