Add a Smiley Face Rating Icon to a Report

Add a Smiley Face Rating Icon to a Report

2 August 2010, 3:40 pm

You can easily add a rating icon, such as smiley faces to communicate at a glance in a variety of ways. Building on the checkbox article posted earlier, we’ll look at how to use Wingdings to quickly add a rating icon based on a character:

  1. Create a new formula, with an appropriate name (for example, RatingIcon) that defines what character code to show, depending on the value of the field. In our example, we want a smiley face if the value is above 90%, a neutral face if the value is above 80% but less than 90%, and a frowning face if the value is 80% or lower.
    if {@Percentage}>90 then chr(74) else if {@Percentage}>80 then chr(75) else chr(76) Continue reading ‘Add a Smiley Face Rating Icon to a Report’ »
Filed under Format.
Comment

Add a Watermark to a Report

29 July 2010, 3:46 pm

A Watermark is a background image or text block that appears on a page. In our example we’ll be adding a faint DRAFT statement that appears on all pages. (To make our example show up on the screenshots, I’ve made the DRAFT much darker than I would really use.)

  1. Open the Report and select the Design Tab.
  2. Right-click the Page Header section and select Insert Section Below from the pop up menu.
    There will now be two Page Headers, PHa and PHb.
    add header
  3. Insert the graphic or add the text block to Page Header b (PHb).
  4. Position the graphic how you like:
    • To position it vertically, you will need to resize the header area and move the item down.
    • To make it repeat, insert or copy and paste the item repeatedly.

       graphicplaced

  5. Right-click the Page Header b section name and select Section Expert from the pop up menu.
  6. In the Section Expert, make sure Page Header b is selected, then check Underlay Following Sections.
    underlay
  7. Close the Section Expert.

    If you want the watermark to appear behind the page header (Page Header a), drag the position of Page Header b so that it appears before Page Header a.

Here’s the final report:

samplereport2

Filed under Uncategorized.
Comment

Shade Alternate Lines in a Report

26 July 2010, 2:45 pm

 
 

Tabular data can be tough to read; I frequently want my reports to have alternate lines shaded to make the data easier to follow.

 
 

Shading Alternate Details Lines

  1. Right-click the Details section name.
  2. Select Section Expert.
  3. Click the color tab and click the Conditional Formatting button.


  4. To shade every other line, enter the formula

    If RecordNumber Mod 2 = 0 Then crSilver else crNoColor

    To shade every two lines, enter the formula

    If RecordNumber Mod 4 in 1 to 2 Then crSilver else crNoColor

  5. Click OK twice, and preview your report.


     
     

Filed under Format.
Comment

How to Format a Percentage

24 July 2010, 10:00 am

I was a little confused when I created my first report–I wanted to show a calculation as a percentage, which doesn’t appear to be an option. However, here is a work around that works for me.

  1. Create the formula. In my example, I want to show the Actual Sales as a percentage of the Target Sales so my formula is

    ({Sheet1_.Sales}/{Sheet1_.Target})*100

  2. Place the field on your report.

  3. Right-click the field, select Format Field, and select the Number tab.
  4. Check the Display Currency Symbol option.

  5. Click Customize. You see the Custom Style Dialog.

  6. Set your number options, then click the Currency Symbol Tab.
  7. Change the Currency Symbol to %, and change the position to display the symbol after the number.

  8. Click OK, then OK and preview your field.

     
     

Filed under Format. Tagged 
Comment

Using a Parameter to Select What to Group On

19 July 2010, 3:06 pm

Making reports more flexible means having less to update/revise/manage. For example, lets say you need to create a report showing all incidents by subject, by who the ticket was assigned to, and by client. You could create three different reports. But then if the company logo changes, or something else changes, you will need to update three reports. Instead, you can create a single report that uses a parameter which allows the user to select how they want to see the data grouped.

Create The Basic Report

Start by creating the basic report, linking the tables, and selecting the data you want to view. (In this example, we’re searching the Incidents table, selecting all tickets that are closed between two date parameters, FDate and FTDate). Don’t set up the groups, yet, but you can start arranging the data you want to see.

Create Your Parameter

First you will create a parameter that will let users select how they want the report organized.

  1. On the field explorer pane, right click Parameter and select New from the pop-up menu.
    newparameter
  2. You see the Create Parameter Field dialog. 
    parameter1
  3. Enter the Name (for example, Grouper) and provide some Prompting text.
  4. Set the value type to String.
  5. Do not check Allow multiple values.
  6. Click Default Values…
  7. You see the Set Default Values dialog.
    Parameter2
  8. Enter the options you want to use to organize the report. (If you want you can select each option and click Set Description to provide more information on the option.)
  9. Click OK twice to return to your report.

