Understanding Cross Tabs in Crystal Reports [Solved]

Understanding Cross Tabs in Crystal Reports

crystal reportsCrystal is a great tool for creating detailed operational reports that are formatted just so. These reports tend to resemble traditional reports built in COBOL or other server languages. The reports look good and are easy for end users to comprehend. For example, below is a simple Crystal report listing invoices totaled by line of business and customer:

 

This is typical of what most people start with – a list of transactions and related data. But while this type of report is great for operational folks who want to see all the detail just so, it’s not so great for analysts. It’s time consuming to build. And sometimes, you just want a quick look at the data as a starting point for analysis. Or you want to group and total different ways, multiple times. This is where Cross Tab shines.

Let’s start with a basic report like the one above. It’s summarized by customer and line of business. So, let’s build a simple Cross Tab report that will show data summarized by customer down the side and line of business across the top.

Start by going to the footer section of the report in design view.

Now go to “Insert-> Cross Tab.”

An orange block will appear which you should position in the report footer.

Your footer should now look something like this:

If you worked with Excel Pivot tables in the 2007 and later versions, the next steps may seem familiar.

Right click on the cross tab you’ve inserted and select “Cross-Tab Expert.” You will come to this screen:

Let’s look at the four key boxes on this form. On the left side, we have fields we can use. This is similar to the listings you see when creating formulas.

On the right side, there are three boxes. The “Columns” box will show what we want to group by in our columns or “across the top.” The “Rows” box will show what we want to group by in our rows or “down the side.” The “Summarized Fields” box will show what value we’re calculating.

In this case, let’s say we want line of business across the top, customer down the side, and summarize by amount.

Let’s start with customer. Highlight “CUSTOMER” under “Report Fields” and click the arrow by the “Rows” box.

Customer will now appear under rows.

Let’s now setup our columns.  Highlight “LOB” (line of business) and click the arrow by the “Columns” box:

And finally, we want to summarize amount. Highlight amount and click the arrow by the summarized field box.

Now, click “OK” to run the report.

Go to the report footer. You’ll see your new cross tab nicely summarized. It’s easy to get totals when you don’t want all the transactional detail.

The real beauty of cross tabs is what happens next. If your users are like our customers, they’ll ask for changes after you deliver the report. For example, they might want to see customer by period for the entire year for a particular line of business. It’s easy enough to add this parameter to the report. If you were to do it with regular Crystal formatting, adjusting all the groups and totals would be time consuming. With Cross Tabs, it just takes a few clicks.

To demonstrate, let’s replace line of business with month on our report. Simply go to “Cross-Tab Expert” and replace line of business with month.

Do this by highlighting “LOB” in the “Columns” box, and click the left facing arrow to remove the value.

Now highlight “MONTH” and click the right facing arrow. You should be here:

Click “OK” and you’ll see your revised report.

While we chose to modify an existing report, you don’t have to. You could create a new Cross Tab report (“New-> Cross-Tab Report”). But often people find it easier to modify an existing one.

Credit: http://reportsyouneed.com/understanding-crystal-cross-tabs-part-1/

How to Create a Combo Chart in Crystal Report [Solved]

How to Create a Combo Chart in Crystal Report

Crystal ReportQuestion: How do you create a chart that has both a Bar chart and a Line chart together in one?

Answer:The easiest way to accomplish this in Crystal Reports is to start with a Bar chart. If you want to incorporate all of the data in your report, I suggest placing the chart in the Report Header or Report Footer. In this Tech Tip, I’ll assume you have the data you want in the report.

