# Getting started with Report Designer

Use this topic to create and refine a sample report in Report Designer.

You use Pentaho’s sample database in these steps. Sample data is installed by default with Report Designer.

### In this topic

* [About Pentaho Report Designer](#about-pentaho-report-designer)
* [Create a report with Report Designer](#create-a-report-with-report-designer)
* [Design your report](#design-your-report)
* [Refine your report](#refine-your-report)
* [Row banding, data formatting, and alignment](#row-banding-data-formatting-and-alignment)
* [Add a chart to your report](#add-a-chart-to-your-report)
* [Add parameters to your report](#add-parameters-to-your-report)
* [Publish your report](#publish-your-report)

### About Pentaho Report Designer

Pentaho Report Designer is a report creation tool. You can use it standalone or as part of the Pentaho Business Analytics suite.

It helps you build detailed reports from prepared data. You can connect to most data sources.

### Create a report with Report Designer

Perform the steps below to create a report using Report Designer.

1. Start Report Designer. Go to **Start** > **Programs** > **Pentaho Enterprise Edition** > **Design Tools** > **Report Designer**.

   The Report Designer home page appears.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>To change the zoom level, drag the percentage in the upper-left corner. Double-click it to reset to 100%.</p></div>
2. Click **New Report** in the Welcome dialog box.

   The design workspace appears.
3. In the right pane, click the **Data** tab.
4. Right-click **Data Sets** and select **JDBC**.

   You can also click the yellow database icon.
5. Under **Connections**, select **SampleData (Hypersonic)**.
6. Next to **Available Queries**, click the plus sign to add queries.

   ![JDBC Data Source dialog box](/files/WzOkOaNeLtOEcQVs5n8a)

   Query 1 appears under **Available Queries**.
7. Click the edit icon (![Edit](/files/pV0eWN9Co7HdpLZrenR2)).

   The SQL Query Designer window opens.
8. Select **PUBLIC** in the **schema filter** menu. Double-click **ORDERFACT** so the table appears in the workspace.

   ![SQL Query Designer](/files/y2t1vuLb1ipqJT077GeS)
9. In the SQL Query Designer workspace, right-click **ORDERFACT** and select **deselect all**.

   ![Clear all, SQL Query Designer](/files/Dmaqvii6qbNFk1gAfm84)
10. Select the **ORDERNUMBER**, **QUANTITYORDERED**, **PRICEEACH**, and **ORDERDATE** fields.

    ![Orderfact fields](/files/vEvUiOBZ58fYU2ieXt9h)
11. Double-click **PRODUCTS** so the table also appears in the workspace.

    Notice the line joining the **ORDERFACT** and **PRODUCTS** tables.
12. Clear all **PRODUCTS** fields. Then select **PRODUCTNAME** and **PRODUCTLINE**.

    ![Products table](/files/QxKqcDRW5oJh5vO1E2TI)
13. Click the **Syntax** tab to view the SQL statement.

    Notice that **PRODUCTCODE** joins the tables.

    ![Syntax tab](/files/DShbQcw6nT2yObCHtqVm)
14. Click **OK** to return to the JDBC Data Source dialog box.

    The SQL statement appears under **Query**.
15. Click **OK** in the JDBC Data Source dialog box.

    ![Query 1 fields](/files/h8ho9Fy8XPFSjQPQaReW)

    The fields now appear under **Query 1**.

Next: [Design your report](#design-your-report).

### Design your report

This exercise walks you through designing your report layout.

1. Under **View**, select **Element Alignment Hints** and **Snap to Elements**.

   These options help align elements.
2. Under **Query 1**, drag **ORDERNUMBER** into the **Details** band.
3. Add **ORDERDATE**, **PRODUCTNAME**, **QUANTITYORDERED**, and **PRICEEACH** to the **Details** band.

   Do not overlap fields.
4. Resize **PRODUCTNAME** larger. Resize **QUANTITYORDERED** smaller.

   ![Resizing](/files/2rEN2gMXapO9PrRyk2Jd)
5. Click **Preview** (![Preview](/files/zch0ok2X59lVdWmriuFx)).

   ![Report preview](/files/CKeNiGNLF9jKYYmwmuVR)
6. Click **Edit** (![Edit](/files/pV0eWN9Co7HdpLZrenR2)) to return to the workspace.

Next: [Refine your report](#refine-your-report).

### Refine your report

You created a report in the previous exercise. Now add labels, headers, and row banding.

1. Drag a label (![Label](/files/nwI5cc7vYZXiFZGI536Z)) to the **Page Header** band.

   The **Structure** tab updates.

   ![Structure tab](/files/5JueFaLbqOud0xKdS18k)
2. Click inside the label and type `Order Report`.
3. Select the label text. Set the font size to 18. Apply bold.

   ![Font resizing](/files/1KRXmixALdAcAZ7CGAsS)
4. With the label selected, set a font color.

   The page header appears on every page.
5. Create column headers. Click **Details Header** under the **Structure** tab.

   The **Style** and **Attributes** tabs appear.
6. Under **common** in **Attributes**, set **hide-on-canvas** to **False**.

   The **Details Header** band appears.
7. Click the **Select Objects** icon (![Select objects](/files/v5JXQ0P5MioYPMzaDsxp)).
8. Select all column objects in the **Details** pane.

   ![Selected objects](/files/HbpuHacTvw8o8PD4IBRt)
9. Press Ctrl+C to copy. Press Ctrl+V to paste into the **Details Header** pane.
10. Select **Format** > **Morph** > **label**.

    The objects change to labels.
11. Type the header labels: `Order No.`, `Order Date`, `Product Name`, `Quan.`, and `Price Each`.
12. Click **Preview** (![Preview](/files/zch0ok2X59lVdWmriuFx)).

    ![Report example](/files/ufbFKIqk1C4rL60IZ15l)
13. Select **Format** > **Row Banding**.
14. In the Row Banding dialog box, select **Yellow** for **Visible Color**. Click **OK**.
15. Click **Preview**.

    ![Report with row banding](/files/FDyhvbhI6bsVbB9MrJ9T)
16. Select **File** > **Save**. Save to `.../report-designer/samples`. Use `Orders` as the file name.

Next: [Row banding, data formatting, and alignment](#row-banding-data-formatting-and-alignment).

### Row banding, data formatting, and alignment

#### Row banding

Create a row band element to control which fields show banding. You can name the row band element anything.

In this example, the row band element is named **row-band-element**.

![Row Banding dialog box](/files/kFqEiF26Bnv8oFug9BcY)

After you create the element, select the fields to band. In **Attributes**, type `row-band-element` in the **name** field.

![Name field, Attributes](/files/HMv9VH2iLkmioctdqqyP)

#### Data formatting

Report Designer uses default formats for dates and numbers. You can change formats under **Attributes**.

Select a field. Then select a value for **format**.

In this example, **Order Date** uses `MM-dd-yy`.

![Format field, Attributes](/files/fv6buhw0dSBVXMaalNnS)

Preview the report to confirm the results.

![Order Date formatting applied](/files/EXtACipfkpOefPnlBVXC)

{% hint style="info" %}
You can also type a custom format string. Use the JavaScript date and number format syntax.
{% endhint %}

#### Alignment

To align multiple objects, select them first. Then choose an alignment option under **Format**.

To multi-select, press Shift and click each object. You can also use **Select Objects** (![Select Objects](/files/v5JXQ0P5MioYPMzaDsxp)) and drag to select.

![Alignment selection, Format menu](/files/PODB4fEsOlcIBQ7NYtnP)

Next: [Add a chart to your report](#add-a-chart-to-your-report).

### Add a chart to your report

In this exercise, you add a chart to your report.

1. Select **File** > **Open**. Open the report you saved earlier.
2. In the **Palette**, drag a Chart icon (![Chart](/files/uLOyVJBA8ZmKPZ7gdHjC)) into the **Report Footer** band.
3. Resize and center the chart.

   ![Chart resizing handles](/files/PeU3A0RaFuIHjvf7WsfK)
4. Double-click the sample chart.
5. Select the **pie chart** icon.

   Chart properties are listed on the left. Data properties are listed on the right.
6. Under **Title**, set **chart-title** to `Product Pie Chart`.
7. Under **Common** in **Primary DataSource**, set **value-column**. Click the ellipsis to open the Select Field dialog box.
8. Select **QUANTITYORDERED** and click **OK**.
9. Under **Series**, click the ellipsis next to **series-by-field**.

   The Edit Array dialog box opens.
10. Click the **Add** icon (![Add](/files/jw637HRMkjAFjT8zczPB)).
11. Select **PRODUCTLINE** and click **OK**.
12. Click **OK** to close the Edit Chart dialog box.
13. Click **Preview** (![Preview](/files/zch0ok2X59lVdWmriuFx)).
14. Scroll to the last page.

    ![Displayed report](/files/wb3uF2GfPZQtRio251t9)
15. Save your report.

{% hint style="info" %}
To use a bar or line chart, change the chart type. Add **series-by-value** entries for `SALES` and `COST`.
{% endhint %}

Next: [Add parameters to your report](#add-parameters-to-your-report).

### Add parameters to your report

Now make your report interactive by setting parameters. Users get prompted for values when they run the report.

1. In Report Designer, open your Orders report.
2. Select **Data** > **Add Parameter**.

   You can also select **Master Report Parameter** (![Master report parameter](/files/JQoaP13OARy0oBPNSbi0)) under the **Data** tab.

   The Add Parameter dialog box appears.
3. In **Name**, enter `enter_prodline`.
4. In **Label**, enter `Select Line`.
5. For **Display Type**, select **Drop Down**.
6. Under **DataSources**, select **JDBC (SampleData (Hypersonic)**. Click the **Edit** icon (![Edit](/files/pV0eWN9Co7HdpLZrenR2)).

   The JDBC Data Source dialog box appears.
7. Under **Connections**, select **SampleData (Memory)**.
8. Next to **Available Queries**, click **Add** (![Add](/files/jw637HRMkjAFjT8zczPB)).

   Query 2 is added.
9. In **Query Name**, enter `prodlineList`.
10. In **Query**, enter the following SQL:

    ```sql
    SELECT DISTINCT
         "PRODUCTS"."PRODUCTLINE"
    FROM
         "PRODUCTS"
    ```

    You can also build the query in SQL Query Designer.
11. Click **OK** to close the Data Source dialog box.
12. In the Add Parameter dialog box, under **DataSources**, select **prodlineList**.
13. For **Value Type**, select **String**.
14. Optional: Set a default value, such as `Motorcycles`.

    ![Add Parameter dialog box](/files/TXVyIvYSEjKVAI4vNxwz)
15. Click **OK** to close the Add Parameter dialog box.
16. Map the parameter back to Query 1. Under **Data**, double-click **Query 1**.
17. Click the **Edit** icon (![Edit](/files/pV0eWN9Co7HdpLZrenR2)) to open SQL Query Designer. Right-click **PRODUCTLINE** and select **add where condition**.
18. In the condition editor, enter `${enter_prodline}`. Click **OK**.

    ![Condition.edit dialog box](/files/uoYPyrFBYjgFBrb5QFpG)
19. Click **OK** to close SQL Query Designer.
20. Click **OK** to close the Data Source dialog box.
21. Click **Preview**.

    ![Product line menu](/files/0kufjfZKuDXPiL9S0FCd)
22. Save and close the report.

Next: [Publish your report](#publish-your-report).

### Publish your report

Now publish the report to a Pentaho server.

1. In Report Designer, open the report you created.
2. Select **File** > **Publish**.

   You can also select **Publishes the report on a Pentaho server** (![Publish](/files/BFXOTZCkJAcUjBLpd9YC)).
3. In the Login dialog box, confirm the server URL is `http://localhost:8080/pentaho/`.

   ![Login dialog box](/files/ajdvwWnmWLq9Curhq0AQ)
4. Click **OK**.

   The Publish to Server dialog box appears.
5. Enter a report title and description.
6. Under **Location**, save to `...public/Steel Wheels`.
7. Set **Output Type** to **html** and click **OK**.

   A success message appears.
8. Click **Yes** to open the User Console and view the report.

   To view it later, go to `http://localhost:8080/pentaho/`. Then browse to the `Reporting Examples` directory.
9. Log in as `Admin`.

   The default password is `password`.
10. Select a product line parameter value. Keep the default **Output Type**.

Your report is now available to users.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pentaho.com/pdia-try-pdia/getting-started-with-report-designer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
