Home Docs Changelog Download Pricing Customer Portal Community Contact

Using Custom Excel Template to Build Advanced Excel Reports with Custom Formatting


Overview

The Simple Table feature of SQLMessenger enables users to quickly convert SQL query results into Excel spreadsheets. However, Simple Table offers limited formatting options and cannot generate complex report layouts.

For example, if you need to display a field value in currency format within Excel (e.g., show 123.45 as €123.45), Simple Table cannot fulfill this requirement.

Convert SQL query results to Excel via Simple Table; the sales_amount field is shown as plain numeric values

Convert SQL query results to Excel via Simple Table; the sales_amount field is shown as plain numeric values

In such cases, you can use the Custom Excel Template provided by SQLMessenger to format the sales_amount field as currency, as demonstrated below:

Format the sales_amount field as currency with Custom Excel Template

Format the sales_amount field as currency with Custom Excel Template

This document walks you through the specific configuration steps.

1. Design the Excel Template Spreadsheet

First, design a template spreadsheet in Excel. Add data cell markers to cells that will populate SQL query results, such as <%sales_amount%>.

Note: To simplify subsequent configuration, the names of data cells should ideally match the field names returned by your SQL query.

Design the Excel template spreadsheet and insert data cell markers

Design the Excel template spreadsheet and insert data cell markers

Tip: You can use Excel formulas to quickly generate data cell markers, e.g., ="<%"&A1&"%>"

Generate data cell markers quickly using formulas

Generate data cell markers quickly using formulas

While designing the Excel template, set the target cells requiring currency formatting (e.g., cell J2 for sales_amount) to the currency cell format.

Set cell formatting properties

Set cell formatting properties

Once template design is complete, save the spreadsheet as an Excel file, for example sales-report-template.xlsx.

2. Create a Report Task in SQLMessenger and Attach a Custom Excel Template to the Task

Step 1: Create a report task within SQLMessenger.

Create a report task in SQLMessenger


Step 2: Add a Custom Excel Template attachment to the task.

Add a Custom Excel Template attachment to the task


Step 3: Select Customized Spreadsheet Template as the attachment Template Type, then upload the pre-designed Excel template file to the system.

Select Template Type and upload the Excel template file


Step 4: Attach an SQL query to the template attachment.

Attach an SQL query to the template attachment


Step 5: Click the Select All button in the wizard to select all fields, then click Auto Map Fields & Data Cells. In the Auto Map Fields and Data Cells popup, select Auto map fields and data cells by name and click OK. The system will automatically map SQL fields to data cells with matching names.

Configure mapping relationships between SQL fields and data cells


Step 6: Click Next, then click Finish to exit the wizard.

Click Next then Finish to complete the wizard


Step 7: Click OK to close the attachment template configuration dialog, then click Preview to test the task output.

Click Preview to view task execution results


After task execution completes, open the generated Excel file. You will see the sales_amount field rendered in currency format as configured.

sales_amount values displayed in currency format in the output file


With Custom Excel Template, you can leverage Excel’s full formatting capabilities to customize table styles, data formatting, and build sophisticated reports containing charts, native Excel formulas, and other advanced elements.

For more details on the Custom Excel Template, visit https://www.sqlmessenger.com/manual/31.1.8.htm.

Last updated on July 01, 2026


Cookie Settings

We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies in accordance with our Cookie Policy.

You can change your preferences at any time by clicking on "Cookie Settings" in the website footer.

Cookie Preferences

Manage your cookie preferences. You can enable or disable different types of cookies below. Necessary cookies cannot be disabled as they are required for the website to function properly.

Necessary Cookies

Always active

These cookies are essential for the website to function and cannot be switched off. They are usually only set in response to actions made by you such as setting your privacy preferences, logging in or filling in forms.

Preferences Cookies

Makes the site easier to use

These cookies allow the website to remember choices you make and provide enhanced, more personal features.

Analytics Cookies

Helps us improve our website

These cookies help us understand how visitors interact with our website, which helps us improve our products and services.

Marketing Cookies

Used to track visitors across websites

These cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging.

Send us a message