# Barcode Image Generation in Spreadsheet Document Barcode Image Generation in Spreadsheet Document with GroupDocs.Assembly for Python via .NET: the template, the Python data and the code. {{< alert style="info" >}}The example reads the shop data described in [The Business Layer]({{< ref "assembly/python-net/developer-guide/basic-usage/working-with-a-business-case/the-business-layer.md" >}}).{{< /alert >}} ## Barcode Generation in Microsoft Spreadsheet ### Template Syntax * Add a textbox to your template at the place where you want a barcode image to be inserted. * Add the following syntax: ```text <> ``` {{< alert style="success" >}}For detailed technical information about syntax, expressions and report generation by the engine, please visit: [Working with GroupDocs.Assembly Engine]({{< ref "assembly/python-net/developer-guide/basic-usage/working-with-groupdocs.assembly-engine/_index.md" >}}){{< /alert >}} ### Download Template Get the template from here. * [barcode.xlsx](https://docs.groupdocs.com/assembly/python-net/_sample_files/developer-guide/advanced-usage/working-with-barcode-image-generation/barcode-image-generation-in-spreadsheet-document/barcode.xlsx) ### The Code {{< alert style="warning" >}}On Linux, a QR code needs the font of the text box that holds the barcode tag installed, under that font's name; the workbook's cell styles play no part. This sample template is set in Arial, which `ttf-mscorefonts-installer` provides; a text box set in Calibri, the Excel default, needs Calibri itself. Without the font the QR code cannot be drawn: the call raises `Value cannot be null. (Parameter 'trueTypeFont')`, and a substitute font such as Carlito is not used. See [System Requirements]({{< ref "assembly/python-net/getting-started/system-requirements.md" >}}).{{< /alert >}} {{< tabs "example1" >}} {{< tab "Python" >}} ```python import json from groupdocs.assembly import DataSourceInfo, DocumentAssembler with open("customer.json", encoding="utf-8") as f: customer = json.load(f) assembler = DocumentAssembler() assembler.assemble_document("barcode.xlsx", "barcode-report.xlsx", DataSourceInfo(customer, "customer")) ``` {{< /tab >}} {{< tab "barcode.xlsx" >}} {{< tab-text >}} The following sample file is used in this example: [barcode.xlsx](https://docs.groupdocs.com/assembly/python-net/_sample_files/developer-guide/advanced-usage/working-with-barcode-image-generation/barcode-image-generation-in-spreadsheet-document/barcode.xlsx) {{< /tab-text >}} {{< /tab >}} {{< tab "customer.json" >}} {{< tab-text >}} The following sample file is used in this example: [customer.json](https://docs.groupdocs.com/assembly/python-net/_sample_files/developer-guide/advanced-usage/working-with-barcode-image-generation/barcode-image-generation-in-spreadsheet-document/customer.json) {{< /tab-text >}} {{< /tab >}} {{< tab "barcode-report.xlsx" >}} ```text Binary file (XLSX, 13 KB) ``` [Download full output](https://docs.groupdocs.com/assembly/python-net/_output_files/developer-guide/advanced-usage/working-with-barcode-image-generation/barcode-image-generation-in-spreadsheet-document/the_code/barcode-report.xlsx) {{< /tab >}} {{< /tabs >}}