Abbreviation |
Description |
---|---|
RE |
Report Engine |
|
Portable Document Format |
JSON |
JavaScript Object Notation |
DDA |
Dynamic Data Attribute |
DSA |
Dynamic Symbolic Attribute |
Introduction
Reporting engine is simple, generic, and easy to use and ability to retrieve any kind of Quote information at any time. It supports two kinds of format such as Excel and PDF. Excel report is generated with the use of JXLS library (http://jxls.sourceforge.net/) and PDF is exported using Jasper report (https://community.jaspersoft.com/project/jasperreports-library). As a quick introduction for each of these: JXLS is a small Java library to make generation of Excel reports easy. JXLS uses a special markup in excel templates to define output formatting and data layout. The Jasper Reports Library is the world's most popular open source reporting engine written in Java.
Digital Sales Platform report engine is designed to retrieve and print any data point on quotation.
Below is the screen shot of proposal report generation screen. Two options are available such as PDF and excel. User can choose the languages and the template to generate.
Supports two types of report format (PDF AND EXCEL). JXLS is a small Java library to make generation of Excel reports easy. JXLS uses a special markup in Excel templates to define output formatting and data layout. The JasperReports Library is the world's most popular open source reporting engine written in Java.
As in figures above, the difference is Figure (1) selects PDF as proposal format, but figure (2) chooses excel report template. Cover Page, Cover Letter which are all additional reports are shown for PDF proposal. Moreover, if user uploads PDF as first level quote attachment or sales Item attachment, they will show in this screen together with additional reports. Report engine can provide PDF merging capability. If user chooses more than one of additional report templates, attachments and main proposal report, the output proposal document is a single PDF, the rendered and merged PDF of all these report templates.
Prepare Report Template
This section allows user to understand how to prepare report template physical file. Since there are two available report template formats, two separate tools to be used to prepare report.
Available Information for Report
Reporting engine prepares and generates the whole, generic, complete data about Quote including all sales items, sales item configuration, price items, partners and sales area information and all other related information. Customer specific report formats are done in excel and jasper templates. The user must already have prior knowledge of schema.
This section is much about technical things. The intended user of this section is the person who prepare report templates to meet customer needs and already have basic knowledge of how to prepare jasper templates and excel templates. The purpose of this section is which data are available, how to retrieve and how to use in templates.
What data is available to print?
There are two APIs available in MX for getting data attributes and relational attributes in JSON format. User can find available data to print in these jsons.
For Quote Header:
http://HOST/iss/webapp/quote/salesItemInstanceTreeForReportHeader?quoteId=<paramQuoteId>
Where, paramQuoteId is the URL encoded full URI.
Example:
When user open the links below, he/she will see the following json.
Note:
If you are using Chrome browser, user can install chrome extensions to improve efficiency to prepare report templates according to customer needs.
To view json file, you can install JSONView chrome extension.
In order to open jrxml file, “JapserSoft Studio” is required. User can download from the following link https://community.jaspersoft.com/project/jaspersoft-studio.
Method Name |
Data Type |
Usage |
---|---|---|
Quote (Parameter) |
com.imc.datamodel.transferobjects.BusinessObjectDTO | To get all the data of current quote header information |
SalesItem (Field) |
com.imc.datamodel.transferobjects.BusinessObjectDTO | To get each of the sales Item information |
CMIS (Parameter) |
java.lang.String | Usually used to show images |
REPORT_LOCALE (Parameter) |
java.util.Locale | The current locale that report is generated |
REPORT_RESOURCE_BUNDLE (Parameter) |
java.util.ResourceBundle | The resource bundle that is bonded with report |
currentDate (Parameter) |
java.lang.String | Today date in DD_MM_YYYY format |
VAR_LOGGED_IN_USER (Parameter) |
java.lang.String | Current Login Username |
VAR_LOGGED_IN_USER_ROLE (Parameter) |
java.lang.String | Current Login User's Role |
SUBREPORT_XXXXXX where XXXXXX is the sub report name. (Parameter) |
net.sf.jasperreports.engine.JasperReport | Optional parameter. It is only available when the report is using sub report |
All main reports and additional reports are filled with these parameters. However, the filling data to sub report is the responsibility of parent report (either proposal report or additional report in this case). By passing REPORT_PARAMETERS_MAP from main report to sub report, all the main report parameters can be accessible in sub report. Keep in mind that this parameter passing is mandatory for sub report to get access main report parameters.
Groovy extension is provided to enhance the report map, the main parameter to pass additional data to report. User can upload groovy script file to “Additional Data for Proposal Generation” to provide more data points to report map. In order to implement groovy script, user can refer to Groovy Service Guide.
Utility Methods to get information for Report
MX provides certain utilities method to easily access quote information as “Quote” and sales item information as “SalesItem” in both templates. The following utility methods can be used to retrieve data.
Method Name |
Detail Description |
|
Excel |
Deprecated |
---|---|---|---|---|
getAttribute(String fragment) |
Accept a single fragment as parameter. Useful for getting attribute information such as l10nKey. |
YES |
YES |
NO |
getAttributeLongValue(final String fragment) |
Accept single fragment as parameter. Useful for getting long description of attribute. |
YES |
YES |
YES |
getAttributeValue(final BusinessAttribute...businessAttributes) |
Accept one or more BusinessAttribute as parameter and return single value. If more than one depth, use BusinessRelationAttribute followed by BusinessDataAttribute. |
YES |
NO |
NO |
getAttributeValue(final String...fragments) |
Accept one or more fragments as parameter and return a single value. If more than one depth, use BusinessRelationAttribute followed by BusinessDataAttribute. |
YES |
YES |
NO |
getAttributeValues(final BusinessAttribute...businessAttrbutes) |
Accept one or more BusinessAttribute as parameter and return a list. If more than one depth, use BusinessRelationAttribute followed by BusinessDataAttribute. |
YES |
NO |
NO |
getAttributeValues(final String...fragments) |
Accept one or more fragments as parameter and return a list. If more than one depth, use BusinessRelationAttribute followed by BusinessDataAttribute. |
YES |
YES |
NO |
getDALabel(String dynamicAttributeName) |
Accept dynamic attribute name as parameter and return label(l10nkey) of dynamic attribute. |
YES |
YES |
NO |
getDAValues(String dynamicAttributeName) |
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, localized text(label) of value has higher precedence over its value name. In other words, if label is existed for DSA value, it is returned, otherwise, DSA object name is returned. |
YES |
YES |
NO |
getDAValue(String dynamicAttributeName) |
Like getDAValues. The difference is that a single value is returned. |
YES |
YES |
NO |
getDSAValueNames(String dynamicAttributeName) |
Accept dynamic attribute name as parameter and return dynamic attribute’s configuration values’ name as list. |
YES |
YES |
NO |
getDSAValueName(String dynamicAttributeName) |
Like getDSAValueNames. The difference is that a single value is returned. |
YES |
YES |
NO |
*All the expressions are case sensitive.
PDF vs Excel
|
|
Excel |
Note |
---|---|---|---|
Syntax |
$P{Quote}.getAttributeValue("quoteId") |
${Quote.getAttributeValue("quoteId")} |
|
Syntax |
$F{SalesItem}.getAttributeValue("isProduct","objectName") |
${SalesItem.getAttributeValue("isProduct","objectName")} |
|
Dynamic Text |
((BusinessObjectDTO)$P{Quote}.getAttributeValue("hasIncoTerms")).l10nKey | ((BusinessObjectDTO)$P{Quote}.getAttributeValue("hasIncoTerms")).l10nKey |
|
Static Text |
$R{table.label.description} |
${REPORT_RESOURCE_BUNDLE.getString("table.label.description")} |
|
Date |
new SimpleDateFormat("dd.MM.yyyy").format(new java.util.Date()) |
new SimpleDateFormat("dd.MM.yyyy").format(new java.util.Date()) |
|
Condition |
Either with the use of printWhenExpression or ternary operator(?). |
<jx:if test="${!(attr.attribute.getId().getFragment().matches("has"))}"> </jx:if> |
|
Iteration |
Sales items’ iteration is automatically done in “Detail” section. But if user want to make iteration in section other than “Detail”, user can use “List Component”. Furthermore, if user wants to print configuration details, he/she can use that list component and iterate all configurations. The detailed description for example is skipped here. |
<jx:forEach items="${SalesItem}" var="salesItem"> </jx:forEach> |
|
Import class |
Allow |
Not allowed |
|
Declare Variables |
Allow |
Not allowed except variables used in iteration |
|
Dynamic Image |
Supported |
Not supported |
|
Images
MX report engine helps user to print images stored in the system. Dynamic image generation is supported for only PDF report and not for excel report. Only static image is supported for Excel report. The following are the expression to print images:
- Fixed Image
$P{CMIS} + "/logos/losgo.png"
- Sales Item Image
$P{CMIS} + "/" + $F{SalesItem}.getAttributeValues("salesItemImage").get(0)
- Product Image
$P{CMIS} + "/" + $F{SalesItem}.getAttributeValues("isProduct", "productImage").get(0)
Custom Fonts
Some users want to use custom fonts according to their needs. These fonts can be put into “jasper-fonts.jar” and put that jar file in “Administration->Content Management->fonts”.
To generate this jar file, user can follow the link https://community.jaspersoft.com/wiki/custom-font-font-extension.
Localization for Report
PDF report can be printed in multiple languages. The localization for these languages is defined in messages.properties file under “Content Management->Localization->report-customization”. Each message properties file represents one language.
However, changes in these file need server restart in order to take effect.
Report Template
This section lets user understand how many types of report, how and where to define in MX. There are three types of report templates: Proposal Report Templates, Excel Report Templates and Additional Report Templates.
Proposal and additional report templates are files with jrxml extension. Physical file must be placed correct location in content management system. Location of jrxml files are under “Administration->Content Management->jasperreports”.
Location of excel report templates are “Administration->Content Management->excels->excelreports”.
Once user uploads the actual report template file in content management system, next thing user need to do is to create individual report template for respective type.
Proposal Report Template
Picture below shows the place to create proposal report template (Administration->Master Data Management-> Proposal Report Template). Report name must match exactly with template file name uploaded to content management system. The file extension must be “jrxml”. In this case, physical temple file is “quote.jrxml” for report name “quote”.
Excel Proposal Template
Picture below shows the place to create excel report template. Report name must match exactly with template file name uploaded to content management system. File extension must be “xlsx”. In this case, physical temple file is “quoteExcel.xlsx” for report name “quoteExcel”.
Additional Report Template
Picture below shows the place to create additional report template. Report name must match exactly with template file name uploaded to content management system. File extension must be “jrxml”. In this case, physical temple file is “CoverLetter.jrxml” for report “CoverLetter” and “CoverPage.jrxml” for “CoverPage”.
Sub Report Template
Picture below shows the place to create sub report template. Report name must match exactly with template file name uploaded to content management system. File extension must be “jrxml”. In this case, physical temple file is “quotePriceItem.jrxml” for report “quotePriceItem”.
Sub report can be assigned to proposal report and additional report. However, sub report cannot be assigned to another sub report. In other words, sub report cannot have another sub report. Only one level sub report is supported.
Assign Report Template
To User Role
Report templates are user role based. They can be assigned to user roles so that different user roles have different report templates and can generate same information in different kinds of formats or even restricted information as per user role. Below pictures shown to assign report templates (proposal and excel template) to user role. Additional report templates are not role-based.
To User Preferences
Besides user role, each user can define and set his or her preferred proposal report templates and excel report template in user preferences. Below screen shows the place to define proposal templates and excel templates.
Comments
0 comments
Please sign in to leave a comment.