How 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... Follow this documentation to add dynamic content with JSON data.
For example:
Save you document
You just need to save your document and your template is ready to be rendered
Upload your template in the studio
You can create a free account on Carbone Account. Once your are login, go on Carbone Studio.
By default you have an example template you can delete if you don't want it
Now let's add your new template. Click in the menu on Report and then New. A modal will appear:
Add your saved document in the Template input
Add a name to your template in Name of the report
Choose a category. You can leave it blank.
Choose the first version of your report in Version number
Then click on the Add button and you will see your report in the studio.
Add JSON data
If you don't know what is JSON, check this website to learn how write JSON.
Now we will add our JSON data in the left part of the studio. In our previous template, we had two keys:
firstname
lastname
So we can add the following JSON:
{
"firstname": "John",
"lastname": "Doe"
}
If you activate the live reloading, the result on the right of the studio will be updated automatically.
If you want activate or deactivate the live reloading, you can do it in the parameter of the studio on the right
Design in live
You can design your report in your editor and automatically see the result in Carbone Studio.
When you add a report, you can edit it in your editor and you will see the result in live. If you open a template from the left menu of Carbone Studio, you can also design it in live by doing this:
Download your current template if you don't have it on your computer
Upload it in the studio by clicking on Template and then Upload to studio
A modal will appear, choose your document on your computer and click on OK
Now you can update your local document and each time you save it, the result will be updated in the Studio.
Updated on: 09/09/2022
Thank you!