---
source: https://carbone.io/examples/quote-with-datasheet/
title: "Quote Automation | Generate Professional PDF Quotes | Carbone Sample"
description: "Learn how to automate quote generation by merging JSON data with templates in DOCX, PPTX, or XLSX formats. Create professional quotes with automatic calculations and file attachments using Carbone."
generated_at: "2026-07-13"
---

# Automation of Quotes

Generate PDF Quotations including datasheet with Carbone

[![quote-with-datasheet thumbnail](/examples/quote-with-datasheet/thumb-result.webp)](/examples/quote-with-datasheet/result.pdf)

[Download Template](/examples/quote-with-datasheet/template.docx)

[Download data sample](/examples/quote-with-datasheet/data.json)

-   Template type document docx simple
-   Carbone min. v5.0.0+
-   Features table loop attached files
-   Target quote contract custom

## Overview

Learn how to generate professional quotes with these key features:

-   Perform automatic price calculations
-   Automatically attach supporting documents (like datasheets) to your quotes
-   Create clean, professional-looking documents

## Step-by-Step Guide

Follow these steps to create automated quotes with file attachments using Carbone:

### 1\. Create the Layout Structure

You can start by inserting a main table in your document. This table will serve as the layout framework, allowing you to organize and control the positioning of elements

### 2\. Implement Automatic Calculations

Add these calculations to automate pricing:

-   Calculate subtotals (quantity × unit price):
    
    ```text
    {d.products[i].quantity:mul(.price)}
    ```
    
-   Calculate the total sum of all items:
    
    ```text
    {d.products[].quantity:mul(.price):aggSum}
    ```
    
-   Format currency values properly:
    
    ```text
    {d.products[i].quantity:mul(.price):formatC}
    ```
    
-   Store calculations for later use:
    
    ```text
    {d.products[].quantity:mul(.price):aggSum:set(c.subtotal)}
    {d.products[].quantity:mul(.price):aggSum:mul(0.2):set(c.taxes)}
    ```
    

You can then reference stored values in other calculations:

```text
{c.taxes:add(.subtotal):formatC}
```

### 3\. Attach Files to Your Document

Use the [:appendFile](/documentation/design/advanced-features/file-operations.md#appendfile-where) formatter to automatically attach files to your generated document. Simply reference the file's URL in your template:

```text
{d.products[i].datasheet:appendFile}
```

## Related Examples

Check out these similar templates to learn more:

[![mission-report thumbnail example](/examples/mission-report/thumb-result.webp)](/examples/mission-report/index.md)

## Trusted by 800+ paid customers in 40+ countries

## Related topics

- [Transport ticket](/examples/ticket/index.md)
- [Summary](/examples/summary/index.md)
- [Stock inventory spreadsheet](/examples/stock-inventory-spreadsheet/index.md)
- [Store Inventory](/examples/shoes/index.md)
- [Sensor readings](/examples/sensor-readings/index.md)
- [Real estate property document](/examples/real-estate-property-description/index.md)
