Solved

Change Crystal Reports time format

Posted on 2011-03-23
9
639 Views
Last Modified: 2012-05-11
I'm using VS 2010 and have the "CR for VS 2010" production release. I do NOT have a full version of CR, just the free one that works inside VS.

I have a report that displays time in 12 hr format. I need to be able to pass it a parameter and have it correspondingly give 12 or 24 hr format. Is there a way to do this?
0
Comment
Question by:BlearyEye
  • 5
  • 4
9 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 35202794
Are you trying to pass just the time or a full datetime

mlmcc
0
 
LVL 1

Author Comment

by:BlearyEye
ID: 35202841
I'm not passing the time; I'm passing a parameter to control how time will be displayed.

The database variables involved are all full datetime.
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 35202938
You could pass a parameter with values 12 or 24

You can then display the time through a formula

After you put the datetime field on the report
Right click it
Click FORMAT FIELD
Click CUSTOMIZE
Click the TIME tab
Click the formula button to the right of 12 or 24 hour
Enter this

If {?Parameter} = 12 then
    crTwelveHour
Else
    crTwentyFourHour

mlmcc
0
 
LVL 1

Author Comment

by:BlearyEye
ID: 35203193
I did a search for crTwelveHour and crTwentyFourHour wrt Crystal Reports but did not find anything relevant. Can you give me a pointer?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 100

Expert Comment

by:mlmcc
ID: 35203277
What do you mean?

They are values for an Enumerated type.

mlmcc
0
 
LVL 1

Author Comment

by:BlearyEye
ID: 35203354
Hmmm ... that's new to me. I'll give it a try tomorrow.
0
 
LVL 1

Author Comment

by:BlearyEye
ID: 35203388
btw, crTwelveHour and crTwentyFourHour are formats for I-net Crystal Clear (aka Inet Clear Reports; https://www.inetsoftware.de/reporting/feature/timeproperties.pdf). Are you sure you weren't thinking about this rather than Crystal Reports?

Anyway,will give it a run tomorrow.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 35203397
No.  I copied them from the Crystal format formula screen

mlmcc
0
 
LVL 1

Author Comment

by:BlearyEye
ID: 35215091
I managed to get suitable test environment set up, and your suggestion works well. Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Search by two fields at the same time using c# radio button 5 39
Visual Studio 2013 debugging 2 35
DateTimepicker 4 33
how to read json value 2 30
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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

22 Experts available now in Live!

Get 1:1 Help Now