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

Friendly User

Members
  • Posts

    435
  • Joined

  • Last visited

  • Days Won

    2

 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 Friendly User

  1. Scenario:You've upgraded version of Tomcat and trying to deploy JasperServer into it. The deployment seemed to go fine, no errors in buildomatic but server still fails to start. In the logs you see the message similar to this: SEVERE [main] org.apache.catalina.util.LifecycleBase.handleSubClassException Failed to start component [Connector[AJP/1.3-8009]] org.apache.catalina.LifecycleException: Protocol handler start failed at org.apache.catalina.connector.Connector.startInternal(Connector.java:1067) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:438) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.Catalina.start(Catalina.java:772) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473) Caused by: java.lang.IllegalArgumentException: The AJP Connector is configured with secretRequired="true" but the secret attribute is either null or "". This combination is not valid. at org.apache.coyote.ajp.AbstractAjpProtocol.start(AbstractAjpProtocol.java:270) at org.apache.catalina.connector.Connector.startInternal(Connector.java:1064) ... 12 more[/code]What can be done about this issue? Solution:This is a tomcat vulnerability fix and it comes from tomcat itself: https://access.redhat.com/solutions/4851251 You don't really need AJP connector to be defined in server XML for jasperserver to function. You can check for different solutions in this article: https://community.jaspersoft.com/wiki/fixing-tomcat-cve-2020-1938-tibco-jasperreporrts-server Or you can comment out the AJP connector on port 8009 in server.xml if you're not planning to use it
  2. Scenario: In your report or ad hoc template you're using DATERANGE() function to construct a date range from a string (i.e. DAY, WEEK, MONTH, etc.) When report with such function is deployed on the JasperServer, for the WEEK value the start and end of the week is incorrect: server is configured for start to be Monday and end to be Sunday but the start is Saturday and end is Sunday. How to avoid this problem? Solution: the DATERANGE() function builds the Date Range object with report locale instead of the bundle that is specified in the JRS. It's a built-in JasperReports function that is separate from JasperServer. You could try constructing a date range in the following fashion: new net.sf.jasperreports.types.date.DateRangeBuilder((String) $F{value}).set($P{REPORT_TIME_ZONE}).toDateRange()
  3. Scenario: You want to display the values of organizational or server profile attributes in a report. Is there a way to do that? Solution: https://community.jaspersoft.com/wiki/built-parameters-logged-user you should be able to access the profile attributes through the built in parameter: ServerAttribute_<attribute name> Attribute_<attribute name> Both are of type string, if you define them on the report level and deploy the report to the server, the value should be populated accordingly.
  4. Scenario: You have JasperServer currently running on PostrgreSQL repository DB and you want to switch to Oracle. After creating JasperServer DB in Oracle and modifying the META-INF/context.xml file, the server doesn't start and throwing an error: How to avoid this error? Solution: JasperServer uses different Hibernate dialects to form queries for the database. If you've changed the repoistory DB type you need to also change the dialect in {JRS WAR}/WEB-INF/hibernate.properties: metadata.hibernate.dialect=com.jaspersoft.hibernate.dialect.PostgresqlNoBlobDialect - > metadata.hibernate.dialect= com.jaspersoft.ji.hibernate.dialect.OracleJICustomDialect Save and restart after doing the changes
  5. Scenario:You've installed the new version of TIBCO JasperReports® Server 7.8.0 on Windows using the bundled all-in-one installer (TIB_js-jrs_7.8.0_win_x86_64.exe). You had already previous versions of the product installed on the same machine under the same user account. After the installation you cannot start the newest version of the server with the error: "Could not locate: org.apache.commons.configuration2.io.FileLocator@4ff6da37[fileName=.jrsksp,basePath=C:UsersMyUser" How to resolve this problem? Solution:To resolve this problem you will need to locate the .jrsks and .jrsksp under the personal folder of the user that was performing the installation, e.g. C:UsersMyUser. These files need to get a new set of permissions assigned to user LOCAL SERVICE: Right click on the file > Properties Go to Security tab. Select LOCAL SERVICE in the "Group or user names" list: Press Edit and check "Read" and "Read & Execute" in the Allow Column: Press OK > OK Restart Tomcat
  6. Scenario:You've upgraded to TIBCO JasperReports® Server 7.5.1 and your reports with Highchart formatter object in the formatter functions are no longer running. Here is an example of a function: [toc]function() { if (this.y >= 1000000) { return Highcharts.numberFormat(this.y / 1000000,1)+"M" } else if (this.y > 1000. ) { return Highcharts.numberFormat(this.y / 1000, 1)+"k"; } else { return Highcharts.numberFormat(this.y,1) } }[/code]You also have the property set accordingly. com.jaspersoft.jasperreports.highcharts.function.properties.allowed=true[/code]When running the report on the server you get a javascript error: Highcharts is not defined How to resolve this issue? Solution:This issue is caused by a defect. Recommended path would be to either apply the hotfix: hotfix_JRSPro7.5.1_cumulative_20200720_1831.zip. Alternatively upgrade to JasperReports® Server 7.8.0 will resolve the problem.
  7. Scenario:You have an HTML5 chart that renders something like 20.000 from the database. You don't see any decimal spaces and would want to add them. Solution:The decimal spaces for the values that don't have any decimal values get removed by default. You can force the decimal spaces to be displayed by going to Chart Formatting > Tooltip > Formatting and specifying values for the Value Decimal. See this video for more info on chart tooltip formatting:
  8. Scenario:You've upgraded from previous versions of TIBCO JasperReports® Server (pre-7.5.0) to the newer ones (7.8.x and higher) and keep getting the error " visualize.js:68 - container.not.found.error : Container was not found in DOM" when trying to run your visualize.js embeds. There are no additional errors in the server logs or on client side. Why would this be the case? Solution:Visualize.js requires you to pass a container (div) where the results will be output. This error indicates that the container has not been found. This may be an issue where you passed jQuery pointers to your containers in visualize.js calls. Such pointers are no longer accepted. You need to specify the container similarly to how it's done in the samples: https://tibcosoftware.github.io/js-visualize/
  9. Scenario:When trying to upload the resources such as report JRXML's or images you constantly get " The file was not uploaded. Please try again." message on the UI but there are no errors logged in the browser console or server log files. What could be the issue here? Solution:One of the issues here may be extra WAR files deployed in the same Tomcat or other application server that conflicts with TIBCO JasperReports® Server. One of the more popular examples of this is having JavaMelody deployed in the same Tomcat which causes conflict with JasperReports Server. Try to undeploy the additional WAR's and deploy just JasperServer.
  10. Scenario:You have designed the report and want to remove the fields from being displayed if Print When Expression is not satisfied. You don't see the fields displayed but there are still empty rows present in their place. How to get rid of these rows? Solution:When applying the Print When Expression directly to the fields, only the field elements will be affected. The band where the fields are (detail band, group header/footer, etc.) is still printed because there is no reason for it to be suppressed or hidden. You need to apply the Print When Expression to the band as well.
  11. Scenario:When logging in to JasperServer you see three fields - organization, username and password. You would like to hide the organization input from the log in page. How to do that? Solution:The organization field will not be shown when logging in if your server just has one organization. You will need to remove all the extra organizations, including the sub organizations for organizations, and the organization field will not show. Alternatively if you know you won't be logging in to organizational users and will only use the LDAP users or want to pass the organization name in the username field you can do the following modification: Go to {JasperServer Pro WAR}/WEB-INF/jsp/templates/login.jsp, locate the following block: Comment the block out and restart. This will hide the organizations field and all your logged in users will assume null for organization value (e.g. you can log in only as root org users). If you still need to specify the org in this case, you can pass the organization value through the username: jasperadmin|organization_1
  12. Scenario: You have built a chart and the engine has created intervals on your axis. For example, chart defaults to every 25k values on the x axis but you wish to set the labels to be every 20k. How to do that? Solution: You can use yAxis and xAxis tickInterval properties to set the intervals on the axis. To use them, go to Edit Chart Properties > Chart Formatting > Advanced properties > Expand xAxis or yAxis folder of properties and locate the tickInterval. Set the value to desired.
  13. Scenario: You have an ad hoc view that does a count or sum of integers. The values in the crosstab and table are displayed fine but you get the decimal places for these values in the chart mode. How to avoid that? Solution: Click on the cogs icon on a chart and go to Chart Format > Advanced >Add a new property and add tooltip.valueDecimals and set value to 0.
  14. Scenario: You have a pie chart and would want to show what percentage does the given slice occupy in the chart. Is it possible to do without additional calculations? Solution: Yes, you can change the tooltip.pointFormat or other "format"-properties and have it display the {point.percentage:.2f} variable. For example: The value of the slice is: {point.percentage:.2f}% This will change the format of the tooltip and have it show the percentage value for the slice. For more information on how to define the formatString please read this article: https://community.jaspersoft.com/wiki/format-string-html5-charts
  15. Scenario: You have a heatmap and would like to add borders between cells for better readability. The available advanced properties don't have any property that suggests changing that. How to add the border? Solution: The property for the heatmap borders is not included in the properties available in the advanced property window. However, you can add them manually by pressing the Add button in the advanced formatting properties view and type: plotOptions.heatmap.borderWidth - pass a numeric value, like 1 to make borders appear. plotOptions.heatmap.borderColor - pass a color, can be web color name like black or red or can be a hexadecimal value.
  16. Scenario: You have created a heatmap in JasperSoft Studio by defining the X Axis, Y Axis and Value expressions. When you preview the heatmap it's all one solid color. What is the issue? Solution: You need to explicitly define the colorAxis.minColor and colorAxis.maxColor in the advanced properties. Go to Chart Formatting > Show Advanced Properties > Expand the colorAxis folder and locate minColor and maxColor. Explicitly select a color so that these properties are marked yellow (modified).
  17. One can use Format String to format labels in the HTML5 charts. A format string is a template for labels, where variables are inserted. The variables are inserted using the curly braces notation, for example {point.x}, {series.name}. An example of a format string: "The point X value is {point.x} and Y value is {point.y}" This format string will show the respective x and y values of the data point when displayed. One can use {point}, {series}, {value}, {x}, {y} in the format string, depending on the property you'll be applying it to. The properties that will expect a format string are named format or end with format, such as tooltip.pointFormat or xAxis.labels.format. {point}, {series}, {x} and {y} can be used in all labels formats, {value} are applicable to axis labels. You can see what members of point and series class you can access in the format string here: https://api.highcharts.com/class-reference/Highcharts.Point https://api.highcharts.com/class-reference/Highcharts.Series You can apply number formatting to your point, for example: "{point.y:.2f}" - display two decimal spaces, no thousands separator "{point.y:,.0f}" - display no decimal places and use , as thousands separator "{point.y:,.1f}" - display one decimal place and use , as a thousands separator General rule in this formatting is that you place a : and then right after it specify whether you want to use a thousands separator or not by placing a comma, then you put a dot and you specify the number of decimal places with the number after the dot and then you add f. You can also use HTML tags in your format string.The following tags are supported: <b>, <strong>, <i>, <em>, <br/>, <span> [/code]You can also specify the style for the span. For example: <span style="font-size:22px; color: {point.color}; font-weight: bold; text-align: center">{point.y:,.2f}</span>[/code]See attached sample that demonstrates how to use format string with tooltips and data labels.
  18. Scenario: In the background of Hadoop, when you run a query through Hive, it will use some yarn queues to dispatch the workload of MapReduce. Each queue has some limits in terms of resources they can use and so on. This is used to manage priorities and make sure you can run some different jobs in parallel. In the default Hive driver one can set the queue(mapreduce.job.queuename=myQueue): jdbc:hive://localhost:18000/default2;AuthMech=3;UID=cloudera;PWD=cloudera;mapreduce.job.queuename=myQueue Using the Tibco Hive driver, it is always going to the default queue. Is there a parameter we could add to the URL that would accomplish the ability to select the queue we want? Solution: The driver uses the default queue by design but there is a way to set the queue through the initialization string: jdbc:tibcosoftware:hive://HiveServer;User=test@abccorp.com;Password=secret;InitializationString=(set mapreduce.job.queuename=myQueue) The UI validation, however, does not allow spaces in the JDBC URL for the Hive connection. You can avoid this problem in two ways: Create a data source without the space in the JDBC URL, save it, export it and then inside the export archive edit the XML file to set the correct JDBC URL with spaces in it and import the archive back to the server with the Update flag.Change the validation configuration. To do that:
  19. Scenario:You've updated to TIBCO JasperReports® Server 7.5.0 from a lower version and now when running the reports you no longer see the refresh button or last refreshed time stamp. Why is that and how to resolve this? Solution:When upgrading you might have upgraded with the old default theme. If your new JasperServer looks more or less like the previous version then it is definitely the case and you'll need to re-import the default theme. To do that: Download the attached default75.zip from this articleStop Tomcat that is running the JasperReports ServerPerform the import operation of the default75.zip: ./js-import.sh --input-zip default75.zip --update --keyalias deprecatedImportExportEncSecretRestart tomcat.
  20. Scenario: You are creating a report that uses a CSV file as a data source. You want to use a table or a crosstab in a report and have created a subdataset element in the report for that. When the report is previewed, nothing is displayed in the table. How to proceed here? Solution: Assuming you will be using the same data source in the subdataset, you will need to do the following: In the table/crosstab element properties go to Data set tabdo "Use a JRDataSource expression" and then pass $P{REPORT_DATA_SOURCE} in thereClick on Parameters Map button and put $P{REPORT_PARAMETERS_MAP}Preview
  21. Scenario:You want to remove the "Home" button from the TIBCO JasperReports® Server UI or show it only to certain users. How to do that? Solution:The button display conditions are speficied in the file {JRS WAR}/WEB-INF/actionModel-navigation.xml. You will need to edit the file and locate the following line: <context name="main_home_mutton"/>[/code]To add a condition to the button, add checkAuthenticationRoles" testArgs="ROLE_ID" inline of the tag. For example: <context name="main_home_mutton" test="checkAuthenticationRoles" testArgs="ROLE_ADMINISTRATOR"/>[/code]If you surround the mutton with the condition like this: <condition test="checkAuthenticationRoles" testArgs="ROLE_ADMINISTRATOR"> <context name="main_home_mutton"/></condition>[/code]It will show an error for users when logging in. You will need to restart the server after making the change
  22. Scenario:You have a JSON file that can be used as a data source from report. In TIBCO JasperReports® Server you want to create a new domain based on that JSON file and allow users to build ad hoc reports. How to achieve this? Solution:JasperReports® Server provides a few types of JSON based data sources and most of them include domains. The best one to use currently (7.5.0) is to use a JSONQL data source. To use that data source and build a domain over it you'll need to do the following: Enable the data source in the server. To enable it, edit the {JRS WAR}/WEB-INF/applicationContext-remote-services.xml. In the file locate the following list: <util:set id="customDataSourcesToHide"> Inside the set, comment out jsonQLDataSource: <!--value>jsonQLDataSource</value-->Save the file and restart JasperReports ServerIn JasperServer, create a new data source. In the data source type, select JSONQL Data Source.Configure the data source. Specify the location of your JSON file in the repository or provide a web URL where the file can be obtained from.Configure the number pattern and date pattern. Both can be left as empty but your dates and numbers in that case will be recognized as strings. The patterns are standard Java patterns:In the Query section just put an asterisk *. This means that we are going to select everything from the file.Use connection set to default false. This flag indicates whether we want to use the query from the data source exclusively or use the report query which can be different. In case of domains it doesn't matter but if you want to base other reports on this data source and have their query influence the result set, this needs to be set to falseSave the data sourceCreate a domain. In the domain data source, specify the JSONQL data source as the domain sourceSelect the tables, create the domain, proceed to use with ad hoc editorNB: JSONQL itself is a powerful data source with it's own JSON query language. You can read more about it here: http://jasperreports.sourceforge.net/sample.reference/jsonqldatasource/index.html
  23. In TIBCO JasperReports® Server there are multiple places where you can set the time zone: JVM time zone (Server time zone), user session time zone, JDBC time zone for JDBC data sources, report time zone. How do these time zones work? Let's take a closer look at these time zone configurations: JVM Time zone or Server time zone - this is set on the JVM level through the -Duser.timezone JVM option. Unless explicitly specified, it will default to OS time zone. This is the time zone that will be used by the server as a baseline. The inputs will be adjusted to this time zone and the database drivers will assume this time zone when communicating with the database unless a specific time zone is provided in the JDBC connection information. Not all drivers are capable of doing that, for some drivers such as PostgreSQL this will be the one used. User session time zone - this time zone is selected by the user during the log in and is stored in the session cookie. By default it is the same as the JVM time zone if the time zone selector in login interface allows it (e.g. if your JVM is in America/Los_Angeles, the users by default will log in with America/Los_Angeles TZ. If your server is in America/Honolulu and the time zone selector doesn't have America/Honolulu then the first value from the list is assumed). Users can select any TZ from the list when they log in Report time zone - this time zone is stored in the built-in parameter REPORT_TIME_ZONE in the report. It is inherited from the user session time zone and always matches it unless there is a custom mechanism in place to prevent that. JDBC Time zone - this time zone is set on the JDBC data source definition level. So with the knowledge of where these are set, let's assume we're passing a time stamp through a date/time input control to the database. What happens in this situation? The time input control is assuming the timestamp is being input in the time zone in which user is logged. The input is adjusted accordingly to the time difference between the server time zone and the session time zone, e.g. the hours added or subtracted from the input. This is done so that the date input is passed to the JVM in the JVM time zone for the calculation purposes. There is a way to turn off this behavior in applicationContext-formatting.xml, the applyClientTimezoneFormatting needs to be set to false for the types you don't want to be adjusted. See this article for details: https://community.jaspersoft.com/wiki/how-enabledisable-time-zone-adjustment-datetime-input-controls Then the timestamp is going to be adjusted to the time zone defined in the data source. In that way this time stamp will be passed to the database The values is now passed to the database. Beware that depending on the database, further transformations on the query level will be done relative to the database or database session time zone. Some drivers allow you to specify what time zone you're working with but some always assume the client time zone. The client in this case is the JDBC driver and the JVM that is using it so it'll default to JVM time zone. This can be a problem with PostgreSQL connection: https://community.jaspersoft.com/wiki/postgresql-time-zone-set-jasperserver-jvm-time-zone-instead-user-session-time-zone-and-causes Now the results are being returned back to the report. So the steps 2 and 1 needs to be re-adjusted. First we are supposed to do adjustment on the timestamp types relative to database time zone. The timestamp with TZ is not going to be touched. Now the report time zone needs to be applied to applicable fields. This is done relative to the REPORT_TIME_ZONE but you can specify the calendar object for the parameters and date objects sent and returned from the database so that the values are treated as absolute points in time in the specified time zone: https://community.jaspersoft.com/wiki/how-pass-parameter-values-certain-time-zone-jasperserver
  24. Scenario:In TIBCO JasperReports® Server when you provide a timestamp in a date/time input control, the time stamp that is sent by the server to the database gets adjusted relatively to the difference between the user session time zone and the server time zone itself. How to disable this behavior or enable it for other date inputs? Solution:To change this behavior, edit the applicationContext-formatting.xml file in {JRS WAR}/WEB-INF location: <util:map id="applyClientTimezoneFormatting" key-type="java.lang.String" value-type="java.lang.Boolean"> <entry key="java.util.Date" value="false"/> <entry key="java.sql.Date" value="false"/> <entry key="java.sql.Timestamp" value="true"/> <entry key="java.sql.Time" value="true"/> </util:map>By default time and timestamp type controls get the adjustment and date types doesn't. To turn off the behavior, set it to false, and to enable - to true. You will need to restart the server after the change.
  25. Scenario:You have a report with timestamp input controls and you try to pass the values to the database. The values are passed without a time zone and this causes incorrect adjustments to the parameter values in the report itself and results in incorrect data returned. How to avoid this problem? Solution:The parameters by default are indeed passed without a time zone and are usually adjusted automatically by the server according to the server time zone, user time zone and report time zone respectively. This is not always the desired behavior. You can force the report query executor to add the calendar object to the timestamps that it passes to the database using the net.sf.jasperreports.jdbc.time.zone configuration property: http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.jdbc.time.zone The property will assign a calendar to the timestamps sent from the report and received by the report according to the time zone you specified. This will ensure that the date objects are formatted and adjusted accordingly to that calendar object. You can make the value for the parameter dynamic or relative to your report time zone like this: <propertyExpression name="net.sf.jasperreports.jdbc.time.zone" evaluationTime="Early"> <![CDATA[$P{REPORT_TIME_ZONE}.getID()]]></propertyExpression>[/code]
×
×
  • Create New...