Most popular tutorials
How to insert a page break without having a blank page at the end of the report?
Inserting page break without an extra blank page To insert a page break between each repetition section, you have two options: A - Insert a page break within the repetition section B - Or use paragraph options of Word to insert a page break before each new paragraph Example A - page break Template with page breakPopularHow to create a template?
How create a template and render it on Carbone Studio? Create a template on Carbone studio is easy. You need LibreOffice or Microsoft word and a free account on Carbone Studio. Create a template You can create writer document, calc spreadsheet or event presentation. Open libre office or Microsoft word Choose the type of document you want. Design your template Then use your editor functionnalities to design it. You can add header, footer...PopularStyle guide to design a report
Carbone Style Guide This is the official style guide for the Carbone language. If you use Carbone in a project, it’s a great reference to avoid errors, bikeshedding, and anti-patterns. Essential These rules help prevent errors, so learn and abide by them at all costs. Exceptions may exist, but should be very rare and only be made by those with expert knowledge of Carbone. The following checklist avoids unexpected behaviors, avoids creating a corrupted document or avoids not printed valuePopularPrint a line feed into a document
Render a line feed into a document

 The line feed, also known as a "Carriage Return", a "New Line", and the n character, can be rendered into ODT and DOCX documents with the formatter ":convCRLF”. Learn more about the formatter: https://carbone.io/documentation.htmlconvcrlf-

 CRLF FoSome readersFix Quotation Marks Issue
Common quotation marks errors If you are using single quotes, text editors may replace automatically them with "smart quotes" that are not supported by Carbone. If you are using double quotes to filter attributes d.list attributeValue="productstate" , you may encounter unexpected behaviors. Solution You must always use single quotes (also known as Straight quotes)! MS word: On the File tab click on Options Click on Proofing click on AutoCorrect OptioFew readersWhat is a Carbone tag?
What is a Carbone tag? Carbone tags are placeholders d. within the template. When reports are generated, tags are substituted for data coming from a JSON dataset. The value can be a string, a number, a date, image and more! JSON Data Template Hello d.firstname d.lastname ! Result Hello John Doe !Few readers
Print lists / Loop through arrays
How to keep merged rows inside a table loop?
How to keep merged rows inside a table loop? Carbone can't keep a merged rows when it is mixed with a loop of rows, the column will be transformed as a row on the generated report. This article is about creating a document that contains a table with merged columns mixed with loop of rows, such as: Table example with merge rows Solution Create a table inside a table, such as:Some readersHow to draw an horizontal repetition in a table (LibreOffice)?
Go to Insert -Section -Columns and set maximum number of column (here 5) In the first section, insert a table, and go to "Table Properties": 3Few readersPrint a list of strings
Print a list of strings / numbers The goal is to print each elements into a newline. The following JSON dataset is used as an example: The solution is to join all elements with new line characters n with :arrayJoin, then convert them into DOCX/ODS/ODT/PDF formats with :convCRLF, such as: ODT template edited with LibreOffice (https://storage.crisp.Few readers
Dynamic Pictures / Images
Insert dynamic images as shapes (Rounded square, Oval)
Insert dynamic images as shapes (Rounded square, Oval) 1. insert a picture as PNG or JPEG on the template The temporary picture will be replaced by the new image coming from the JSON dataset. 2. Crop the image to a shape (https://storage.crisp.chat/users/helpdesk/website/f355e91d7615e000/screenshot-2021-Few readersWhy dynamic pictures are not rendered into my document?
Dynamic pictures are not injected into a report When using dynamic pictures with image URLs or Data-URLs, images may not appear on the document If an error occurs, and a replacement error image is used (white crossed images). Error reasons (URL format) The file type is not provided by the file extension nor by the file mime-type (URL format) The file can't be download because of restrictions: the file is protected by a proxy,Few readers
Show / Hide content
Why conditional formatters are adding empty lines? (showBegin/hideBegin)
Why conditional formatters are adding empty lines? (showBegin/hideBegin) First Solution When using conditional formatters showBegin/showEnd or hideBegin/hideEnd, insert only Break-lines (shift + Enter). It exist 2 ways to create a line: Break-line : The new line is part of the current paragraph by hitting shift + Enter. Behind the scenes, Carbone don't have to reorder the XML because everything is in the same paragraph. New-line : Close the current paragraph and oSome readersHow to hide an image conditionally
Hide or remove images conditionally from PDF, ODT or DOCX documentsSome readersHow to hide a paragraph conditionally
Hide or remove paragraphs conditionally from PDF, ODT or DOCX documentsSome readersHow to hide a table row conditionally
Hide or remove a table row conditionally from PDF, ODT or DOCX documentsFew readersHow to hide shapes conditionally? (lines, circles, squares)
Hide or remove shapes conditionally from documents PDF, ODT or DOCXFew readersHide a line if an element is empty
Hide or remove empty lines conditionally from PDF, ODT or DOCX documentsFew readersHow to hide charts conditionally
Hide, remove or delete charts conditionally from documents PDF, ODT or DOCXFew readers
What can I do when I got rendering error message? (List below)
When rendering reports through Carbone Cloud API & Studio, it is possible to receive error messages and it is due to design issue inside the template. If one of the following error occurs, read the Style Guide checklist. List of common errors: Error: could not open document : The generated document is corrupted due to a design issue, it can come from tags, loops, formatters, conditional blocks, dynamic coloSome readersInsert a watermark dynamically
Insert a watermark dynamically It exists 2 solutions: Insert a watermark as a Carbone tag on your template. It is possible to change the color, orientation, and opacity of the watermark. (e.g. Example 1 with Libre Office, Example 2 with MS Word) Insert a watermark as a PDF rendering option when requesting Carbone Render API. The watermark will be green, it is not possible to change the color, orientation, and opacity. (e.g. ESome readersReplace colors dynamically according to conditions
Replace color dynamically according to conditions Inserting color conditionally is possible only with the formatter :ifEqual. It takes 3 arguments, in order: value to test the equality (ex: true, false, -1, 0, etc...) the value to return if the value is valid, it can be a Carbone tags the value "true", it is required to make tSome readersHow to compute totals in Excel / Spreadsheets when Carbone injects new lines?
Problem Most spreadsheet reports need totals at the bottom of the table. But the bottom of the table is dynamically pushed down by Carbone when the data is inserted. So you cannot use a formula =SUM(B1:B2) because B2 is dynamic. It can be B88 or B351 when Carbone has inserted the data. Here are two solutions: Use a dynamic Excel formula Place this formula in any summary cell in your template worksheet, and it will produce the sum of all the numbers in the column above that ceFew readers