Steps: (using the Xtreme Sample Database)

  1. Click on the Insert Chart button and place the chart in the report.
  2. If you have at least one group and one summary for a group, the chart will be automatically built. Otherwise, you’ll be brought directly into the Chart Expert. Either way, open the Chart Expert and select the Data Tab.
  3. With the Advanced Layout selected, the On change of choice will most likely be what you want to group on and will be the x-axis. In this example we are using {Orders.Order Date}.
  4. In the Show values: section place the fields you are summarizing. In this example, we are using a Distinct Count of {Orders.Order ID} and a Sum of {Orders.Amount}.

  1. Next, make sure you have the Side by side bar chart selected on the Type tab. You can also start from a Line chart or Numeric Axis chart.

  1. Go ahead and select OK to close the Chart Expert.
  2. Now, you will want to Preview your chart and work entirely from the Preview tab. This allows Crystal to understand your data and make changes according to those values.
  3. Right-click on the chart and select Chart Options. Go to the Axes tab and select Dual Axes. Show Data2 Axes should also be automatically selected.

  1. If you have more than two colors showing, you will want to make sure that Color by Series is selected on the Legend tab before selecting OK to close Chart Options.
  2. In our example, we will leave the Count as a bar/ riser and change the Sum ($) as the line. Since the Sum is second in our Show value(s) list, let’s select the second bar and then right-click on it in order to select Series Options.

  1. Using the Appearance tab, select Line in the Show Selected Series As: dropdown box.

  1. Go ahead and select OK to close the Series Options.

Now you have your Combo chart. Of course, you will want to pretty it up with titles and formatting of the series. I’ll leave those options up to you. However, I am a big fan of the Auto-Arrange Chart option on the right-click/ context menu. 

Enjoy!

Credit: http://www.infosol.com/crystal-reports-creating-a-combo-control-chart/

How to use While Do Loop in Crystal Reports [Solved]

How to use While Do Loop in Crystal Reports

Crystal ReportThe following example searches for the first occurrence of a digit in an input string. If a digit is found, it returns its position, otherwise it returns -1. In this case, the input string is set explicitly to a string constant, but it could be set equal to a String type database field instead. For example, for the input String, “The 7 Dwarves”, the formula returns 5, which is the position of the digit 7.
Local StringVar inString := "The 7 Dwarves";
Local NumberVar strLen := Length (inString);
Local NumberVar result := -1;
Local NumberVar i := 1;
While i <= strLen And result = -1 Do
(
   Local StringVar c := inString [i];
   If NumericText (c) Then
      result := i;
   i := i + 1;
);
result

Credit: http://pic.dhe.ibm.com/infocenter/rsawshlp/v7r5m0/index.jsp?topic=%2Fcom.businessobjects.integration.eclipse.designer.doc%2Fhtml%2Ftopic501.html

How to Understand Crystal Cross Tabs [Solved]

How to Understand Crystal Cross Tabs

Why Cross Tabs?

Crystal ReportCrystal is a great tool for creating detailed operational reports that are formatted just so. These reports tend to resemble traditional reports built in COBOL or other server languages. The reports look good and are easy for end users to comprehend. For example, below is a simple Crystal report listing invoices totaled by line of business and customer:

This is typical of what most people start with – a list of transactions and related data. But while this type of report is great for operational folks who want to see all the detail just so, it’s not so great for analysts. It’s time consuming to build. And sometimes, you just want a quick look at the data as a starting point for analysis. Or you want to group and total different ways, multiple times. This is where Cross Tab shines.

Let’s start with a basic report like the one above. It’s summarized by customer and line of business. So, let’s build a simple Cross Tab report that will show data summarized by customer down the side and line of business across the top.

Start by going to the footer section of the report in design view.

Now go to “Insert-> Cross Tab.”

An orange block will appear which you should position in the report footer.

Your footer should now look something like this:

If you worked with Excel Pivot tables in the 2007 and later versions, the next steps may seem familiar.

Right click on the cross tab you’ve inserted and select “Cross-Tab Expert.” You will come to this screen:

Let’s look at the four key boxes on this form. On the left side, we have fields we can use. This is similar to the listings you see when creating formulas.

On the right side, there are three boxes. The “Columns” box will show what we want to group by in our columns or “across the top.” The “Rows” box will show what we want to group by in our rows or “down the side.” The “Summarized Fields” box will show what value we’re calculating.

In this case, let’s say we want line of business across the top, customer down the side, and summarize by amount.

