Join Robin Hunt for an in-depth discussion in this video Setting defaults for fields, part of Crystal Reports 2013: Experts and Customizing Reports.
- When we start working with CRYSTAL REPORTS, it can be challenging to understand the different sections and how to add fields. However, you may find that you're constantly formatting numbers to look a certain way or date fields to look a certain way. This can be a drag on productivity if literally every report you write, you're constantly changing the formatting of the same types of fields. Working with the default settings can make formatting a little less challenging and then your reports are formatted correctly throughout the writing process. Let's start with a blank report.
I'll use my Tables and for this example, I'll use my Orders. Let's go take a look at Print Preview. I'm gonna drag Order ID into the details section. The default settings for numbers include the Thousands Separator. That means every time I use a number I'll have to remove the Thousand Separator. Which that's great if you need that and terrible if you're constantly right-clicking to format the field.
Order Dates, because of the data source we're using, this includes the date and the time. This is not really relevant for our reports. We can fix that when we go in and adjust the defaults. Let's take a look at the Order Amount. Again, our Order Amount has a currency symbol and the decimal places. Some people do not want the decimal places in their reports. Others want more decimal places than just the standard two. All of this can be controlled in the default settings.
To access the default settings you go to File and Options. Let's navigate to the Fields tab, let's go to the Number. There are additional options on the Common tab, the Border tab, and the Hyperlink tab, but we want to focus on the Number tab. You can select one of these options if it applies, or you can go further in to Customize. We wanna remove the Thousands Separator. We can choose any additional options that we need. Again, it's completely dependent upon your data base and the formats you need.
I'll click OK, I'll choose OK again, and now anytime I use a number field, it will meet the default settings that I set. Let's go take a look at Order Date, or the Date and Time. Again, every time we bring it in, it includes an invalid time stamp that we do not need. We'll go to the Date and Time tab and we'll choose 03/01/1999. Again, whatever your preference may be. You also have the Customize option here as well.
Maybe you want to choose a different separator, maybe you want a different set for your date, or maybe you want to keep the time, you just want to show it in a different format. Like 12 Hour versus 24. We'll click OK and OK again. And then, last but not least, let's go over Currency. We'll navigate to the Number tab. Maybe we want to show a Fixed currency symbol. Let's go to Customize. Maybe we want our Negatives to show with a negative sign.
Let's click OK and OK again and then we'll click OK again and our defaults are set. Notice that it didn't change anything on our existing reports, which is good. But now, when we add these back to the Canvas, they'll meet our new defaults. I'll drag Order ID back to the Canvas. Now notice that it doesn't have the Thousand Separator. I'll bring our Order Date. Now it doesn't include the Time Stamp.
I'll bring in our Order Amount and now it has the Fixed currency symbol versus the Floating currency symbol. It's important to note that even when you change your defaults it does not change the existing field format, only new fields. You can easily see where this can gain productivity if you manually tweak fields after adding them to the Canvas. I encourage you to set your defaults based on what your needs are.
- Working with conditions on the exports
- Setting defaults for fields
- Browsing data
- Building specified groups
- Turning on Top/Bottom N groups
- Grouping by formulas
- Repeating group headers
- Converting text