# Rendering from the frontend

<div style="text-align: justify;">

Every report configuration in VeloxFactory has a built-in **Generate PDF** function — a dedicated page that lets you render the report directly from the browser, without writing a single line of code or touching the API. It is the fastest way to produce a PDF, test a configuration, or trigger a print job on demand.

[![report-config.index.generate-pdf.png](https://docs.veloxfactory.kiwi-software.dev/uploads/images/gallery/2026-05/scaled-1680-/report-config-index-generate-pdf.png)](https://docs.veloxfactory.kiwi-software.dev/uploads/images/gallery/2026-05/report-config-index-generate-pdf.png)

[![generate-pdf.create.png](https://docs.veloxfactory.kiwi-software.dev/uploads/images/gallery/2026-05/scaled-1680-/generate-pdf-create.png)](https://docs.veloxfactory.kiwi-software.dev/uploads/images/gallery/2026-05/generate-pdf-create.png)

---

<h3 id="opening" style="color: #203671; margin-top: 2.2em;">Opening the Generate PDF Page</h3>

There are two ways to reach the Generate PDF page. From the report configuration list, each report card has a dedicated **Generate PDF** button — clicking it takes you directly to the render page without having to open the report first. Alternatively, open any report configuration and navigate to **Generate PDF** from within the report view.

The page shows two read-only fields at the top — the report name and the active data adapter — so you always know at a glance which report you are working with and where its data comes from.

The data adapter field displays either the name of the assigned `ReportConnectionConfig` (including driver and database) or **dyn. Array** if no SQL connection is configured. This directly influences what input sections appear further down the page.

---

<h3 id="parameters" style="color: #203671; margin-top: 2.2em;">Report Parameters</h3>

If the report defines parameters, a parameter input table is shown. Each parameter gets its own typed input field — the input type is derived automatically from the Java class declared in the `.jrxml`:

- A `java.lang.String` parameter becomes a text field.
- A `java.sql.Date` parameter becomes a date picker.
- A `java.lang.Integer` parameter becomes a number input with integer constraints.
- A `java.lang.Boolean` parameter becomes a toggle switch.
- And so on for all supported types.

Parameters marked as **required** in the report configuration must be filled in before the form can be submitted. Optional parameters can be left empty — VeloxFactory silently drops empty parameter values and does not include them in the render request.

---

<h3 id="fields" style="color: #203671; margin-top: 2.2em;">Report Lines — Manual Data Entry</h3>

The **Report Lines** section only appears when the report has **no SQL connection assigned** — i.e. when the data adapter is `dyn. Array`. In this case, VeloxFactory has no database to query, so the detail band data must be entered manually in the browser.

The section shows a table with one column per field defined in the report. Each cell contains a typed input matching the field's data type. You fill in one row of values per data record you want to appear in the report.

To add more rows, use the **Add Row** button — it clones the input row and appends a new empty one. Individual rows (except the first) can be removed with the delete button on the right. Empty fields are not transferred to the render request.

<div style="border-left: 4px solid #5fc75d; background: #f6fdf6; padding: 10px 16px; margin: 16px 0; border-radius: 0 4px 4px 0;">
ℹ️ <strong>When a SQL connection is assigned, the Report Lines section is hidden.</strong> VeloxFactory fetches the data automatically from the database using the configured query — no manual input needed.
</div>

---

<h3 id="resources" style="color: #203671; margin-top: 2.2em;">Resources</h3>

If the report has image resources, a collapsible **Resources** section is available on the page. It shows a preview thumbnail of each resource file, its parameter name, and its file name. Resources are handled automatically at render time — you do not interact with them during rendering. The section is informational only, confirming which image files are currently assigned.

---

<h3 id="generating" style="color: #203671; margin-top: 2.2em;">Generating the PDF</h3>

Once parameters and fields are filled in, click **Generate PDF**. A confirmation modal opens with the rendering options:

<table style="width: 100%; border-collapse: collapse;">
  <thead>
    <tr style="border-top: 1px solid #e6e8ef; border-bottom: 1px solid #e6e8ef;">
      <th style="text-align: left; padding: 6px 10px; white-space: nowrap;">Option</th>
      <th style="text-align: left; padding: 6px 10px;">Default</th>
      <th style="text-align: left; padding: 6px 10px;">Description</th>
    </tr>
  </thead>
  <tbody>
    <tr style="border-bottom: 1px solid #e6e8ef;">
      <td style="padding: 6px 10px; white-space: nowrap;">Create History Record</td>
      <td style="padding: 6px 10px;"><span style="color: #349b31; font-weight: 600;">On</span></td>
      <td style="padding: 6px 10px;">Saves a full record of this rendering — request, response, PDF, and thumbnail — to the report history.</td>
    </tr>
    <tr style="border-bottom: 1px solid #e6e8ef;">
      <td style="padding: 6px 10px; white-space: nowrap;">Create Print Task</td>
      <td style="padding: 6px 10px;"><span style="color: #525E5A;">Off</span></td>
      <td style="padding: 6px 10px;">Dispatches the rendered PDF to the print service after rendering. Requires a printer name.</td>
    </tr>
    <tr style="border-bottom: 1px solid #e6e8ef;">
      <td style="padding: 6px 10px; white-space: nowrap;">Printer Name</td>
      <td style="padding: 6px 10px;">—</td>
      <td style="padding: 6px 10px;">The target printer. Required when Create Print Task is enabled.</td>
    </tr>
    <tr style="border-bottom: 1px solid #e6e8ef;">
      <td style="padding: 6px 10px; white-space: nowrap;">Copies</td>
      <td style="padding: 6px 10px;">1</td>
      <td style="padding: 6px 10px;">Number of copies passed to the print service. Does not trigger multiple renders.</td>
    </tr>
    <tr>
      <td style="padding: 6px 10px; white-space: nowrap;">Broadcast ID</td>
      <td style="padding: 6px 10px;">—</td>
      <td style="padding: 6px 10px;">Optional WebSocket channel ID. If provided, the print service is notified in real time when the print task is created. Leave empty to rely on polling instead.</td>
    </tr>
  </tbody>
</table>

Confirm with **Generate** to start the render. The request is processed synchronously — the page waits for the result and displays it immediately.

[![generate-pdf.modal.png](https://docs.veloxfactory.kiwi-software.dev/uploads/images/gallery/2026-05/scaled-1680-/generate-pdf-modal.png)](https://docs.veloxfactory.kiwi-software.dev/uploads/images/gallery/2026-05/generate-pdf-modal.png)

---

<h3 id="result" style="color: #203671; margin-top: 2.2em;">The Result</h3>

<h4 style="color: #203671; margin-top: 1.4em;">Success</h4>

On a successful render, the page shows a green confirmation banner and embeds the generated PDF as an inline preview directly in the browser — sized to the report's actual page dimensions. No download required; the document is immediately visible.

If a history record was created, a **View History** button appears — linking directly to the new `ReportHistoryRecord`. If a print task was dispatched, a **View Print Task** button appears as well, linking to the `ReportPrintTask` record where you can monitor its status.

[![generate-pdf.result.png](https://docs.veloxfactory.kiwi-software.dev/uploads/images/gallery/2026-05/scaled-1680-/generate-pdf-result.png)](https://docs.veloxfactory.kiwi-software.dev/uploads/images/gallery/2026-05/generate-pdf-result.png)

<h4 style="color: #203671; margin-top: 1.4em;">Errors</h4>

If the render fails, the page shows a red error banner listing all error messages returned by VeloxFactory. Common causes are missing required parameters, a SQL query that returns no data for a report that expects some, or a resource file that was removed after the configuration was last saved.

If a history record was created before the error occurred, the **View History** button still appears — the failed attempt is recorded, including the error details, which is useful for diagnosing what went wrong.

</div>