Let’s start with customer. Highlight “CUSTOMER” under “Report Fields” and click the arrow by the “Rows” box.

Customer will now appear under rows.

Let’s now setup our columns.  Highlight “LOB” (line of business) and click the arrow by the “Columns” box:

And finally, we want to summarize amount. Highlight amount and click the arrow by the summarized field box.

Now, click “OK” to run the report.

Go to the report footer. You’ll see your new cross tab nicely summarized. It’s easy to get totals when you don’t want all the transactional detail.

The real beauty of cross tabs is what happens next. If your users are like our customers, they’ll ask for changes after you deliver the report. For example, they might want to see customer by period for the entire year for a particular line of business. It’s easy enough to add this parameter to the report. If you were to do it with regular Crystal formatting, adjusting all the groups and totals would be time consuming. With Cross Tabs, it just takes a few clicks.

To demonstrate, let’s replace line of business with month on our report. Simply go to “Cross-Tab Expert” and replace line of business with month.

Do this by highlighting “LOB” in the “Columns” box, and click the left facing arrow to remove the value.

Now highlight “MONTH” and click the right facing arrow. You should be here:

Click “OK” and you’ll see your revised report.

While we chose to modify an existing report, you don’t have to. You could create a new Cross Tab report (“New-> Cross-Tab Report”). But often people find it easier to modify an existing one.

Credit: http://reportsyouneed.com/understanding-crystal-cross-tabs-part-1/

Helpful Crystal Reports Formulas [Solved]

Helpful Crystal Reports Formulas

Crystal ReportNo doubt that if you are reading this article you have something to do with reporting within your organization. As all of Vista HRMS clients know, PDS has standardized with Crystal Reports for development and delivery of reports.

Crystal can be a great tool to do reporting, allowing you the ability to include charts and graphs to help analyze your data. On occasion we find ourselves in need of a report that requires some ‘fancy footwork’ and we need to create formulas within your report to properly display the intended data set.

I am sure, if you are a report writer familiar with Crystal, that you have gotten a request to develop a Crystal report, only to find you need a formula. Formulas can help a great deal in analyzing your data, such as a report that I once wrote to let managers know what day of the week their employees were taking as vacation/sick days, hoping to identify trends. (This is easier then you think!)

PDS has helped to alleviate the need for a great number of the formulas that people commonly request. You will find that we have provided fields that have been formatted into the database views commonly used in reporting. For example:

  • There is no need to create a “Full Name” for your employees; we have a “Name” field for that purpose. Views still contain the separate fields for “First Name”, “Middle Name” and “Last Name” in case you need them.
  • We deliver both soc_sec_no (unformatted) and social_security_no (formatted).
  • You will also find city_state_zip as well as the separate fields.

With that said I would like to present to you a short list of common formulas that I have used over the years. (And a special “thank you” to Chrissy Koennecker for her original article back in 2005 where she shared a similar list.)

Extracting Data from a field:

