Solved

Change Crystal Reports time format

Posted on 2011-03-23
9
638 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

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

19 Experts available now in Live!

Get 1:1 Help Now