Create a Grouping Variable

You now have a way for the user to select what to use when grouping the report; you next need to create a variable that contains different fields depending on the user’s choice. This will be used to create the grouping.

  1. On the Explorer Pane, right-click on Formula Fields and select New from the pop-up menu.
    new formula
  2. Name your variable GH Select.
  3. Enter the following formula into GH Select:
    stringvar array group := ({?Grouper});
    select group[1]
    case 'Assigned To' : if isnull({Incident.AssignedTo}) then 'Not Assigned' else {Incident.AssignedTo}
    case 'Client' : if isnull({Incident.Client}) then 'No Client' else {Incident.Client}
    case 'Subject' : if isnull({Incident.Subject}) then 'No Subject' else {Incident.Subject}
  4. Replace the case options with your default values (in blue), and the field names with the correct field to group on (in green).

Group Your Report

Now, you just need to add the grouping to your report.

  1. Select Report|Group Expert.
  2. Select the variable you created above, GH Select, to group on.
  3. Click OK.
  4. Select an option to group by, and preview your report.
Filed under Group, Parameter.
Comment

Add a Conditional Graphic

23 June 2010, 3:42 am

You can use this approach to make a different graphic appear, depending on a value or condition. In our example, we’re looking at a report of presidents and will show a party graphic if they are democrats or republicans.

  1. Open the report and add all the graphics you will be using.
    insert images
  2. Right-click on the first graphic and select Format Graphic from the pop up menu.
    format graphic
  3. On the Format Editor dialog, make sure you are on the Common tab. 
    format editor
  4. Click the Conditional Formula button next to the Suppress check box.
  5. Enter the formula to determine when to hide the graphic. In our case, since this graphic is the Republican Elephant, we want to suppress the image anytime the Party<>”Republican”:
    {Sheet1_.Party}<>"Republican"
  6. Click Save and Close to save the formula and close the Format Editor.
  7. Repeat steps 2-6 for each graphic. In our case that means applying the following formula to the Democratic Donkey:
    {Sheet1_.Party}<>"Democrat"
  8. Now, select both the graphics and use the align command to stack the graphics in the location on the report where you want them to appear.
  9. Here’s the result:

samplereport

Filed under Format. Tagged 
Comment

Use Array Parameters in Titles

23 June 2010, 3:20 am

I like to include details in my report titles that explain just what is shown in the report; this usually means that I create a formula for the title that includes the Parameters. Here are some tips on including array parameters attractively.

Create a Title Formula

The first step is to create a new formula, I usually call mine ReportTitle. I then define it as a text string incorporating any parameters I want to show. For example:

'Linked Work Orders, Child Changes, and Incidents for Change number(s):' & {@parameter}

Format a Number Array Parameter in Titles

Adding a parameter containing an array of number variables to a title is simple. By default the parameter will show as a list of numbers separated by commas. So to show the list of record numbers selected by the user you would enter:

'Linked Work Orders, Child Changes, and Incidents for Change number(s):' & {@NumbersSelected}

The result would show as: Linked Work Orders, Child Changes, and Incidents for Change number(s) : 900243, 900245

Format a String Array Parameter in Titles

To make an array of string variables (for example, a list of states) to appear in a title as a list separated by commas, you need to use the Join function. The Join function takes uses the following syntax:

Join (list[, delimiter])

List

The String array you want joined.

Delimiter

Optional. The String you want to use to separate the individual elements in your array. If you don’t specify a Delimiter, a space is used.

So, to concatenate your parameter of the desired states, separated by a comma and a space, you would use

Join ({?States}, ', ')

If {?States} includes Alabama, Michigan, and Texas, you would see:

Alabama, Michigan, Texas

To concatenate your parameter of the desired states, with no separator, you would use

Join ({?States}, '')

Regards :
Vikram Singh Rana
Computer Science Engineer
9983384690

Comments

Popular posts from this blog

Generate a Report using Crystal Reports in Visual Studio 2010

SQL Server Database is enabled for Database Mirroring, but the database lacks quorum, and cannot be opened – Error 955

40 Cool Kitchen Gadgets For Food Lovers. I’d Love To Have #14!