Creating a simple estimate report using SAP Crystal Reports®
This topic describes how to use SAP Crystal Reports, specifically, to create a report that prints data for a selected estimate in Sage Estimating. You can adapt these general steps for the report designer you are using.
The following instructions assume that:
- You have a Report Designer role.
- You understand how to use the Crystal Reports Designer.
- You are using Crystal Reports 2013 with Support Pack 2. If you use a different version, the workflow may be different.
Before creating a report design for Sage Estimating, you need to:
-
Create a blank Crystal Report (RPT) file if no other reports exist in Report Manager.
Note: This step is required only if no other reports exist in Report Manager. If you have existing reports, open the Estimating Management Console, select any report, and then skip to step 2(d).
- Start SAP Crystal Reports.
- On the Start Page tab, click Blank report.
- In the Database Expert window that appears, click [Cancel].
- On the main menu, click File > Save.
- In the File name text box, type blank.rpt.
- Navigate to an easy-to-access folder.
- Click [Save].
- Exit the program.
You will select this file in the Report Manager.
-
Generate sample data for the custom reports database.
Use the Estimating Management Console to create sample data for your report designs:
- On the toolbar, click [Report Manager].
- Click New Report > Crystal Report.
-
In the New Report window:
- In the Report box, type a name for the report you want to create.
- From the File Name box, browse to and select an existing report design (.RPT) file.
- If you want to change the order that information appears on the report:
- For the Sequence option, select Custom,.
- Click the browse button beside the option.
In the left-hand pane of the Edit Grouping Hierarchy window that appears, select fields that represent the information you want appear on the report, clicking the right arrow key to include each one in the report sequence.
Use the up and down arrow keys to specify the order that this information will appear on the report:
- Click [OK].
- Select one or more estimates from the grid (lower right-hand pane) to use for sample data, and then click [Generate Data].
-
When prompted to select options for the report working data, click [OK] to accept the default selection.
Report Manager stores the sample data in a custom reports database, where it is available to use when you are designing reports.
- Click [Check In].
-
Identify the EstimateId for a representative estimate to use when designing the report.
When creating a report design in Crystal Reports, you need to identify a single estimate that has the characteristics you want to report on.
Note: When you run an estimate report, Sage Estimating uses the EstimateId of the estimate displayed at run time. However, when designing the report, you need to supply the EstimateId for a specific estimate that you will use to lay out the report elements.
To find the EstimateId values that are available in the custom reports database, query the values using SQL Management Studio:
- Start Microsoft SQL Server Management Studio.
- In the Connect to Server window, connect to the SQL database.
- For Server type, select Database Engine.
- For Server name, select your Sage Estimating server.
- In the Object Explorer:
- Expand the Databases node.
- Expand the *ReportDesign* database.
- Expand the Tables node.
- Right-click the Report.Estimate_v1 line on the table.
Click Select top 1000 rows.
The Results tab displays the estimates available in the custom reports database, including the EstimateIds and the names of the estimates.
- Write down the EstimateId for the estimate that you want to work with when you design the report.
Use the Standard Report Creation Wizard to create an estimate report
All of the following steps and parameters are required to report on a Sage Estimating estimate.
-
Create a report and connect it to the custom reports database.
- Start SAP Crystal Reports.
- Select File > New > Standard Report.
- In the Standard Report Creation Wizard:
- Expand Create New Connection.
- Expand OLE DB (ADO).
- In the OLE DB Provider window:
Select SQL Server Native Client 10.0.
Note: If you are using Microsoft SQL Server 2014, select SQL Server Native Client 11.0.
Click [Next]
- In the OLE DB (ADO) Connection Information window:
In the Server box, enter the SQL Server instance where your custom reports database resides. (It is the same instance where you are storing your Sage Estimating data.)
For example, enter (local)\SAGE_ESTIMATING.
Select the Integrated Security checkbox.
For the Database option, select your custom reports database.
The custom reports database is given a unique ID using the following naming convention:
{ESTIMATE DATABASE NAME}_ReportDesign_{USER ID}
{USER ID} is your network logon name or ID.
Click [Finish].
-
Select the tables you want the report to use.
Tip: For a list of the tables you can link to a report, see Using Data on Reports.
On the Data tab of the Standard Report Creation Wizard:
- Expand the database node you added in step 1.
- Expand the Report schema node.
-
Select the Estimate_v1 table.
Note: You must select Estimate_v1, or you cannot complete step 4.
- Select any additional tables you want to report on (for example, Item_v1).
- Click [Next].
- On the Link tab, click [Next].
-
Select the fields to include in the report.
Tip: You can use the SQL Server Management Studio or the Crystal Reports Designer to view the names of fields in each table. For more information, see Using Data on Reports.
On the Field tab of the Standard Report Creation Wizard:
-
Select fields (columns from the tables)—for example:
- Estimate_v1.Name
- Item_v1.PhaseCode
- Item_v1.ItemCode
- Item_v1.Description
- Item_v1.TakeoffQuantity
- Item_v1.TakeoffUnitName
-
Click [Finish]
You then see the main Crystal Reports window, in preview mode.
-
-
Set up the EstimateId parameter to target a single estimate.
Note: For steps on querying the custom reports database to identify valid EstimateId values, see Before you start.
- In the Field Explorer pane in Crystal Reports:
- Right click Parameter Fields, and then click New.
In the Name field, enter EstimateId.
Note: This field is case-sensitive.
- For the Type option, select Number.
- For the Value Field option, select Estimate_v1.EstimateId.
- Click [OK] to return to the preview.
- With the EstimateId parameter selected, on the Report menu, click Select Expert > Record.
- In the Select Expert — Record window:
- On the Estimate_v1.EstimateId tab, from the first dropdown list, select is equal to.
- In the dropdown list that appears next, select EstimateId.
- Click [OK].
- In the Enter Values window, type the EstimateId for the estimate that you want to use for the report, and then click [OK].
-
On the Report menu, click Refresh Report Data, or press F5.
If you entered a valid EstimateId, Crystal Reports displays preview data.
- In the Field Explorer pane in Crystal Reports:
-
Save the Crystal report.
- On the main menu in Crystal Reports:
Click File.
If the Save Data with Report option is selected, clear it.
Important! This step removes the ID for the estimate you used to create the report. The report can then take on the ID of the current estimate when you run the report in Estimating.
Click Save As.
-
In the Save As window:
- Navigate to an easy-to-find folder.
- Enter the report file name.
- Click [Save]
- On the main menu in Crystal Reports:
After creating the report, add it to Estimating Management Console
When you finish the report design, you need to make the report available to Sage Estimating by adding it to the Report Manager in the Estimating Management Console.
To add a new estimate report to the Report Manager, follow the steps in Adding a report to the Report Manager: