Prescription
Generate Prescriptions with Carbone
- Template type document docx simple
- Carbone min. v4.0.0+
- Features loop html date alias count
- Target Prescription custom
Objectives
Generate prescriptions with the following features:
- Present information in tables
Solution
Here’s how you can achieve this using Carbone:
Design the layout
Add a title and define the header, including elements like logo and illustrative image.
Insert a table
- Go to the Insert menu, select Table and create a table (e.g., 6x3 table)
- Write the labels for your columns.
- Insert Carbone tags to display the required data, such as
{d.pres[i].name}
. - Define at least one corresponding
[i+1]
for each iterated array to specify the position of the (i+1)-th item, e.g.{d.pres[i+1]}
Note: To apply a specific format (e.g., banded rows), highlight the table and choose a style from the Table Design menu.
Use aliases
- To improve readability, define aliases with
#
.
Example:
{#doctorPR = d.doctor.profile.personal}
- Use the alias with
$
.
Example:
{$doctorPR.name.f}
- To improve readability, define aliases with
Date manipulation
- Use
{c.now}
to return the current date in UTC. - Use the :formatD formatter to specify the pattern for display
Example:
{c.now:formatD(LLLL)}
- Add a time offset to the current date using the :addD formatter if needed.
Example:
{c.now:addD('15','day'):formatD(LLLL)}
- Signature
- Insert a temporary image for the signature.
- Right-click on the image, select View Alt Text, and define the path for the dynamic signature.
Example:
{$doctorp.signature}
- Use
And there you go!
Tips
Prevent rows from breaking across pages
If you don’t want rows to break across pages, follow these steps:
- Highlight the table in the template.
- Right-click and go to the Table Properties menu.
- Navigate to the Row section.
- Deselect the option to allow rows to break across pages.
Repeat header rows on subsequent pages
If you want to repeat the first row when your table spans page 3 and beyond, follow these steps:
- Highlight the first row of your second table in the template.
- Right-click and go to the Table Properties menu.
- Navigate to the Row section.
- Select the option "Repeat as header row at the top of each page."
Perfect!
You might also like
Trusted by 600+ paid customers in 40+ countries