This formula extracts only the year from a date:
Year (({table.hire_date} )

This formula extracts only the right 4 positions in the field (last 4 of SSN):
Right ({table.soc_sec_no},4)

This formula trims the address line and puts a line feed after the first line of the address:
TrimRight({table.line1}) + chr(10)

Examples of translation formulas:

To spell out a certain code using if-then statements:
if {table.exempt_flag} =’E’ then ‘Exempt’ else
if  {table.exempt_flag} =’N’ then ‘Non Exempt’ else ‘N/A‘

If you want to see the Month name spelled out instead of a number:
MonthName(month({table.hire_date} ))

To Show a Date range parameter in your report, add the following formula:

Totext(minimum({?ParameterDate}) &
” to ” &
Totext(Maximum({?ParameterDate})  )  )

To list an employee’s Length of Service in Months create the following formulas:

Formula1 called Months:
DateDiff(“m”, {emp_basic_all.adj_service_date}, currentdate)

Formula2 called LOS:
Truncate(({@Months}/12), 0)

You can also use formulas within other formulas……

To list an employee’s Age create the following formula:

Year (CurrentDate) – Year ({emp_basic_all.birth_date})

To show the multiple parameter values that were chosen for a report, create the following formula:

Join (@Parameter, chr(13) & chr(10))

* Place this formula in your report header

To show the Day of the Week, create the following formula:

if DayOfWeek({Date field}) = 1 then “Sunday” else
if DayOfWeek({Date field}) =2 then “Monday” else
if DayOfWeek({Date field}) =3  then “Tuesday” else

You get the hang of it! Crystal Reports defaults to Sunday as the 1st day of the week, unless you change it, (which you can do).

Credit: http://www.pdssoftware.com/newsletter/mar10/page4.htm

How to Filter Data in Crystal Reports [Solved]

How to Filter Data in Crystal Reports

Crystal ReportSo far, the reports you have created have returned all the records from your database. Sometimes this is appropriate, but often reports need to filter the data based on specified criteria. This is most relevant when you’re working with large databases in which there can easily be hundreds of thousands of records returned from a query, especially when joins are applied.

As with many features in Crystal Reports, there are multiple ways to filter data:

  • Using the Select Expert—This simple method provides a visual way to specify filtering.
  • Using the Record Selection Formula—This more granular, yet powerful, method involves creating a custom formula language expression to determine the filter criteria.

Regardless of the method used to filter your report, you should always make best efforts to filter on indexed database fields. By filtering on indexed fields, you realize the greatest performance on the database server. You can determine the indexed fields in a table by using the Crystal Reports Links tab on the Database Expert accessible from the Database menu. Use the Index Legend button and dialog provided to understand the different index markers in your database tables.

Working with the Select Expert

The Select Expert is a design tool that enables you, the report designer, to specify basic yet powerful filters for the current report using a graphical design dialog. Figure 3.1 shows the Select Expert dialog. Let’s work through an illustrative example of filtering using the Select Expert. Taking what you have learned so far about creating simple columnar reports, create a new report from the Xtreme Sample Database 10, adding the Customer Name and Last Year’s Sales fields from the Customer table to the details section of the report. Follow these steps to add a filter to this report:

Figure 3.1Figure 3.1 The Select Expert provides access to easy-to-use filtering functionality.

    1. To invoke the Select Expert, click its button found on the Experts toolbar or, alternatively, select the Select Expert option from the Report menu.
    2. The first step in creating a filter is to choose which field the filter should be created on. Accordingly, the Choose Field dialog is displayed. Both fields that are present in the report and fields from the database are listed. A field does not need to be on the report to create a filter using it. At this point, if you forget which values are stored in any of the fields listed, click the Browse button to see a sample list of values. For this example, choose Last Year’s Sales field and click OK. The Select Expert dialog appears, as shown in Figure 3.1.

TIP

Another quick and directed method of accessing the Select Expert is through the right-click menu available on any data field. This method opens the Select Expert directly with the specified field already selected as the filtered field and bypassing the Choose Field dialog.

    1. The Select Expert has a group of tabs—one for each filter defined inside that report. In the case of your sample report, there is only one tab for the Last Year’s Sales field and another called <New>, which is used to define additional filters. By default, the filter setting on the Last Year’s Sales tab is set to Is Any Value. This means that regardless of the value of the Last Year’s Sales field, all records are included in the report. To change the filter in a report, change the value of the drop-down list. For this example, change it to Is Greater Than.
    2. When this option is selected, another drop-down list appears. If the exact value to filter the field on is known, it can be typed into this list box. However, in this case, you might not know exactly what the values of the field are, so you are provided with the capability to browse that field’s values by simply pulling down the drop-down list. Choose $300.00 and click OK.

TIP

Often when modifying filters and selections in the report designer, Crystal Reports displays a message asking the user if she wants to use the saved data in the report or refresh the data from the database. Using the saved data in the report is usually a good option because it does not incur a new query to the database. However, especially when modifying filters, it can cause some confusing results because the set of saved data in the report might or might not consist of all the records in the database; that is, a filter might have already been applied. So when modifying filters, it’s best to refresh the data whenever Crystal Reports asks you.

  1. When returning to the report, you should notice that the report now only displays a single record: the Has Been Bikes company that had sales of $300. A more useful filter would be to show all records that were above or below a threshold. To accomplish this, re-open the Select Expert. This time, change the Is Equal To criteria to Is Greater Than and type 100,000 into the list box. When closing the Select Expert and returning to the report, a small collection of records should be returned. In just a few seconds, you’ve created a report showing your top customers.

Let’s look at a few more types of filters that can be applied to a report. The following steps walk you through applying these various types of filters:

    1. Open the Select Expert again and change the criteria from Is Greater Than to Is Between.
    2. This time, two list boxes are presented, each corresponding to an upper and lower bound. Type in the values 2,000 and 3,000, respectively (as shown in Figure 3.2), and click OK. The report displays all customers with sales between $2,000 and $3,000.

Figure 3.2Figure 3.2 Modify the report to display customers with sales between $2,000 and $3,000.

  1. So far, only the Last Year’s Sales field has been used as a filter. However, any field can be used as a filter, although there are slightly different options for various field types. Go back into the Select Expert and, while on the Last Year’s Sales tab, click the Delete button to remove that filter.
  2. Add a new filter on the Customer Name field by clicking the New button and selecting the Customer Name field from the subsequent dialog.
  3. To have the report only show a single customer’s record, leave the criteria as Is Equal To and choose Alley Cat Cycles from the drop-down list. Applying this filter results in the report only showing a single record.
  4. Return to the Select Expert and change the criteria to Is One Of. This option enables you to choose multiple values. Each time a value is selected from the drop-down list, it is added to the bottom of the list box. Select Alley Cat Cycles, Bikes R Us, and Hikers and Bikers and notice how the report now reflects those three records.
  5. Next, remove the three values previously selected by highlighting them and clicking the Remove button. Now change the criteria to Is Like and type Wheel* into the drop-down list. Click Add or press Enter to add this item to the list. Applying this filter results in the report showing all customers whose names begin with the word Wheel.

NOTE

When using the Is Like option, an * acts as a wildcard for any number of characters, whereas a ? acts as a wildcard for only a single character. This can be quite useful when you’re searching through textual fields for a specific text pattern.

The last thing this chapter covers with respect to the Select Expert is applying multiple filters. To do so, perform the following steps:

  1. Start from scratch and delete any filters you have applied by clicking the Delete button on each tab.
  2. Click the New button and add a new filter using the Last Year’s Sales field.
  3. Change the criteria to Is Less Than and the value to 5,000. This filter would result in showing all customers with sales of less than $5,000, but let’s apply another condition.
  4. Click the New button and add a new filter based on the Country field. Note that this is slightly different from the previous filters that have been created—not only because more than one filter is being applied at the same time, but also because the filter being created is based on a field that is not present on the report.
  5. Change the criteria for the Country filter to Is Equal To and choose Canada from the drop-down list. Clicking OK applies this filter, resulting in a report with multiple conditions: customers from Canada with sales below $5,000. See Figure 3.3 for the output of this report.

Figure 3.3Figure 3.3 A filter is applied to show all Canadian customers with sales less than $5,000.

NOTE

The two filters that were just added to the report are concatenated together by default with a logical AND statement, that is, All Customers with Last Year’s Sales of less than $5,000 AND from Canada. This can be edited in the Formula Editor accessible from the Show Formula button on the Select Expert. This is discussed in the next section.

The Record Selection Formula

Although the Select Expert is quite powerful, there are certain situations where you need to define a filter that is more complex than the Select Expert allows. Fortunately, Crystal Reports has a built-in formula language that enables custom expressions to be defined as a filter. In fact, this is one of the strengths of the Crystal Reports product: being able to use the formula language to attain a high level of control in various aspects of report creation.

Although you might not have realized it, even when you were using the Select Expert, a formula was being generated in the background that defined the filter. To see this in action, open the Select Expert and click the Show Formula button. This expands the Select Expert dialog to reveal the formula being generated. This formula is called the record selection formula. Notice that the formula’s value is as follows:

{Customer.Last Year's Sales} < $5000.00 and
{Customer.Country} = "Canada"

The formula language is covered in more detail in Chapter 11, “Using Record Selections and Alerts for Interactive Reporting,” but the following are the key points to learn right now. In formulas, braces denote a field. For database fields, the table and field name are included and are separated by a period. The rest of the formula is a statement that tests whether the sales value is more than $5,000.

Think of a record selection formula as an expression that evaluates to a true or false result. For each record in the database, Crystal Reports applies the record selection formula, plugging in the current field values in place of the fields in braces. If the result of the statement is True, the record is included in the report. If the result of the statement is False, the record is excluded from the report. Let’s look at an example. The first record in the Customer’s table is that of City Cyclists who had sales of $20,045.27.

For this record, Crystal Reports evaluates the preceding formula, substituting $20,045.27 in place of {Customer.Last Year's Sales}. Because this value is larger than $5,000, this statement is False and the record is not included in the report. To see what other formulas look like, change the filter using the Select Expert to a few different settings and observe how the formula changes.

Working with the Formula Editor

The formula shown at the bottom of the Select Expert is not just for informational purposes: It can be edited in-place. However, a much better editor exists for formulas. It’s called the Formula Editor (shown in Figure 3.4), and it can be invoked by clicking the Formula Editor button in the Select Expert or by selecting the Report menu and choosing Selection Formulas, Record. Although the formula language doesn’t change, the process of creating formulas becomes much simpler because of a focused user interface.

Let’s work through creating a simple record selection formula. This formula attempts to filter out any customers who owe more than $5,000 in tax. Tax owing will be defined as 2% of their sales figure. To implement this, work through the following steps:

    1. To begin, launch the Formula Editor as described previously and delete the existing selection formula.
    2. Next, create an expression that calculates the tax owing. To do this, enter the following expression:
{Customer.Last Year's Sales} * 0.02
    1. The previous expression now represents the tax owing. To complete the expression to filter out all customers who owe less than $5,000 in tax, modify the formula to look like this:
({Customer.Last Year's Sales} * 0.02) > 5000
  1. To complete the formula and apply the filter, click the Close button at the top-left corner of the Formula Editor window, and then click OK to close the Select Expert. Focus returns to the report, and when data is refreshed, only a handful of customers should be listed on the report.

Figure 3.4Figure 3.4 The Formula Editor provides quick access to powerful formula creation capabilities.

Both the formula language and the Formula Editor are topics unto themselves and will be discussed in more detail in Chapter 4, “Understanding and Implementing Formulas,” and Chapter 11, “Using Record Selections and Alerts for Interactive Reporting.”

Credit: http://www.quepublishing.com/articles/article.aspx?p=330330

 

How to use If Expressions using Crystal Reports [Solved]

How to use If Expressions using Crystal Reports

The If expression is one of the most useful control structures. It allows you to evaluate an Crystal Reportexpression if a condition is true and evaluate a different expression otherwise.

Note   When formatting with conditional formulas, always include the Else keyword; otherwise, values that don’t meet the If condition may not retain their original format. To prevent this, use the DefaultAttribute function (If…Else DefaultAttribute).

Example

A company plans to pay a bonus of 4 percent to its employees except for those who work in Sales who will receive 6 percent. The following formula using an If expression would accomplish this:

//If example 1
If {Employee.Dept} = "Sales" Then
   {Employee.Salary} * 0.06
Else
   {Employee.Salary} * 0.04

In this example, if the condition {Employee.Dept} = “Sales” evaluates as true, then the

{Employee.Salary} * 0.06

expression is processed. Otherwise the expression following the Else, namely the

{Employee.Salary} * 0.04

is processed.

Suppose another company wants to give employees a 4% bonus, but with a minimum bonus of $1,000. Notice that the Else clause is not included; it is optional, and not needed in this case.

//If example 2
Local CurrencyVar bonus := {Employee.Salary} * 0.04;
If bonus < 1000 Then
   bonus := 1000;
//The final expression is just the variable 'bonus'.
//This returns the value of the variable and is the
//result of the formula
bonus

Another way of accomplishing example 2 is to use an Else clause:

//If example 3
Local CurrencyVar bonus := {Employee.Salary} * 0.04;
If bonus < 1000 Then
   1000
Else
   bonus

Now suppose that the previous company also wants a maximum bonus of $5,000. You now need to use an Else If clause. The following example has only one Else If clause, but you can add as many as you need.

Note   There is a maximum of one Else clause per If expression.

The Else clause is executed if none of the If or Else If conditions are true.

//If example 4
Local CurrencyVar bonus := {Employee.Salary} * 0.04;
If bonus < 1000 Then
   1000
Else If bonus > 5000 Then
   5000
Else
   bonus;

Example

Suppose that a company wants to compute an estimate of the amount of tax an employee needs to pay and write a suitable message. Income below $8,000 is not taxed, income between $8,000 to $20,000 is taxed at 20%, income between $20,000 to $35,000 is taxed at 29%, and income above $35,000 is taxed at 40%.

//If example 5
Local CurrencyVar tax := 0;
Local CurrencyVar income := {Employee.Salary};
Local StringVar message := "";
If income < 8000 Then
(
   message := "no";
   tax := 0
)
Else If income >= 8000 And income < 20000 Then
(
   message := "lowest";
   tax := (income - 8000)*0.20
)
Else If income >= 20000 And income < 35000 Then
(
   message := "middle";
   tax := (20000 - 8000)*0.20 + (income - 20000)*0.29
)
Else
(
   message := "highest";
   tax := (20000 - 8000)*0.20 + (35000 - 20000)*0.29 +
          (income - 35000)*0.40
);
//Use 2 decimal places and the comma as a
//thousands separator
Local StringVar taxStr := CStr (tax, 2, ",");
"You are in the " & message & " tax bracket. " &
"Your estimated tax is " & taxStr & "."

Note   The use of variables is to simplify the logic of the computation. Also, there are two expressions that are executed when one of the conditions are met; one assigns the tax variable, and the other assigns the message variable. It is often useful to have multiple expressions executed as a result of a condition.

Credit: http://msdn.microsoft.com/en-us/library/ms225356%28v=vs.80%29.aspx

How to Change Database using Crystal Report Design [Solved]

How to Change Database using Crystal Report Design

Let me give you step in detail :

1. Open up your crystal report

2 . Set database  source

3 .Create a new connection

4 . Locate stored procedure or view (whatever you are using ) from database

5 .Select your previous stored procedure and select new stored procedure (having same name is better)at bottom screen(where you create new connection )

6 .Update .

It will take some time  and close that database source window .

You are good now with new connection . Refresh the report .

Crystal Report

How to Change Database using Crystal Report Design

Credit: http://scn.sap.com/thread/1309361

How to Display Data from Queries Using Crystal Reports

How to Display Data from Queries Using Crystal Reports

crystal reportsWith the integration of Crystal Reports, you can use queries as the data sources for Crystal Reports. Crystal Reports supports a formatted display of this data. You can usually display Crystal Reports in the Launchpad (ABAP), which is part of a portal role or in SAP NetWeaver Business Client.

Activities

Use of Delivered Reports

You can use delivered Crystal Reports.

To do so, proceed as follows:

  1. Activate Reports

    Activate corresponding Crystal Reports and the associated queries in BI Content Activation Workbench (transaction BSANLY_BI_ACTIVATION) or in the SAP NetWeaver BW system in Data Warehousing Workbench (transaction RSOR).

  2. Publish Reports

    Publish the reports on SAP BusinessObjects Enterprise Server (BOE).

    Publish the reports in the Content Administration Workbench (transaction /Crystal/RPTADMIN) in the BW system.

Use of Own Reports

You can create your own Crystal Reports based on a query or based on another report.

Credit: http://help.sap.com/saphelp_tm81/helpdata/ru/1b/0c1483fb7d4f7fa6da2357c78dab71/content.htm