Use this referential topic when you need the exact names and syntax to pull data from Zilliant CPQ into your report templates. It covers the runtime parameters and fields for PDF templates, the utility methods available in both PDF and Excel templates, and ready-to-copy expressions for images, thumbnails, and common data.
In this topic, learn:
Expression to add product attribute range thumbnails to PDF templates
Utility methods to get information for PDF and Excel reports
Parameters and fields for PDF templates
Tip
Use the Groovy Additional Data for Proposal Generation extension point to pass additional data in reports.
The following table includes parameters and fields you can use in your PDF or Excel report template to dynamically pass values from CPQ to the report.
Method name | Data type | Usage |
|---|---|---|
|
| Quote header information. |
|
| Line item information. |
|
| Base content path. Use it to build image URLs. |
|
| Report locale. Defines number and date formats. |
|
| Resource bundle bonded with the report. |
|
| Today’s date in the |
|
| Username of the signed-in user. |
|
| Role of the signed-in user. |
|
| Available only when you include a subreport. |
To access these parameters also in subreports, pass the REPORT_PARAMETERS_MAP from the main report to the subreport:
<subreport>
<reportElement x="6" y="11" width="545" height="200" uuid="190d17f1-ced8-4d82-a340-32c58ed18fff"/>
<parametersMapExpression><![CDATA[$P{REPORT_PARAMETERS_MAP}]]></parametersMapExpression>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{SalesItem}.getAttributeValues("includesPriceItem"))]]></dataSourceExpression>
<subreportExpression><![CDATA[$P{SUBREPORT_quotePriceItems}]]></subreportExpression>
<subreport>Expressions to add images to PDF and Excel templates
CPQ allows you to add images that are stored in the system.
For PDF reports, the system supports dynamic image generation.
For XLSX reports, the system supports static images only.
Use the following expressions to add images to the template:
Fixed image—
$P{CMIS} + "/logos/losgo.png"Line item image—
$P{CMIS} + "/" + $F{SalesItem}.getAttributeValues("salesItemImage").get(0)Product image—
$P{CMIS} + "/" + $F{SalesItem}.getAttributeValues("isProduct", "productImage").get(0)
Expression to add product attribute range thumbnails to PDF templates
In addition to the main product image in the proposal PDF, you can also include thumbnails of all product attribute images for that specific quote or agreement. This feature enhances the proposal by giving customers richer visual content.
To add attribute range thumbnails, use the following expression:
<imageExpression><![CDATA[$P{CMIS_ROOT} + "/" + $F{SalesItem}.getDSAValueThumbnails("Demo_Product_Country").get(0)]]></imageExpression>
</image>
<image>
<reportElement x="160" y="45" width="25" height="20"/>
<imageExpression><![CDATA[$P{CMIS_ROOT} + "/" + $F{SalesItem}.getDSAValueThumbnails("Demo_Product_Color").get(0)]]></imageExpression>
</image>
Utility methods to get information for PDF and Excel reports
Both PDF and Excel templates can call utility methods to retrieve quote or agreement and line item information. The following table lists all methods, return types, and supported report formats. All method names are case-sensitive.
Method | Details | Supported report format |
|---|---|---|
| Accept a single fragment as a parameter. Useful for getting attribute information such as l10nKey. | PDF and Excel |
| Accept a single fragment as parameter. Useful for getting a long description of an attribute. | PDF and Excel |
| Accept one or more business attributes as parameters and return a single value. If more than one level, use BusinessRelationAttribute followed by BusinessDataAttribute. | |
| Accept one or more fragments as parameter and return a single value. If more than one level, use BusinessRelationAttribute followed by BusinessDataAttribute. | PDF and Excel |
| Accept one or more business attributes as parameter and return a list. If more than one level, use BusinessRelationAttribute followed by BusinessDataAttribute. | |
| Accept one or more fragments as parameter and return a list. If more than one depth, use BusinessRelationAttribute followed by BusinessDataAttribute. | PDF and Excel |
| Accept dynamic attribute name as parameter and return label(l10nkey) of dynamic attribute. | PDF and Excel |
| Accept dynamic attribute name as parameter and return dynamic attribute’s configuration values as list. For DDA, its current value is returned. However, for DSA, a localized text of the value has precedence over its name. If the label exists for DSA value, then it is returned. Otherwise, DSA object name is returned. | PDF and Excel |
| Similar to getDAValues, only a single value is returned. | PDF and Excel |
| Accept dynamic attribute name as parameter and return dynamic attribute’s configuration values’ name as a list. | PDF and Excel |
| Similar to getDSAValueNames, only a single value is returned. | PDF and Excel |
Expression examples for PDF and Excel reports
The following table provides side-by-side snippets for IDs, names, localization, dates, conditions, and loops so you can port logic between Jasper $P{}, $F{}, $R{}) and JXLS ${…}).
Excel | ||
|---|---|---|
Syntax |
|
|
Syntax |
|
|
Dynamic Text |
|
|
Static Text |
|
|
Date |
|
|
Condition | Either with the use of |
|
Iteration | Line items iteration is automatically done in the Detail section. If a user wants to make iteration in the section other than Detail, then they can use List Component. Furthermore, if a user wants to print configuration details, they can use that list component and iterate all configurations. |
|
Import class | Allowed | Not allowed |
Declare variables | Allowed | Not allowed except for variables used in iteration |
Dynamic image | Supported. For details, read Expressions to add images to PDF and Excel templates. | Not supported |