Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 12th, 2007, 08:36 AM
Authorized User
 
Join Date: Dec 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to pannasn
Default Problem in changing date format

Hi,

i have a CR report with a datetime column in format dd-MM-yyyy.
Now, if the user selects any other format (MM/dd/yyyy) from a dropdown provided, how can it be changed.
i hv tried various ways but in vain.
Every datetimefield property seems to be read-only.

Can anybody help me out in this case.

Thanks in advance,
Panna
 
Old December 14th, 2007, 04:48 PM
Authorized User
 
Join Date: Oct 2006
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try rightclicking on field in design mode and hit format field.
There should by a tab that say date and time.

 
Old December 15th, 2007, 12:26 AM
Authorized User
 
Join Date: Dec 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to pannasn
Default

Hi friend,

i don't wanted to do it in design mode. i wanted to do it at run time so that any user can select any date format from the dropdown provided by me.
Anyway i've found the solution.

First i created a variable 'DateFormat' in settings.settings file of type string under user scope.
Then whatever the date format is selected from the dropdown, i assigned to 'Properties.Settings.Default.DateFormat' which is created above.

Now, in crystal report i created a FormulaField 'CurrentDate' with value "".
In code, where we load the report, i wrote,

myReport.DataDefinition..FormulaFields["CurrentDate"].Text = "ToText(CurrentDateTime,'" + Services.Properties.Settings.Default.DateFormat + "')";

This is working fine now.

But can u give me an idea how to refresh the report page from my code ?


Thanks
Panna





Similar Threads
Thread Thread Starter Forum Replies Last Post
Date format problem abhishekkashyap27 C# 2005 1 June 23rd, 2008 02:25 AM
Date Format Problem cyberddindia Classic ASP Basics 2 October 23rd, 2006 01:49 AM
Changing date format in a file export from excel t jonwitts Excel VBA 2 July 21st, 2005 04:22 AM
Date format problem ERC Crystal Reports 1 June 15th, 2005 04:03 AM
Date format problem widad Classic ASP Basics 1 October 15th, 2004 06:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.