Jump to content

Friendly User

Members
  • Posts

    435
  • Joined

  • Last visited

  • Days Won

    2

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Everything posted by Friendly User

  1. You need either to pass the connection expression or the data source expression to the subreport. Since your subreport is not SQL based and is instead bean based so you'll need to bind the subreport to bean data source using the data source expression. Try something like this: <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{fieldNameToBeUsed})]]></dataSourceExpression> Here is a good stackoverflow post about this: https://stackoverflow.com/questions/11949333/passing-the-list-of-primitive-type-objects-as-datasource-for-subreport
  2. You might want to check if you get any errors in the log (Help->About Jaspersoft Studio->Installation details->Configuration->View Error Log)
  3. You can create another parameter that will be of type date and have default value expression of "new Date($P{start_date}.getTime() + 1000L * 60 * 60 * 60 * 8)". This will generate a new date based on your current date but add 8 hours to it.
  4. You will need to add your java class that generates the drawing to the classpath and then in the image element expression invoke the method that returns you the java.awt.Image or java.io.InputStream or java.io.File that contains your image.
  5. I get the same issue when I try to create a report through the wizard, has something to do with obtaining metadata. Wizard cannot continue before you obtain the metadata and hangs. Do you get the same problem when you create an empty report and then go to Dataset and Query dialog and select the adapter there? It should allow you to enter query without waiting for the metadata to come back.
  6. Hello Naresh, sounds like you need a crosstab with count calculation on the bucket. You can create a crosstab using a crosstab element. Set your company name as row group and your bucket as column group and your bucket as measure. Set the calculation to count.
  7. Situation:You want to create a donut chart (a pie chart with empty space inside). HTML5 charts do not have donut chart suggested as a type of chart. It it possible to do that. Solution:You can do it by setting plotOptions.pie.innerSize to desired value. Can be a percentage or pixel value. Percentages are relative to the pie size. Pixel values are given as integers.
  8. Situation:You have created a semi-pie chart and want to have some white space inside for the chart to look like an arc instead. How to do that? Solution:You can do it by setting plotOptions.pie.innerSize to desired value. Can be a percentage or pixel value. Percentages are relative to the pie size. Pixel values are given as integers. You can use this with regular pie chart as well to create donut chart.
  9. Situation:You developed a treemap in Jaspersoft Studio and when you run the report and drill down using the tree map the back button says 'undefined' instead of 'back'. How to fix it? Solution:To change that label use the plotOptions.treemap.drillUpButton.text property. You can regulate the position of the button using plotOptions.treemap.drillUpButton.position.y. You may need to add that property manually if it is not listed in the plot options: <hc:chartProperty name="plotOptions.treemap.drillUpButton.position.y"> <hc:propertyExpression> <![CDATA[10]]> </hc:propertyExpression></hc:chartProperty><hc:chartProperty name="plotOptions.treemap.drillUpButton.text"> <hc:propertyExpression> <![CDATA["Back"]]> </hc:propertyExpression></hc:chartProperty>[/code]
  10. Situation:Column chart usually has columns grouped together and displayed one next to another to compare values. What if you want one column to be plotted inside another column for easier readability. Solution:This can be achieved by assigning differfent padding value for different measure. Select first measure, press Modify, go to Advanced options tab and press Add: Contributor: SeriesPropertyProperty name: pointPaddingUse expression: 0.01Do the same for the other measure except specify 0.2 as expression value.
  11. Situation:You have two measures on a single axis but for readability purpose you want to display one as a column, the other as a line. How to do that? Solution:You can assign different property values to an individual measure. These property values will override values from higher level (chart-wide). To do that select the measure and modify it, go to Advanced properties tab and press Add: Contributor: SeriesPropertyProperty name: typeUse expression: "column"This will make one of the measures display as column instead of a line on a line chart. You can pass also other values like enable data labels only for that measure. To do that instead of property name: type specify property name: dataLabels.enabled and Use expression: true
  12. Situation:You have values coming from the database as milliseconds. You want to use these values as category and format them as a date on a chart axis. How to do that? Solution:You can use the xAxis.labels.formatter property and pass a function that would format your values. The function is the following: function () { return Highcharts.dateFormat('%d-%m-%Y %H:%M', this.value); } Here we use internal HighCharts function called dateFormat which accepts two parameters - a mask and the value to be formatted according to the mask. To be able to use functions you'll need to first turn them on. Make sure Window->Preferences->JasperSoft Studio->Properties com.jaspersoft.jasperreports.highcharts.function.properties.allowed is set to true
  13. Situation:You need to add a plot line to a chart to visualize whether the series are exceeding some limit or optimum value. How to do that? Solution:The UI as of 6.4.0 does not really allow us conveniently to add plot lines. To do that we would need to resort to a "hack" and use java script functions instead. The workaround is to use a function that will return an array with plotline elements. You can have more than one plotline this way as well. Since this chart uses functions as property values you'll need to make sure that Window->Preferences->JasperSoft Studio->Properties com.jaspersoft.jasperreports.highcharts.function.properties.allowed is set to true To add a plotline edit the chart and go to Advanced Formatting window. Press Add to add a new property x/yAxis.plotLines. As value select and expression and pass a function that returns an array with the plotline objects. The objects need to have value, color, width and style properties defined. For example: <hc:chartProperty name="yAxis.plotLines"> <hc:propertyExpression> <![CDATA["function(){return [{color: 'red', value: 2500, dashStyle: 'longdashdot', width: 2}, {color: 'green', value: 7500, dashStyle: 'longdashdot', width: 2}]}()"]]> </hc:propertyExpression> </hc:chartProperty>See attached JRXML for more information. plotlines.jrxml
  14. Situation:You want to display how some variable changed over time on a chart and therefore need to use rolling sum. The charts only show totals for the time period and not how overall totals change over time. Solution:To achieve this you will need to use the report variables instead. The timeseries chart will have a category (time), a series (some grouping criteria) and the measure that will be variable which we want to track. We would need to first sort the dataset based on the category and series by creating two sort fields for these two fields.Then create a group in a report. The group expression should be set to the field that is used in the chart series.Now we will need to create a variable with desired calculation type (count, sum), increment type: none, reset type: group we created previouslyAdd the measure, set value expression to be $V{ourVariable}, calculation type: nothingSee attached JRXML file for reference. timeseries.jrxml
  15. Heatmap chart is one of the few color-axis based charts. This means that there is a specific color assigned for each value on the axis. Category defines the Y axis, Series defines the X axis and Measure defines the aggregated value. To use a heatmap you need to define the colorAxis properties. It can be binary with colorAxis.minColor and colorAxis.maxColor where all values are divided into two categories (good for Success/Fail heatmap) or you will need to use colorAxis.stops or colorAxis.dataClasses property. colorAxis properties are not exposed in the UI and can be found here: http://api.highcharts.com/highmaps/colorAxis. colorAxis properties will need to be added in Chart Formatting -> Advanced Formatting -> Add menu as they are not present in the list colorAxis.stops and colorAxis.dataClasses requires to provide an array. Arrays are not passable that easily through the UI or XML but you can write a callback function that will return an array with all the desired values. See the property values for more information. Since this chart uses functions as property values you'll need to make sure that Window->Preferences->JasperSoft Studio->Properties com.jaspersoft.jasperreports.highcharts.function.properties.allowed is set to true Here is an example of an array that returns the stops: <hc:chartProperty name="colorAxis.stops"> <hc:propertyExpression> <![CDATA["function(){return [[0, 'grey'],[0.5, '#fffbbc'],[0.9, '#c4463a']]}()"]]> </hc:propertyExpression> </hc:chartProperty>Here we have a function that returns us an array with 3 elements (also arrays). 0 means the lowest value in the dataset, 0.5 means the average and 0.9 means the top 10%. The color will change from grey to #fffbbc to #c4463a as the values get mapped. They will have different gradient assigned. You can also use dataClasses: function(){return [{to: 3}, {from: 3, to: 10}, {from: 10, to: 30}, {from: 30, to: 100}, {from: 100, to: 300}, {from: 300, to: 1000}, {from: 1000}]}
  16. HTML5 Charts or HighCharts allow usage of JavaScript functions as property values. You can even use the functions to return objects with dynamic values to the charts and like that create plotlines and other neat things. But before you can use functions, you need to enable them. In TIBCO JasperSoft® Studio (Windows): Go to Window -> PreferencesSelect JasperSoft Studio categorySelect Properties categoryFirst type in the filter field "function.properties.allowed" to check if you already have the property. If you don't see anything returned by the search, press AddProperty name: com.jaspersoft.jasperreports.highcharts.function.properties.allowed Property value: trueIn TIBCO JasperReports® Server: Go to your application server and navigate to the JasperReports Server WAR file (expoloded/unexploded)Go to /WEB-INF/classesEdit jasperreports.properties fileAppend com.jaspersoft.jasperreports.highcharts.function.properties.allowed=trueSave the file and restart the application serverFunction properties are usually related to formatting (callback functions). For example you can format your chart data labels using the plotOptions.series.dataLabels.formatter property. It requires a callback function that will be called every time a data label will be generated and the formatting will be applied. For example: plotOptions.series.dataLabels.formatter expression: "(function(){return this.y + '('+this.percentage.toFixed(0)+'%'+')';})" This will make datalabes display percentage of total value in each series. You can, however, use the functions as workarounds for different limitations of the HighCharts implementation in JasperReports library. For example, you need a plotline. You can generate it like this (XML snippet): <hc:chartProperty name="yAxis.plotLines"> <hc:propertyExpression> <![CDATA["function(){return [{color: 'red', value: 2500, dashStyle: 'longdashdot', width: 2}, {color: 'green', value: 7500, dashStyle: 'longdashdot', width: 2}]}()"]]> </hc:propertyExpression> </hc:chartProperty>Here the function returns a whole object that describes the plotLine and is fed to the plotLines property. Note: It's also important to know that you need to remove any line breaks from your function definition if you use the Expression Editor in Studio. If you have line breaks in the function, it won't be able to execute properly. MJB update 01/18/18KK update 11/24/21
  17. Attached to the article is the zip containing JRXML's of various charts that demonstrate useful tips and tricks you can do with HTML5 (Higcharts). To import the chart project do the following: Download the zip file chart_samples.zipOpen your JasperSoft Studio and go to Project ExplorerRight click anywhere on the whitespace and press ImportGo to General folder and select Existing projects into workspacePress "Select Archive File" and point the wizard to the downloaded archiveCheck the Chart Samples project if it is unchecked and press FinishTo run the samples you'll need to have JSS Sample DB / SugarCRM DB and Foodmart DB. JSS Sample DB can be defined as a data adapter: Driver: org.hsqldb.jdbcDriverURL: jdbc:hsqldb:res:/defaults/hsqldb/testusername: sapassword: do not provide any passwordThe SugarCRM and Foodmart DB can be obtained from the JasperReports Server distribution and can be installed separately using buildomatic tool. You will need to make sure that you have a database server running (MySQL, PostgreSQL, etc.) where you can install the sample databases. To do that Download the JasperReports Server distribution and unpack itGo to /buildomatic/sample_conf folder.Select the sample configuration file for desired database and edit it. The only properties that you need to edit are database related: dbhost, dbusername, dbpassword, dbport, etc. You will need to specify the user that can create databases.Save the file as default_master.properties and copy it to /buildomatic/Go to /buildomatic/ execute the following commands in the folder:js-ant create-sugarcrm-dbjs-ant create-foodmart-dbjs-ant load-sugarcrm-dbjs-ant load-foodmart-dbjs-ant update-foodmart-dbOnce the sample databases are installed, you can create the data adapters for the samples in your studio and run the reports. chart_samples.zip
  18. Scenario:You want to use Office 365 SMTP server for your scheduler to send emails. Getting the following message all the time: 530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [DM5PR1101CA0003.namprd11.prod.outlook.com] How to do that? Solution:Configure the js.quartz.properties with the respective values to connect to your Office 365 SMTP. For example: report.scheduler.mail.sender.host=smtp.office365.com report.scheduler.mail.sender.username=<address>@someaddress.com report.scheduler.mail.sender.password=<password> report.scheduler.mail.sender.from=<address>@someaddress.com report.scheduler.mail.sender.protocol=smtp report.scheduler.mail.sender.port=587 report.scheduler.mail.smtp.starttls.enable=true report.scheduler.mail.smtp.auth=true The following properties need to be appended to javaMail bean of applicationContext.xml and applicationContext-report-scheduling.xml: mail.smtp.auth=true mail.smtp.starttls.enable=true mail.sender.protocol needs to be SMTP
  19. Scenario:You want to not allow users to re-order input controls in the input control panel. The re-oredring is done by dragging and dropping the input control. Solution:go to your TIBCO JasperReports® Server WAR file and navigate to /WEB-INF/jsp/modules/viewReport/viewReportState.jsp file. find this line Report.icReorderEnabled = ${isIcReorderingEnabled}; replace it to Report.icReorderEnabled = false; save and restart the server clean browser cache
  20. Scenario: We have deployed the TIBCO JasperReports® Server production virtual sandbox that runs on CentOS 7. The URL we are using for this server is http://some.url We'd like to configure a redirect so that all http or https traffic is redirected to http://some.url/jasperserver-pro/login.html Could you tell us how to do this or if there is a way to disable the Welcome screen? Solution: 1. SSH into your virtual environment (default password is root/Jaspersoft). You can use Putty for that or WinSCP. 2. Go to /usr/share/apache-tomcat-8.0.14/webapps/ROOT 3. Edit index.jsp 4. Replace the whole contents of index.jsp with this line: <% response.sendRedirect("/jasperserver-pro"); %> 5. Restart the server with the following command: service tomcat restart
  21. Scenario:Right click on a dashboard and click on open in designer optionOnce the dashboard opens, click on "Show or Hide dashboard properties dialog" or two cogs.In the toolbar setting you can see a checkbox showing show export buttonIs there any way to hide it? Solution:It can be done by going to webapp/scripts/bower_components/bi-dashboard/src/dashboard/template/properties/dashboardPropertiesDialogTempalte.htm file. Just comment out class of toolbar settings and it hides Show toolbar settings label and checkbox.
  22. Scenario:You are trying to use visalize.js that is deployed on another application and this fails. Responses can be 400 or 404 depending on the set up. jasperserver.log file mentions something like: WARN [com.jaspersoft.jasperserver.api.security.csrf.CrossDomainCommunicationFilter],http-nio-10002-exec-6:110 - Potential cross-domain attack. Request origin domain: http://some.ip:8080; local pattern: ^https://myapplication.com$[/code]Solution:You need to configure the domainWhitelist profile attribute in your jasperserver. To do that, log in as superuser, go to Manage -> Server Settings -> Server attributes. The domainWhitelist is a regular expression. It needs to be set in a way that allows connections from your website. It can also be set on per-user level if you want to dedicate a single user to do visualize.js calls.
  23. Scenario:You forgot the superuser password or it got corrupt and now you can't log into the server. How to solve this? Solution:Import the attached zip file with the --update flag using js-import.bat/sh script. The archive contains just the superuser and the password will be reset to "superuser" value.
  24. Scenario:You are a server administrator and don't want end users to see the exception stacktraces. How to disable them? Solution:Edit exceptionOutputManager located in the file applicationContext-security-web.xml and remove <value>ROLE_USER</value>[/code]from <entry key="STACKTRACE">[/code]and restart the server.
  25. Scenario:You have a font that you would like to use in TIBCO JasperReports® Server UI. How to make the server use that font? Solution:You'll need to download and create a new theme based on the default theme. The default JasperReports Server font is "normal 11px Verdana,Arial,Helvetica,sans-serif" and that would need to be changed to whatever you're planning to use. The font will need to be placed into the /fonts/ folder of the theme.
×
×
  • Create New...