Jump to content
We've recently updated our Privacy Statement, available here ×

Dhiraj Pahlani

Jaspersoft Staff
  • Posts

    68
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by Dhiraj Pahlani

  1. Problem: In JasperReports Server 8.0.2 when exporting JRXML reports and Ad Hoc Reports to XLSX/XLS, the date format seen in the export output file is incorrect with 'a' appended and the dates are converted from 12hr to 24hr format, like: Feb 16, 2023, 15:57:03 a Cause: This was a bug in JasperReports Library since introduction of the newer exporter configuration API. A non null Map object was preventing the deprecated parameter value of the exporter to be read. Solution: The date format mappings configuration of our JasperReports Server can be seen in the applicationContext.xml file (<jasperserver-pro>/WEB-INF/) under the formatPatternsMap map id, like: <util:map id="formatPatternsMap"><!-- entry key="$ #,##0.00" value="$ #,##0.00"/--><entry key="MMM d, yyyy h:mm:ss a" value="MMM d, yyyy h:mm:ss AM/PM"/><entry key="h:mm:ss a" value="h:mm:ss AM/PM"/><entry key="h:mm a" value="h:mm AM/PM"/><entry key="h:mm:ss a z" value="h:mm:ss AM/PM"/></util:map>[/code] A bug report with internal ticket number JS-64895 was filed to resolve this issue and this has been addressed with a hotfix. The hotfix - hotfix_JRSPro8.0.2_cumulative_20221206_1040.zip - or a later cumulative hotfix can be applied to the JasperReports Server installation to fix this issue. Please also note that we need to include the below property with the required date format pattern for XLSX export in the JRXML file, in addition to defining the date pattern for the text field. For example, Report Level property required to be used: <property name="net.sf.jasperreports.export.xls.pattern.MMM d, yyyy h:mm:ss a" value="d,mmm,yyyy h:mm AM/PM"/>[/code] Text Field date pattern expression definition: <textField><reportElement x="0" y="0" width="111" height="30" uuid="a8a0511e-31f4-4a75-a23a-bfebc16b2514"><property name="com.jaspersoft.studio.spreadsheet.connectionID" value="c04e1bee-c79a-41e4-9ee1-eef28cbc2a89"/></reportElement><textFieldExpression><![CDATA[$F{date_start}]]></textFieldExpression><patternExpression><![CDATA["MMM d, yyyy h:mm:ss a"]]></patternExpression></textField>[/code] ______________________________________________________________________________________________________________________________________________________________ Ref. Case #02148238
  2. Requirement: To have value and percentage in Ad Hoc View pie chart. We have an Ad Hoc View pie chart where we would like to have value AND percentage displayed for each slice, but we can only have value OR percentage yet. How can we manage to get the value AND the percentage at the same time? Solution: With series.dataLabels.enabled=true set for the Ad Hoc View, we can use below additional advanced property to display value and percentage for each slice in the pie chart. Notice that we have used comma as a separator to define the required desired formats for the data labels. series.dataLabels.format={point.name}: {point.percentage:.1f}%, {y} Please also see below screenshot for reference. ___________________________________________________________________________________________________________________________________________ Ref. Case #02163519
  3. Requirement: To allow anonymous access to Dashboards Solution: The configurations to make the anonymous access work with Dashboards need to be made in the below XML files, present under the <jasperserver-pro>/WEB-INF/: 1. applicationContext-security.xml file 2. applicationContext-security-web.xml file 3. applicationContext-security-pro-web.xml file 1. applicationContext-security.xml file: Find the flowVoter bean and add ROLE_ANONYMOUS to the properties as below: <bean id="flowVoter" class="com.jaspersoft.jasperserver.api.security.FlowRoleAccessVoter"><property name="flowAccessAttribute" value="FLOW_ACCESS"/><property name="flowDefinitionSource"><value>viewReportFlow=ROLE_USER,ROLE_ADMINISTRATOR,ROLE_ANONYMOUSdashboardRuntimeFlow=ROLE_USER,ROLE_ADMINISTRATOR,ROLE_ANONYMOUSrepoAdminFlow=ROLE_ADMINISTRATORuserListFlow=ROLE_ADMINISTRATORroleListFlow=ROLE_ADMINISTRATOReditFolderFlow=ROLE_ADMINISTRATORfileResourceFlow=ROLE_USER,ROLE_ADMINISTRATORlistOfValuesFlow=ROLE_USER,ROLE_ADMINISTRATORreportDataSourceFlow=ROLE_USER,ROLE_ADMINISTRATORinputControlsFlow=ROLE_USER,ROLE_ADMINISTRATORtenantFlow=ROLE_ADMINISTRATORaddDataSourceFlow=ROLE_ADMINISTRATORuserEditFlow=ROLE_ADMINISTRATORroleEditFlow=ROLE_ADMINISTRATORqueryReferenceFlow=ROLE_ADMINISTRATORsearchFlow=ROLE_USER,ROLE_ADMINISTRATOR*=ROLE_USER,ROLE_ADMINISTRATOR</value></property></bean>[/code] 2. applicationContext-security-web.xml file: Edit the filterInvocationInterceptor bean to add ROLE_ANONYMOUS as below: <bean id="filterInvocationInterceptor" class="org.springframework.security.web.access.intercept.FilterSecurityInterceptor"><property name="authenticationManager"><ref bean="authenticationManager"/></property><property name="accessDecisionManager"><ref bean="httpRequestAccessDecisionManager"/></property><property name="securityMetadataSource"><security:filter-security-metadata-source request-matcher="ant" use-expressions="false"><security:intercept-url pattern="/login.html" access="ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/externallogin.html" access="ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/logout.html" access="ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR,IS_AUTHENTICATED_FULLY" /><security:intercept-url pattern="/loginerror.html" access="ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/error.html" access="ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/exituser.html" access="ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR,IS_AUTHENTICATED_FULLY" /><security:intercept-url pattern="/home.html" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/flow.html" access="ROLE_USER,ROLE_ADMINISTRATOR,ROLE_ANONYMOUS" /><security:intercept-url pattern="/loginsuccess.html" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/listOlapViews.html" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/fillparams.html" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/j_spring_switch_user*" access="ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/fileview/**" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/olap/**" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/xmla" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/services/**" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/reportimage/**" access="ROLE_USER,ROLE_ADMINISTRATOR,ROLE_ANONYMOUS" /><security:intercept-url pattern="/heartbeatInfo.html" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/thumbnails/**" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/keys/**" access="ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/discovery/**" access="ROLE_USER,ROLE_ADMINISTRATOR, ROLE_ANONYMOUS" /><security:intercept-url pattern="/rest_v2/jobs/**" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/permissions/**" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/reports/**" access="ROLE_USER,ROLE_ADMINISTRATOR,ROLE_ANONYMOUS" /><security:intercept-url pattern="/rest_v2/resources/**" access="ROLE_USER,ROLE_ADMINISTRATOR,ROLE_ANONYMOUS" /><security:intercept-url pattern="/rest_v2/reportFonts/**" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/reportResources/**" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/api/resources/**" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/connections/**" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/contexts/**" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/reportExecutions/**" access="ROLE_USER,ROLE_ADMINISTRATOR,ROLE_ANONYMOUS" /><security:intercept-url pattern="/rest_v2/serverInfo/**" access="ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/application.wadl" access="ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/application.wadl/xsd0.xsd" access="ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/bundles/**" access="ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/settings/**" access="ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/customDataSources" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/jdbcDrivers" method="GET" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/404.html" access="ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/500.html" access="ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/reportGenerator.html" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/viewReportCancel.html" access="ROLE_USER,ROLE_ADMINISTRATOR,ROLE_ANONYMOUS" /><security:intercept-url pattern="/viewReportAsyncCancel.html" access="ROLE_USER,ROLE_ADMINISTRATOR,ROLE_ANONYMOUS" /><security:intercept-url pattern="/viewReportPageUpdateCheck.html" access="ROLE_USER,ROLE_ADMINISTRATOR,ROLE_ANONYMOUS" /><security:intercept-url pattern="/xdm.html" access="ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/getReportComponents.html" access="ROLE_USER,ROLE_ADMINISTRATOR,ROLE_ANONYMOUS" /><security:intercept-url pattern="/getrequirejsconfig.html" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/runReportAction.html" access="ROLE_USER,ROLE_ADMINISTRATOR,ROLE_ANONYMOUS" /><!--scheduler--><security:intercept-url pattern="/scheduler/jobsummary.html" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/scheduler/jobdetails.html" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/scheduler/main.html" access="ROLE_USER,ROLE_ADMINISTRATOR" /><!--dashboard--><security:intercept-url pattern="/dashboard/viewer.html" access="ROLE_USER,ROLE_ADMINISTRATOR,ROLE_ANONYMOUS" /></security:filter-security-metadata-source></property></bean>[/code] 3. applicationContext-security-pro-web.xml file: Edit the filters of id=filterInvocationInterceptorPROExtention to add ROLE_ANONYMOUS as below: <security:filter-security-metadata-source id="filterInvocationInterceptorPROExtention" request-matcher="ant" use-expressions="false"><security:intercept-url pattern="/adhoc/cacheadmin.html" access="ROLE_SUPERUSER" /><security:intercept-url pattern="/adhoc/cachedetail.html" access="ROLE_SUPERUSER" /><security:intercept-url pattern="/adhoc/querygovernorsettings.html" access="ROLE_SUPERUSER" /><security:intercept-url pattern="/log_settings.html" access="ROLE_SUPERUSER" /><security:intercept-url pattern="/customAttributes.html" access="ROLE_SUPERUSER" /><security:intercept-url pattern="/adminExport.html" access="ROLE_SUPERUSER" /><security:intercept-url pattern="/adminImport.html" access="ROLE_SUPERUSER" /><security:intercept-url pattern="/dataviewconverter.html" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/dashboard/designer.html" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/dashboard/viewer.html" access="ROLE_USER,ROLE_ADMINISTRATOR,ROLE_ANONYMOUS" /><security:intercept-url pattern="/dashboard/exporter.html" access="ROLE_USER,ROLE_ADMINISTRATOR,ROLE_ANONYMOUS" /><security:intercept-url pattern="/domaindesigner.html" access="ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/reportGenerators/**" access="ROLE_USER,ROLE_ADMINISTRATOR, ROLE_ANONYMOUS" /><security:intercept-url pattern="/rest_v2/domains/**" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/queryExecutor/**" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/queryExecutions/**" access="ROLE_USER,ROLE_ADMINISTRATOR,ROLE_ANONYMOUS" /><security:intercept-url pattern="/rest_v2/export/**" access="ROLE_SUPERUSER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/import/**" access="ROLE_SUPERUSER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/hypermedia/**" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/metadata/**" access="ROLE_USER,ROLE_ADMINISTRATOR" /><security:intercept-url pattern="/rest_v2/dashboardExecutions/**" access="ROLE_USER,ROLE_ADMINISTRATOR, ROLE_ANONYMOUS" /><security:intercept-url pattern="/rest_v2/diagnostic/**" access="ROLE_SUPERUSER" /><security:intercept-url pattern="/rest_v2/keys/**" access="ROLE_ADMINISTRATOR,ROLE_SUPERUSER" /><security:intercept-url pattern="/rest_v2/adhoc/bundles/**" access="ROLE_USER,ROLE_ADMINISTRATOR" /></security:filter-security-metadata-source>[/code] After making the above changes, save all the files and restart the server for the changes to reflect. The configuration files are also attached to this article for reference. Once the server has been restarted we can access a Dashboard with below similar URL (the below example is for accessing the sample Supermart Dashboard. You can change the URL accordingly for your Dashboard resource): http://localhost:8080/jasperserver-pro/dashboard/viewer.html?decorate=no&j_username=anonymousUser&j_password=#/public/Samples/Dashboards/1._Supermart_Dashboard _____________________________________________________________________________________________________________________________________________________________ Ref. Case #02151353 applicationcontext-security.xml applicationcontext-security-web_0.xml applicationcontext-security-pro-web_0.xml
  4. Requirement: To change the 'Select Data' view of the new Ad Hoc View create page to tree type from the list type Solution: 1. Download the required version source ZIP from the eDelivery website (for example, TIB_js-jrs_8.0.0_src.zip). 2. Unzip the source file in a working directory, like C:Jaspersoft 3. Locate the DatachooserDialogView.js file (C:JaspersoftJasperReports-Server-8.0.2-srcjasperserver-uiprojrs-ui-prosrcadhocdatachooserview) and open it in an editor. 4. Create a new variable for setting the tree type view in the beginning of the file, like: var TREE_TAB = 'tree'; //Add new TREE_TAB variable Next, modify the render: function () around line 377 of the file to reference the above created tree variable like below (DatachooserDialogView.js file attached for reference): render: function () { Dialog.prototype.render.apply(this, arguments); // connect search form to dialog header // connect search form to dialog header // connect search form to dialog header // connect search form to dialog header this._dfdRenderSerachFormTo.resolve(this.$tabHeaderContainer); this.openTab(TREE_TAB); // Default to TREE_TAB return this; } 5. Save the file. 6. Finally, to reflect the JavaScript source code customization on the UI we need to build the scripts using the newer Webpack approach. For complete steps on how to build the scripts, please see the section 5.2.3, "Customizing JavaScript Source Code" from our Ultimate Guide: https://docs.tibco.com/pub/js-jrs/8.0.2/doc/pdf/TIB_js-jrs_8.0.0_Ultimate-Guide.pdf?id=13 Alternatively, you can also watch the below Dr.Jaspersoft video on instructions for building scripts with Webpack: datachooserdialogview_0.js
  5. Requirement: To change the default visualization type in the Ad Hoc Editor from Crosstab to Table in JasperReports Server Solution: 1. Download the required version source ZIP from the eDelivery website (for example, TIB_js-jrs_8.0.0_src.zip). 2. Unzip the source file in a working directory, like C:Jaspersoft 3. Locate the DatachooserDialogView.js file (C:JaspersoftJasperReports-Server-8.0.2-srcjasperserver-uiprojrs-ui-prosrcadhocdatachooserview) and open it in an editor. 4. Enter 'table' for the reportType entry of the constructor: function (options) around line 77 of the file (DatachooserDialogView.js file attached for reference), like: constructor: function (options) { options || (options = {}); this._dfdRenderSerachFormTo = jQuery.Deferred(); var reportType = this._getParameterByName(ADHOC_REPORT_TYPE_PARAM_NAME); reportType = reportType || 'table'; //Default Ad Hoc View data selector to table this.reportType = reportType === 'chart' ? 'ichart' : reportType; this.decorate = this._getParameterByName(DECORATE_PARAM_NAME) || 'yes'; this.isEmbeddedDesigner = this._getParameterByName(IS_EMBEDDED_DESIGNER_PARAM_NAME); 5. Save the file. 6. Finally, to reflect the JavaScript source code customization on the UI we need to build the scripts using the newer Webpack approach. For complete steps on how to build the scripts, please see the section 5.2.3, "Customizing JavaScript Source Code" from our Ultimate Guide: https://docs.tibco.com/pub/js-jrs/8.0.2/doc/pdf/TIB_js-jrs_8.0.0_Ultimate-Guide.pdf?id=13 Alternatively, you can also watch the below Dr.Jaspersoft video on instructions for building scripts with Webpack: Further read: How to change the default visualization type in the Ad Hoc Editor from Crosstab to Table in JasperReports Server 7.9.x and older https://community.jaspersoft.com/wiki/how-change-default-visualization-type-ad-hoc-editor-crosstab-table-jasperreports-server-79x-and datachooserdialogview.js
  6. Problem: Is there a way to get a multi-tenant report of scheduled jobs to see what days and times they are running? I tried looking in the Audit Domain, but couldn't figure out how to narrow it down to future jobs. When logged in as superuser, I can see all jobs under View > Schedules, but I want to be able to use it as a report. In other words, I want to be able to sort the rows by a certain column (Next Run descending) and export the results to Excel. Is any of this possible? Solution: To create a report to know details of the scheduled job, including the future run times of the job, try running below query against the database. Note: This query is for Oracle, you can change it accordingly if required. select js.label as job_resource, jr.report_unit_uri as job_report_uri, jr.label as job_name, jr.id as job_id, ju.username || '|' || jt.tenantname as job_owner, qt.trigger_state, TO_TIMESTAMP('1970-01-01', 'YYYY-MM-DD' ) + NUMTODSINTERVAL(PREV_FIRE_TIME / 1000, 'SECOND') AS PREV_FIRE_TIME1, TO_TIMESTAMP('1970-01-01', 'YYYY-MM-DD' ) + NUMTODSINTERVAL(NEXT_FIRE_TIME / 1000, 'SECOND') AS NEXT_FIRE_TIME1, qt.start_time, qt.end_time from qrtz_triggers qt, jireportjob jr, jiuser ju, jitenant jt, jiresource js where qt.job_name = 'job_' || jr.id and jr.owner = ju.id and ju.tenantid = jt.id and jr.scheduledresource = js.id order by jt.tenantname, jr.report_unit_uri; Note that in the above query we have used the Oracle TO_TIMESTAMP function to convert the Unix time of the data stored in the database for the previous and next run in a human readable format. The time will be in GMT. ___________________________________________________________________________ Ref. Case #02146473
  7. Requirement: To hide group header from CSV export of the JRXML report. Solution: Use below two properties to hide the group header from the CSV export of your JRXML report: <property name="net.sf.jasperreports.export.csv.exclude.origin.band.2" value="groupHeader"/> <property name="net.sf.jasperreports.export.csv.exclude.origin.group.2" value="<group header name>"/> So, for example, if the group header name is Dummy, the above property will be: <property name="net.sf.jasperreports.export.csv.exclude.origin.group.2" value="Dummy"/> A sample test JRXML report is attached for reference. ___________________________________________________________________________ Ref. Case #02151318 actual_size.620.jrxml
  8. Requirement: How to speed up the display of Domain list when creating an Ad Hoc View. Currently, the Domain list is slow to show up when creating a new Ad Hoc View. Solution: There is a server configuration (XML) to Ad Hoc settings which can be configured to help in improving the display performance of the Domain list when creating a new Ad Hoc View. This configuration is present in the applicationContext-pro-settings.xml file (<jasperserver-pro>/WEB-INF/) under the adhocSettings map id, <util:map id="adhocSettings"> <entry key="commonTypes"> <util:list> <value>topic</value> <value>domainTopic</value> <value>semanticLayerDataSource</value> </util:list> </entry> <entry key="olapTypes"> <util:list> <value>mondrianConnection</value> <value>secureMondrianConnection</value> <value>xmlaConnection</value> </util:list> </entry> </util:map> When creating a new Ad Hoc View, JasperReports Server looks for ALL of the above resource types (commonTypes and olapTypes) when displaying the 'Choose Data' window. With the above configuration the idea is to allow users to modify the configuration so that the unnecessary types can be removed. In order to improve performance, the applicationContext-pro-settings.xml configuration can be changed to remove unnecessary commonTypes and olapTypes but you need to know what types you are using. For example, many clients do not use Topics, and would benefit from removing Topics from the Ad Hoc start page scope, because it could be a performance bottleneck for big repositories. After making the required configuration changes under the adhocSettings map id of the applicationContext-pro-settings.xml file, please save the file and restart the application server for the changes to reflect. _____________________________________________________________________________________________________________________________________________________________ Ref. Case #02129473
  9. Problem: Scheduled job is failing to send email notifications when it has huge data with the error - ERROR SecureExceptionHandlerImpl,JasperServerScheduler_Worker-1:125 - There was an error on the server. Try again or contact site administrators. (Error UID: df75204d-4e03-4b28-a690-3b66f62d7892) org.springframework.mail.MailSendException: Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 552 5.3.4 Error: message file too big ; message exception details (1) are: Failed message 1: com.sun.mail.smtp.SMTPSendFailedException: 552 5.3.4 Error: message file too big at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2358) ... Cause: This error - message file too big - means the file size as an email attachment is too big to be sent via an email, as set by your mail server. Solution: JasperReports Server does not have an in-built mail server. The configuration needs a mail server outside of the application in order for the scheduler to send email notifications and distribute reports. You may want to contact your server administrator responsible for the mail server setup to determine what is the allowable maximum mail message size and if it is possible to increase this limit. _____________________________________________________________________________________________________________________________________________________________ Ref. Case #02127913
  10. Requirement: To change the default visualization type in the Ad Hoc Editor from Crosstab to Table in JasperReports Server 7.9.x. Solution: Follow below steps to change the default visualization type in the Ad Hoc Editor from Crosstab to Table: 1. Take a backup copy of adhocStartMain.js file(<jasperserver-pro>/optimized-scripts/adhoc/). 2. Open the adhocStartMain.js file (<jasperserver-pro>/optimized-scripts/adhoc/) in an editor. 3. Search for "crosstab" and replace the first occurrence with "table". It might look something like var t=this._getParameterByName("reportType");t=t||"crosstab" 4. Save the file. 5. Restart the application server for the changes to reflect. ______________________________________________________________________________________________________________________ Ref. Case #02122686
  11. Problem: After migrating from JasperReports Server 7.5.x to 7.8.x, report rendering results in below error. How can we resolve this error? The report was not completed. An error occurred while executing it. net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Class net.sf.jasperreports.engine.util.JdkGlyphFixTextMeasurerFactory not found. at net.sf.jasperreports.engine.util.JRTextMeasurerUtil.getFactory(JRTextMeasurerUtil.java:157) ... Cause: The 'JdkGlyphFixTextMeasurerFactory' class has been removed in the newer versions of JasperReports Server, and it should not be used anymore. Instead, we now have the newer 'net.sf.jasperreports.text.measurer.factory.single.line' class as a replacement. Solution: Please review your JRXML report and see if you have reference to the 'JdkGlyphFixTextMeasurerFactory' class. If yes, try removing it from the report for its test run. Also, please check if you have below property present in the jasperreports.properties file (<jasperserver-pro>/WEB-INF/classses/). If yes, kindly remove it from the file, save the file, and restart the application server for the changes to reflect. net.sf.jasperreports.text.measurer.factory=net.sf.jasperreports.engine.util.JdkGlyphFixTextMeasurerFactory A sample jasperreports.properties file is attached for reference which shows the presence of the newer 'net.sf.jasperreports.text.measurer.factory.single.line' class. Kindly take a look. # the fast/single line text measurer factory net.sf.jasperreports.text.measurer.factory.single.line=com.jaspersoft.jasperserver.api.engine.jasperreports.util.SingleLineTextMeasurerFactory _____________________________________________________________________________________________________________________________________________________________ Ref. Case #02121776 jasperreports.properties
  12. Requirement: To turn off StatisticalLoggingSessionEventListener log trace in the jasperserver.log file (<jasperserver-pro>/WEB-INF/logs/). Is there a way to turn off the logging generated by org.hibernate.engine.internal.StatisticalLoggingSessionEventListener. We get messages like the following in the logs: INFO [org.hibernate.engine.internal.StatisticalLoggingSessionEventListener] (JasperServerMaintenanceScheduler_Worker-1) Session Metrics { 1029800 nanoseconds spent acquiring 1 JDBC connections; 0 nanoseconds spent releasing 0 JDBC connections; 35500 nanoseconds spent preparing 2 JDBC statements; 20501600 nanoseconds spent executing 2 JDBC statements; 0 nanoseconds spent executing 0 JDBC batches; 31700 nanoseconds spent performing 3 L2C puts; 0 nanoseconds spent performing 0 L2C hits; 0 nanoseconds spent performing 0 L2C misses; 0 nanoseconds spent executing 0 flushes (flushing a total of 0 entities and 0 collections); 2500 nanoseconds spent executing 2 partial-flushes (flushing a total of 0 entities and 0 collections) Solution: These log traces from StatisticalLoggingSessionEventListener are generated by the WildFly / JBoss application server. Recommended approach is to consult with your application server administrator to suppress such traces in the log file. However, you can check if you have hibernate statistics enabled in JBoss. When we enable hibernate statistics we get session statistics information every time a session is closed. If you do not want this behavior, you can disable it by adding the following entry in your log4j file: log4j.logger.org.hibernate.engine.internal.StatisticalLoggingSessionEventListener=OFF See below Stack Overflow post for more details: https://stackoverflow.com/questions/44494576/when-does-hibernate-print-statistics If the above does not seem to work, in addition to the log4j file, enable the above suggested logger in the .../configuration/logging.properties file and the .../configuration/standalone.xml file of your application server to see if it helps. Further, you may review below links to get more details on the StatisticalLoggingSessionEventListener class: Class StatisticalLoggingSessionEventListener: https://docs.jboss.org/hibernate/orm/5.0/javadocs/org/hibernate/engine/internal/StatisticalLoggingSessionEventListener.html Turning off hibernate logging console output: https://stackoverflow.com/questions/311408/turning-off-hibernate-logging-console-output _____________________________________________________________________________________________________________________________________________________________ Ref. Case #02120877
  13. Requirement: To show repeated values in Ad Hoc Crosstab. If we have a Crosstab and export it to Excel, repeated values are not shown and we only see the value once. e.g., Country User Amount Germany A 2 B 3 C 4 In Excel export this is pretty bad because we cannot filter anymore. Is there a way to generate Excel like this: Country User Amount Germany A 2 Germany B 3 Germany C 4 Solution: When we design the Ad Hoc View, we can select the option 'Unmerge Crosstab Cells' to display the repeated values. After this, the Ad Hoc View will display values as per our requirement, and can be exported in a way we want. Please refer below screenshot: From JasperReports Server 8.0.x, we can access the 'Merge cells' toggle from the right panel called 'Format Visualization'. Please refer below screenshot: _____________________________________________________________________________________________________________________________________________________________ Ref. Case #02120024
  14. Requirement: To enable the 'View SQL Query' option in the Ad Hoc Editor. Solution: By default, the 'View SQL Query' option is not enabled. We need to login as an admin user and go to Manage > Server Settings > Ad Hoc Settings to enable (check mark) 'Configure View Query'. This is discussed in the JasperReports Server Administrator Guide, section '8.5.1 Ad Hoc Query Settings'. https://docs.tibco.com/pub/js-jrs/8.0.2/doc/pdf/TIB_js-jrs_8.0.0_Admin-Guide.pdf?id=5 ____________________________________________________________________________________________________________________________________________ Ref. Case #02120024
  15. Requirement: We have a requirement to change the input control type from multi-select query to single-select query from just the UI without changing the query of the report under the 'Dataset and Query ...' tab in Studio. The parameter used in the report is of java.util.Collection class and the field used for the parameter is of java.lang.String. The query of the report is using the $X{} parameter. When we change the input control type to single-select query from the server UI, the report fails with the error - Invalid type java.lang.String for parameter used in an IN clause; the value must be an array or a collection. The purpose of this requirement is to have our report consuming clients be able to change the input control type just from the server UI without having to change the report structure from the backend, and still have a seamless experience when switching between single-select and multi-select query input control types. Is it possible to achieve this requirement of changing the input control type from multi-select query to single-select query just from the UI without changing the report query using the $X{} parameter? Solution: We can workaround this requirement by using two parameters. A test 'multiToSingleParameter.jrxml' report and its export catalog can be found in the attachments section of this article. The export catalog can be imported using the 'Legacy Key', and the report can be run using the sample Foodmart database. The relevant part is this: <parameter name="department_description" class="java.lang.Object" nestedType="java.lang.String"/> <parameter name="department_description_collection" class="java.util.Collection" isForPrompting="false"> <defaultValueExpression><![CDATA[iF($P{department_description} instanceof Collection, $P{department_description}, IF($P{department_description} == null, null, Collections.singleton($P{department_description})))]]></defaultValueExpression> </parameter> <queryString language="SQL"> <![CDATA[select * from department where $X{IN, department_description, department_description_collection}]]> </queryString> The query filters results for the department_description value(s) supplied. Explanation: Here, we have created two parameters: 1. department_description (which will be seen by the report consuming customers, and to which the customers will pass the required values). The parameter is of java.lang.Object class with the nestedType of our field data type, java.lang.String. 2. department_description_collection (used to meet our requirement to be able change the input control type from multi-select query to single-select query just from the UI without changing the query of the report under the 'Dataset and Query ...' tab in Studio.). The parameter is of java.util.Collection class with isForPrompting set to false. This is the main parameter to meet our requirement, which takes into consideration the $P{department_description} value in its default value expression and uses this expression to determine whether this parameter should be used for single-select or multi-select input control. Let us take a look at the default value expression of this parameter: <parameter name="department_description_collection" class="java.util.Collection" isForPrompting="false"> <defaultValueExpression><![CDATA[iF($P{department_description} instanceof Collection, $P{department_description}, IF($P{department_description} == null, null, Collections.singleton($P{department_description})))]]></defaultValueExpression> </parameter> IF($P{department_description} instanceof Collection, $P{department_description}, IF($P{department_description} == null, null, Collections.singleton($P{department_description}))) As mentioned earlier, the default value expression of this parameter takes $P{department_description} parameter value into consideration. It checks if $P{department_description} is an instanceOf Collection. If yes, then it passes the collection values supplied which can be used with multi-select input control type. Next, if it is not a collection, it checks if the value supplied to the $P{department_description} is null. If yes, then it passes the input control value as null. Finally, if not a single situation from the above is met, it means we are passing a single value to the department_description input control. The department_description_collection parameter handles this situation with the expression Collections.singleton($P{department_description}). This is used with single-select query input control. Again, a test 'multiToSingleParameter.jrxml' report and its export catalog can be found in the attachments section of this article. The export catalog can be imported using the 'Legacy Key', and the report can be run using the sample Foodmart database. Thank you for your time and attention to this article. Hope this detailed explanation and the solution helps you to achieve your requirement of seamlessly changing the input control type (multi-select to single-select query) just from the server UI without having to change the report structure from the backend in Studio. _____________________________________________________________________________________________________________________________________________________________ Ref. Case #02109620 multitosingleparameter.jrxml multitosingleselect.zip
  16. Requirement: To download the Diagnostic Report in JSON format using the rest_v2/reports REST Service Solution: In order to export the report in JSON format, the report is required to be designed for the JSON data export. Unfortunately, the Diagnostic Report is not designed for JSON data export. See below part from 'The reports Service' section of our REST API Guide for reference: https://community.jaspersoft.com/documentation/tibco-jasperreports-server-rest-api-reference/v790/reports-service#:~:text=As%20of%20JasperReports%20Server%206.0%2C%20it%20is%20also%20possible%20to%20specify%20json%20if%20your%20reports%20are%20designed%20for%20data%20export.%20For%20more%20information%2C%20see%20the%20JasperReports%20Library%20samples%20documentation. Because of this if you would directly download the Diagnostic Report in JSON, you may get a blank .json file. As a workaround, you may take a backup copy of the Diagnostic Report and try to configure its metadata for use with the JSON Data Exporter. Refer the 'Configuring a Report's Metadata for Use With the JSON Data Exporter' section from our Studio Guide for more details: https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v790/data-centric-exporters The simplest configuration is to add the following properties to the three Detail text fields in the Table: 1) <property name="net.sf.jasperreports.export.json.path" value="section"/> (for the text field in the Section column) 2) <property name="net.sf.jasperreports.export.json.path" value="attributes.name"/> (for the text field in the Attribute column) 3) <property name="net.sf.jasperreports.export.json.path" value="attributes.value"/> (for the text field in the Value column) Alternatively, you can add these JSON paths from the Studio UI by right-clicking the Table text fields, and selecting JSON Tags > JSON Metadata Path. Please check the 'jsonTag.png' screenshot attached for reference. A sample 'JSDiagnosticReport.jrxml' report configured for JSON data export, and a sample JSON output file after performing the above steps are attached for reference. _____________________________________________________________________________________________________________________________________________________________ Ref. Case #02105931 jsdiagnosticreport.jrxml jsdiagnosticreport.json
  17. Problem: Scheduled emails are being received for empty reports with 'No Data' band printed in the report output, even when the 'Do not send emails for empty reports' option is ticked at the time of schedule creation. We are adding a message in the 'No Data' band if the report doesn't result in any data. Looks like Jaspersoft is considering 'No Data' as data and not considering report as empty. No Data message used in our JRXML reports: The specified criteria didn't result in any data. This is often caused by applying filters and/or selections that are too restrictive or that contain incorrect values. Please check your Analysis Filters and try again. Cause: From JasperReports Library perspective, the report is not empty because it actually contains a page with elements. It displays something. But they are empty from an end user perspective, because they do not contain any useful information. Note that from the program perspective, we cannot say if a report is empty, if it actually contains some elements on a page. We have to be told it is empty, from a logical perspective, because we cannot asses this programmatically. Solution: As discussed above in the cause, from the program perspective, we cannot say if a report is empty, if it actually contains some elements on a page. We have to be told it is empty, from a logical perspective, because we cannot asses this programmatically. The custom property - com.jaspersoft.jrs.export.report.empty - can be used for this purpose. Set below property at report level to have the scheduler not send emails for reports with 'No Data' message: <propertyExpression name="com.jaspersoft.jrs.export.report.empty" evaluationTime="Report"><![CDATA[boolean.toString($V{REPORT_COUNT} == 0)]]></propertyExpression> Please find the test noData.jrxml report attached for reference. Further read: "Do not send emails for empty reports" - how to make it work when sub Dataset is empty https://community.jaspersoft.com/wiki/do-not-send-emails-empty-reports-how-make-it-work-when-sub-dataset-empty ______________________________________________________________________________________________________________________________________________________ Ref. Case #02103408 nodata.jrxml
  18. Problem: Trying to embed Dashboard in application using iframe but not able to change the view between 'Editing' and 'Viewing' as these options are placed far too below the drop-down menu to be able to click on (ISSUE.png screenshot attached). Cause: This is an issue with the core embedding functionality when working with iframe. A bug report with internal ticket number JS-65837 has been filed to analyze and resolve this issue. Solution: As this bug is being worked on to be fixed, a workaround, for now, would be to change the top height for the toggle menu in the toggleMenuTemplate.htm file (<jasperserver-pro>optimized-scriptsruntime_dependenciesbi-dashboardsrcdashboardtemplate) 1. Open the toggleMenuTemplate.htm file in an editor. 2. Change the top height from 73px to 35px, like: <div id="menu" class="menu vertical context toggleView hidden" aria-hidden="true" role="menu" tabindex="-1" js-navtype="actionmenu" style="right:8px; top:35px; z-index: 99999;"> <div class="content"> ... </div> </div> 3. Save the file, and restart the application server for the changes to reflect. 4. Next, since we have optimized the script under optimized-scripts, we will need to implement this updated script. See the 'Customizing JavaScript Files' section from our Ultimate Guide: https://community.jaspersoft.com/documentation/tibco-jasperreports-server-ultimate-guide/v780/customizing-javascript-files We can also test run the solution of editing the top height for the toggle menu before performing the implementation of optimized script by including the parameter &_opt=false in our URL, like: http://localhost:8080/jasperserver-pro/dashboard/viewer.html?decorate=no&_opt=false#%2Fpublic%2FSamples%2FDashboards%2F1._Supermart_Dashboard&j_username=superuser&j_password=superuser A simple HTML webapp (iFrameDashboard.html attached) that uses minimal HTML and no CSS besides width and height properties and one of the sample Dashboards is attached for reference. ______________________________________________________________________________________________________________________________________________________ Ref. Case #02095785 iframedashboard.html
  19. Requirement: You have a database field that stores local image paths. You want to use these images to display a different image on each row of a JRXML report. Solution: For this use case, the approach to be followed would be to have a database field that pulls local image paths from report database. For example: $F{path_to_image_on_local_machine}, and to use this field for the image expression in the JRXML report. Sample JRXML report, SQL queries, and screenshot of the report run are attached for reference. ______________________________________________________________________________________________________________________________________________________ Ref. Case #02101911 sql_differentimageineachrow.txt differentimageineachrow.jrxml
  20. Requirement: To set a desired date format for date input controls / filters, and for the fields including date data across JasperReports Server Solution: Let's say we want our date format to be MM/dd/yyyy. To set this date format for date input controls / filters, and for the fields including date data across JasperReports Server, we would need to make changes in the following 3 configuration files: 1. jasperreports.properties file (<jasperserver-pro>/WEB-INF/classes) 2. adhoc_masks.properties file (<jasperserver-pro>/WEB-INF/bundles) 3. jasperserver_config.properties file (<jasperserver-pro>/WEB-INF/bundles) Now that we know which all files are required to achieve our requirement, let's see what changes we need to make in each of these files: jasperreports.properties file (<jasperserver-pro>/WEB-INF/classes): This file is required to change the date format for .jrxml reports having date fields. To define the global date format for .jrxml reports in the jasperreports.properties file, follow below steps: 1. Open the jasperreports.properties file in an editor. 2. Search for the properties net.sf.jasperreports.text.pattern.date and net.sf.jasperreports.text.pattern.datetime, and define the desired date and date time format to these properties, respectively. For our example date format of MM/dd/yyyy, the properties would look like: ... net.sf.jasperreports.text.pattern.date=MM/dd/yyyy net.sf.jasperreports.text.pattern.datetime=MM/dd/yyyy HH:mm:ss 3. Save the file. 4. Restart the application server for the changes to reflect. adhoc_masks.properties file (<jasperserver-pro>/WEB-INF/bundles): For Ad Hocs, we can define the desired date format in the adhoc_masks.properties file (<jasperserver-pro>/WEB-INF/bundles). To do this, follow below steps: 1. Open the adhoc_masks.properties file in an editor. 2. Define the desired date format next to the current last ADH_100_MASK_date_x property, for example: ADH_100_MASK_date_0 = medium,hide ADH_100_MASK_date_1 = short,hide ADH_100_MASK_date_2 = long,hide ADH_100_MASK_date_3 = MM/dd/yyyy For defining a desired date timestamp format in addition to the above date format for Ad Hocs, in the same adhoc_masks.properties file, add desired ADH_100_MASK_timestamp_x next to the current last ADH_100_MASK_timestamp, like: ADH_100_MASK_timestamp_0 = medium,hide ADH_100_MASK_timestamp_1 = short,hide ADH_100_MASK_timestamp_2 = long,hide ADH_100_MASK_timestamp_3 = medium,medium ADH_100_MASK_timestamp_4 = hide,medium ADH_100_MASK_timestamp_5 = MM/dd/yyyy HH:mm:ss 3. Save the file. 4. Restart the application server for the changes to reflect. jasperserver_config.properties file (<jasperserver-pro>/WEB-INF/bundles): For input controls and filters, and data value to display in the desired date format, in addition to making changes to the above 2 files, we also need to make changes in the jasperserver_config.properties file (<jasperserver-pro>/WEB-INF/bundles). To get the desired date format as MM/dd/yyyy, follow below steps: 1. Open the jasperserver_config.properties file in an editor. 2. Define the values for the properties date.format, datetime.format, and time.format as below: date.format=MM/dd/yyyy datetime.format=MM/dd/yyyy HH:mm:ss time.format=HH:mm:ss The above configuration is used for parsing and formatting dates by the server 3. Next, define the calendar.date.format, calendar.datetime.format, and calendar.time.format properties as below: calendar.date.format=mm/dd/yy calendar.datetime.format=mm/dd/yy HH:mm:ss calendar.time.format=HH:mm:ss These are used for parsing and formatting dates by the calendar component (UI). 4. Save the file. 5. Restart the application server for the changes to reflect. In the last configuration file, jasperserver_config.properties, please note how we have defined the values for the calendar properties to have the date format displayed as MM/dd/yyyy when we select a value from the calendar picker on the UI. Calendar component date patterns are different from the patterns used on the server (date.format, datetime.format, and time.format). We need to carefully define the values for the calendar.date.format, calendar.datetime.format, and calendar.time.format properties to have the desired date format displayed once we have selected our date value from the calendar picker on the UI, else we may face some error. The format for calendar component can be combinations of the following: # d - day of month (no leading zero) # dd - day of month (two digit) # o - day of year (no leading zeros) # oo - day of year (three digit) # D - day name short # DD - day name long # m - month of year (no leading zero) # mm - month of year (two digit) # M - month name short # MM - month name long # y - year (two digit) # yy - year (four digit) So, for our example of server pattern MM/dd/yyyy, the values for the properties - calendar.date.format, calendar.datetime.format, and calendar.time.format - should be defined as below: calendar.date.format=mm/dd/yy calendar.datetime.format=mm/dd/yy HH:mm:ss calendar.time.format=HH:mm:ss Hope this detailed explanation helps you to achieve your desired date format on JasperReports Server. Thank you for your time and attention to this article. ___________________________________________________________________________ ___________________________________________________________________________ Ref. Case #02092110
  21. Requirement: How NOT to print line element from the Background band on the last page? We want to have border lines on the edges of every page, so for this report template we have 4 line elements placed in the Background band. But, we don't want this border to be printed on the last page of the report. How can we achieve this requirement? Solution: Line elements don't have delayed evaluation at all, and to avoid printing Background on the last page, we would need to use an expression which includes evaluationTime=Auto. So, instead of using Line element in the Background band, we would need to use a text field with evaluationTime=Auto and with a left border expression that uses a variable $V{CURRENT_PAGE}. To achieve the requirement, follow below steps: 1. Create a current page variable, like: <variable name="CURRENT_PAGE" class="java.lang.Integer" resetType="Page"> <variableExpression>$V{PAGE_NUMBER}</variableExpression> </variable> 2. Next, add a text field in the Background band with evaluationTime=Auto and with a left border expression that uses $V{CURRENT_PAGE}, like: <textField evaluationTime="Auto"> <reportElement x="0" y="0" width="0" height="600"> <propertyExpression name="net.sf.jasperreports.style.box.left.pen.lineWidth">IF(EQUALS($V{PAGE_NUMBER}, $V{CURRENT_PAGE}), "0", "1")</propertyExpression> </reportElement> <textFieldExpression>$V{PAGE_NUMBER} + " " + $V{CURRENT_PAGE}</textFieldExpression> </textField> A test noBackgroundOnLastPage.jrxml report which can be run using the sample Foodmart DB, and its PDF output file, noBackgroundOnLastPage.pdf, can be found in the attachments section of this article for reference. Explanation for the above expression: As already mentioned, Line element doesn't have delayed evaluation, so to prevent the Line element from printing on the last page, we would need to use an expression which includes evaluationTime=Auto. Let us understand what that means, the variable created, $V{CURRENT_PAGE}, the built-in variable used to do a comparison with the current page, $V{PAGE_NUMBER}, and the working of our expression solution. In the solution above, we have created a variable $V{CURRENT_PAGE}. This variable is created with resetType="Page" to get a counter of every page, so that we can later compare it to the built-in variable $V{PAGE_NUMBER} (more about this built-in variable later in the article). Here, let us also understand the functioning of the resetType. The resetType for our $V{CURRENT_PAGE} variable created is set as Page, which means the counter of the variable $V{CURRENT_PAGE} would change with every page. So, when on the first page the value of $V{CURRENT_PAGE} would be 1, then on the second page - 2, on the third page - 3, and so on. Now, let us understand how we have used the built-in variable $V{PAGE_NUMBER} in our solution. If we would check the solution above again, we have used the variableExpression for the $V{CURRENT_PAGE} as $V{PAGE_NUMBER}. The $V{PAGE_NUMBER} is used to display both, the current page number and the total number of pages using a special feature of JasperReports text field elements, the evaluationTime attribute. The $V{CURRENT_PAGE} variable uses $V{PAGE_NUMBER} as its expression, and the resetType set for the $V{CURRENT_PAGE} is Page. So here the built-in variable $V{PAGE_NUMBER} is used to display the current page of the report. When on the first page the value of $V{CURRENT_PAGE} would be 1, then on the second page - 2, on the third page - 3, and so on. In the second point of the solution, we have used a text field element with evaluationTime as Auto, and a propertyExpression which compares the $V{PAGE_NUMBER} with $V{CURRENT_PAGE}. Here, the $V{PAGE_NUMBER} acts as a total page number because the evaluationTime set is Auto and the built-in variable $V{PAGE_NUMBER} is evaluated at the end of the report because it has resetType="Report". (a little insight of evaluationTime="Auto" The evaluationTime="Auto" set for the text field means that the variable participating in the text field expression is evaluated at a time corresponding to its reset type. For example, Fields $F{} are evaluated Now. $V{PAGE_NUMBER} is evaluated at the end of the report because it has resetType="Report".) Finally, let us check the working of the propertyExpression from the second point of our solution. For example, let us say our report is of 3 pages. The propertyExpression does a comparison of the $V{PAGE_NUMBER} and $V{CURRENT_PAGE}. <propertyExpression name="net.sf.jasperreports.style.box.left.pen.lineWidth">IF(EQUALS($V{PAGE_NUMBER}, $V{CURRENT_PAGE}), "0", "1")</propertyExpression> On the first page, $V{PAGE_NUMBER}=3, $V{CURRENT_PAGE}=1. Is $V{PAGE_NUMBER} equals to $V{CURRENT_PAGE}? No, hence the line will be printed. On the second page, $V{PAGE_NUMBER}=3, $V{CURRENT_PAGE}=2. Is $V{PAGE_NUMBER} equals to $V{CURRENT_PAGE}? No, hence the line will be printed. On the third page, $V{PAGE_NUMBER}=3, $V{CURRENT_PAGE}=3. Is $V{PAGE_NUMBER} equals to $V{CURRENT_PAGE}? Yes, hence the line will NOT be printed. Hope this detailed explanation clears the understanding of the above solution. Again, a test noBackgroundOnLastPage.jrxml report which can be run using the sample Foodmart DB, and its PDF output file, noBackgroundOnLastPage.pdf, can be found in the attachments section of this article for reference. Thank you for your time and attention to this article. _____________________________________________________________________________________________________________________________________________________________ _____________________________________________________________________________________________________________________________________________________________ Ref. Case #02082670 nobackgroundonlastpage.jrxml nobackgroundonlastpage.pdf
  22. Requirement: To create an IBM i DB2 (AS400) JDBC data source on JasperReports Server Solution: The JDBC Driver required for establishing a JDBC connection with IBM i DB2 (AS400) database on JasperReports Server is not present out-of-the-box. We need to download and install the appropriate Driver JAR file for establishing a successful JDBC connection with IBM i DB2 (AS400) on JasperReports Server. As per your requirements, you may use or download the required JDBC Driver. The most common JDBC Driver JAR file used with IBM i DB2 (AS400) database is jt400.jar. This JAR file may be supplied to you by your client, or you may download it from the IBM's website. Next, follow below steps to create an IBM i DB2 (AS400) JDBC data source on JasperReports Server: 1. Add the jt400.jar to your application server's class path (e.g <tomcat>/lib and <jasperserver-pro>/WEB-INF/lib), and restart the application server. 2. Login to JasperReports Server as superuser. Then, click on Create > Data Source. 3. For the JDBC Driver, select 'Other...' option. For JDBC Driver (required), enter your jt400.jar's driver class (com.ibm.as400.access.AS400JDBCDriver). 4. Next, enter other related configurations for your IBM i DB2, like JDBC connection URL, and username and password. The URL should be in format jdbc:as400://<serverName:Port>;libraries=<libraryName>;prompt=false;user=<userID>;password=<password>. 5. Test the connection, and then click on Save. Please note that the JDBC connection URL should be in the above suggested format, else we may encounter errors when testing the connection, like 'The application requester cannot establish the connection. (Connection was dropped unexpectedly.)'.
  23. What is the difference between a Domain and a Topic? --> A Domain is a virtual view of a data source that presents the data in business terms, allows for localization, and provides data-level security. A Domain is not a view of the database in relational terms, but it implements the same functionality within JasperReports Server. The design of a Domain specifies tables in the database, derived tables, join clauses, calculated fields, display names, and default properties, all of which define items and sets of items for creating Topics and reports. A Topic is a predefined set of fields, filters, and input controls defined by a particular query against a data source or Domain, input controls to create Ad Hoc Reports. Topics are created by business analysts to specify a data source and a list of fields with which business users can easily create reports in the Ad Hoc Editor without having to define the data relationships. The Topic is a helper component where once the report has been created, it does not directly rely on the Topic; meaning changes to Topics will not impact existing reports. In short, a Topic is a data source for creation of Ad Hoc Views, but it is like a subset/sub-data of the Domain where you pre-select items and filtering so Ad Hoc Views can be created based on this subset instead.
  24. Problem: When using Dec 31, 2021 (31-12-2021) as the date value in the date filter of the Ad Hoc, it displays an increment of 1 year (Dec 31, 2022 / 31-12-2022) in the Ad Hoc data. Cause: The error comes from the pattern expression we use in the adhoc_masks.properties file (<jasperserver-pro>/WEB-INF/bundles). When we format dates in Java, there is a subtle difference between YYYY (uppercase) and yyyy (lowercase). They both represent a year but yyyy (lowercase) represents the calendar year while YYYY (uppercase) represents the year of the week. That’s a subtle difference that only causes problems around a year change of the last week of the year. Solution: To display the date values correctly, follow below steps: 1. Open the adhoc_masks.properties file (<jasperserver-pro>/WEB-INF/bundles) in an editor. 2. Add below date format at the end of ADH_100_MASK_date_x, like: (Note: You may remove the format with YYYY (uppercase) from here if not required to avoid any future confusions. We can also just keep the first three formats, and it should work fine.) ADH_100_MASK_date_0 = medium,hide ADH_100_MASK_date_1 = short,hide ADH_100_MASK_date_2 = long,hide ADH_100_MASK_date_3 = dd-MM-yyyy 3. Save the file, and restart the server for the changes to reflect.
  25. Requirement:To remove "Need help logging in" from login page. Solution:To remove "Need help logging in" from login page, please follow below steps: Open the login.jsp file (<jasperserver-pro>/WEB-INF/jsp/templates) in an editor. Search for the ID "needHelp", and add class="hidden" to its h2 tag, like: <h2 class="hidden"><a id="needHelp"><spring:message code='LOGIN_NEED_HELP_LINK'/></a></h2> Save the file, and restart the server for the changes to reflect.
×
×
  • Create New...