Solved

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

Posted on 2004-08-18
15
630 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

 
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
 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Crystal Reports Swap Columns 2 66
C# Crystal Reports 15 97
Printing duplex pages and have a page break 6 50
Crystal Reports - Record selection filter - formula editor 3 18
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…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

820 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