Turn raw database records into polished, automated invoices using AI and DataReportive.
🧠 Step 1: Use AI to Generate an Invoice Template
Use ChatGPT or Claude to instantly generate a styled HTML invoice layout. Here’s a prompt you can give the AI:
"Can you create me a HTML template of an Invoice. I'm using DataReportive to populate this template with data from my database. Where the data is in the template use the <metric class='inline'></metric> tag, as this is what DataReportive uses to know where to populate the data. Please only use inline CSS."
This will output a clean invoice layout with smart placeholders like:
<metric class="inline">invoice_number</metric>
📥 Step 2: Paste the Template into DataReportive
- Go to your DataReportive Dashboard.
- Click “Create New Report” or “New HTML Email”.
- Paste your AI-generated HTML into the editor.
- Replace each metric tag with the corresponding database field:

<metric class="inline">customer_name</metric>
These tags tell DataReportive exactly where to inject the data from your SQL results.
🗃️ Step 3: Write SQL Queries (or Ask AI)
You can write a custom SQL query yourself, or use AI to help based on your schema:

SELECT
customer_name,
invoice_number,
invoice_date,
due_date,
invoice_total
FROM invoices
WHERE invoice_id = ;
Tip: DataReportive supports dynamic parameters like for flexible filters.
⏰ Step 4: Automate Invoicing with Schedules
Once your invoice is connected to your data, schedule it for automation:
- Go to Schedules in DataReportive.
- Set a recurring interval (daily, weekly) or trigger via webhook.
- Select recipients for the invoice email.
- Optionally attach a PDF version.
💡 And that’s it — invoices generated and sent without lifting a finger!
⚡ Use Cases Beyond Invoicing
- Client-facing reports
- Order summaries
- Payment receipts
- Internal dashboards
If it's in your database, you can turn it into a branded, dynamic document.
💡 Why Use <metric class="inline">
?
This special tag tells DataReportive where to inject live data into HTML. It’s incredibly flexible and works inline, in tables, or even headers.
<p>Hello <metric class="inline">customer_name</metric>, your total is $<metric class="inline">invoice_total</metric>.</p>
✅ Summary
Step | Description |
---|---|
1. Use AI | Generate an HTML invoice layout |
2. Add Template | Paste it into a Report or HTML Email |
3. Write SQL | Query your database for live values |
4. Automate | Schedule or trigger your invoices |
Built with ❤️ using DataReportive.