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

asimkin

Members
  • Posts

    196
  • 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 asimkin

  1. Hi, it seems the only way to change Mail From address is to modify it directly in ETL repository database: SELECT * FROM "configuration" where "key" = 'mail.notify.address' Hope, this helps Best regards, Andrew
  2. Issue DescriptionAfter creating Ad Hoc views with filters and saving them/creating reports, I'd like to show entered parameter values in generated ad-hoc report. How can I do it? ResolutionFilter names map to parameter names in the Ad Hoc report but, because the underlying architecture of an Ad Hoc report is different than that of a report built in e.g. TIBCO Jaspersoft® Studio, the parameter is not found in the adHoc report unit's JRXML. Once the Ad Hoc report is created, you need to do the following to locate the parameterand add it to the report: Use Jaspersoft® Studio and locate the ad-hoc report unit Open stateXML.xml file in Jaspersoft Studio The file should contain a filter expression, something like <parameterizedExpressionString>dbo_ORDERS.SHIPCOUNTRY == SHIPCOUNTRY_1</parameterizedExpressionString> [/code] So, the parameter name in this case is SHIPCOUNTRY_1 Open mainReportJRXML file in Studio and manually create a parameter with the same name, SHIPCOUNTRY_1, 'Is For Prompting' option in unchecked. Add the parameter to Title band Save the changes and publish the report to server As a result, you get entered parameter value displayed in the report: Ref. Case 00069390
  3. Hi, it seems the issue caused by empty datasource of the main report. I was able to build a report in Jaspersoft Studio that returns required data, please find attached JRXML file. I created XML data adapter using provided XML file, and use it as the main report datasource: <queryString language="xPath"><![CDATA[/]]></queryString> The Table component has the following JSDatasource Expression: <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/addressbook/person/name")]]></dataSourceExpression>[/code]Also, find attached printscreen of the report output. Hope, this helps. Best regards, Andrew
  4. Hi, you may try using a property to ignore Page Width value for crosstabs: http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.crosstab.ignore.width Try to set it up to true at the report level and re-test the issue. Best regards, Andrew
  5. Question:I use JasperReports Server HTTP API to embed it in my custom application. I have a report with a number of pre-saved unput controls values (report Saved Values feature). How can I pass required saved values name as a parameter in the URL to consider the pre-sepected values? Answer:Instead of using reportUnit URL parameter to call a report directly, you should use reportOptionsURI parameter to specify required Saved Values URI: http://localhost:8080/jasperserver-pro/flow.html?_flowId=viewReportFlow&standAlone=true&reportOptionsURI=%2Fpublic%2F64455%2Ftest_Raph%2FOptions&ParentFolderUri=%2Fpublic%2F64455%2Ftest_Raph The Saved Values URI can be found within JasperReports Server UI, using Properties context menu of the Saved Values: Ref. Case #00068313
  6. Question:I created a report with XYLine JFreeChart. It works fine but I want to display the values on each points on the lines. How to achieve my requirements? Answer:A chart customizer should be created to achieve the requirements: http://jasperreports.sourceforge.net/sample.reference/charts/index.html#chartcustomizers Please find below sample Java code to enable XYLine chart labels: //import java.awt.Color; import net.sf.jasperreports.engine.JRChart; import net.sf.jasperreports.engine.fill.JRFillChart; import net.sf.jasperreports.engine.fill.JRBaseFiller; import net.sf.jasperreports.engine.fill.JRFillChartDataset; import net.sf.jasperreports.engine.JRAbstractChartCustomizer; import org.jfree.chart.renderer.xy.XYItemRenderer; import org.jfree.chart.labels.XYItemLabelGenerator; import org.jfree.chart.JFreeChart; public class XYChartCustomizer extends JRAbstractChartCustomizer { private JRFillChart fillChart; @Override public void init(JRBaseFiller chartFiller, JRFillChart chart) { super.init(chartFiller, chart); this.fillChart = chart; } @Override public void customize(JFreeChart chart, JRChart jasperChart) { XYItemRenderer renderer = chart.getXYPlot().getRenderer(); renderer.setBaseItemLabelsVisible(true); renderer.setBaseItemLabelGenerator((XYItemLabelGenerator) ((JRFillChartDataset) fillChart.getDataset()).getLabelGenerator()); } } In order to use this XYLine chart customizer, compile the code to a class, deploy it in the application class path, then reference it in the chart: <xyLineChart> <chart evaluationTime="Report" customizerClass="XYChartCustomizer"> <reportElement x="0" y="0" width="800" height="550" uuid="6db96f94-44ed-4847-a505-6dda967fe299"/> <chartTitle/> ... </xyLineChart> Printscreen of applying the customizer: Ref. Case #00063995
  7. Question:How do I set FTP as default output option for report job and specify default FTP settings (server, port, user, password)? Answer:Please note the solution below verified with TIBCO JasperReports® Server v.6.2.0 Default values for FTP output can be setup in a Javascript file: Add the following code within outputFTPInfo: {.....} definition (line ~1455): outputFTPInfo: { propertiesMap: {}, serverName: "ftp.mycompany.com", userName: "user", password: "pass", folderPath: "output/reportjobs", type: "ftp", port: "21", implicit: true, pbsz: 0 } You need to replace dummy values with your custom ones. Please note that, by default, JasperReports Server uses so-called optimized scripts. In order to test the changes you can add _opt=false parameter to URL to make the server uses non-optimized scripts: If the changes meet your requirements, you should regenerate optimized scripts as described in JasperReports Server guide: Ref. Case #00065192
  8. Hi, JasperSoft Studio x86 version is available in Download section http://community.jaspersoft.com/download TIBCOJaspersoftStudioPro-6.2.0.final-windows-installer-x86.exe6.2.0Windows32-bit
  9. Issue Description:A customer wants to change the icon of the export button after the report is generated. Resolution:JasperReports Server allows creating and using custom theme to customize looks and styles. Tthe Export button icons are stored in imagesviewer_toolbar_buttons_sprite.png file of the default theme which is a sprite file. In order to use a custom icon you can copy the sprite file to a custom one and modify it per your requirements. Please note the sprite contains other button icons (Save, Undo, Redo etc) Then, you should create a new theme in JasperReports Server and upload the custom sprite file into it. If you don't want to use the sprite file, you can use your custom button icon file. In this case, you have to define the button image in overrides_custom.css file of a custom theme like: [toc]#designer .toolbar #export .icon { background: url("images/your_icon.png"); } #designer .toolbar #export.over .icon, #designer .toolbar #export.pressed .icon { background: url("images/your_icon_for_pressed_button.png"); } #designer .toolbar #export.button[disabled] .icon { background: url("images/your_icon_for_disabled_button.png"); } The solution tested with JasperReports Server v.6.1. Please find attached export of the custom theme with the customized Export icon. Reference:JapserReports Server Ultimate Guide, 'Changing the UI with Themes' chapter Ref. Case #00066387 custom_theme.zip
  10. Hi, did you enable anonymous access to JasperReports Server as described in the article: http://community.jaspersoft.com/wiki/allow-anonymous-access-reports ? By default, anonymous access is disabled
  11. Question:How do I set default values in Notification tab of report scheduler? Answer:Please note the solution below verified with TIBCO JasperReports® Server v.6.1.1 Default values for Notification tab can be setup in a Javascript file: Add the following code after repositoryDestination: {.....} model definition (line ~1465): mailNotification: { toAddresses: { address: ['JohnSmith@mail.com', 'BobSmith@mail.com'] }, ccAddresses: { address: ['RedGreen@mail.com'] }, bccAddresses: { address: ['BlueJack@mail.com'] }, subject: 'Ouptut Job - Year Sales', messageText: 'See attached...', skipEmptyReports: true, includingStackTraceWhenJobFails: false, skipNotificationWhenJobFails: false, resultSendType: 'SEND_ATTACHMENT' // SEND, SEND_EMBED, SEND_EMBED_ZIP_ALL_OTHERS, // SEND_ATTACHMENT, SEND_ATTACHMENT_ZIP_ALL }, alert: { recipient: 'OWNER_AND_ADMIN', // NONE, OWNER, ADMIN, OWNER_AND_ADMIN jobState: 'ALL', // NONE, ALL, FAIL_ONLY, SUCCESS_ONLY subject: 'Year Sales Job Status', messageText: 'Successful run.', messageTextWhenJobFails: 'Job Output failed.', includingStackTrace: true, includingReportJobInfo: true, toAddresses: { address: ['statusForAdmin@mail.com'] } } You need to replace dummy values with your custom ones. Please note that by default JasperReports Server uses so-called optimized scripts. In order to test the changes you can add _opt=false parameter to URL to make the server uses non-optimized scripts: If the changes meet your requirements, you should regenerate optimized scripts as described in JasperReports Server guide: See also: Ref. Case #00065543
  12. Question:I have a report with Dual-axis HTML5 chart. How can I configure the chart to have the same MAX values for both Y-axises?Answer:By default, the maximum value of axis is automatically calculated. There is a property to explicitly specify the max vaIue: http://api.highcharts.com/highcharts#yAxis.max But what can be done if the max values are dynamic? The main idea is to use getExtremes() and setExtremes Highcharts methodes: http://api.highcharts.com/highcharts#Axis.getExtremes http://api.highcharts.com/highcharts#Axis.setExtremes The following custom Javascript function should be specified as the chart's chart.events.load advanced property: "function(){"+"this.yAxis[0].endOnTick=false;"+"this.yAxis[1].endOnTick=false;"+"this.yAxis[0].setExtremes(0,Math.max(this.yAxis[0].getExtremes().max,this.yAxis[1].getExtremes().max),true);"+"this.yAxis[1].setExtremes(0,Math.max(this.yAxis[0].getExtremes().max,this.yAxis[1].getExtremes().max),true);"+"}"[/code]The function firstly disables endOfTick property and then sets yAxis.max extremes as the maximum number of 2 yAxis.max values. Make sure, property 'com.jaspersoft.jasperreports.highcharts.function.properties.allowed' is set to true in Jaspersoft Studio configuration or in WEB-INFclassesjasperreports.properties file if you run the report in JasperReports Server. Ref. Case #00065014
  13. Do you have Query Router (mongos process) running on a separate port? You can try connecting to it.
  14. Question: How to use JNDI source as a subreport datasource. Answer: In order to use JNDI connection for subreport, you should create a custom Java code to retrieve the connection details and pass it to the subreport. The article below may be used as a base for the code http://www.javapractices.com/topic/TopicAction.do?Id=127 package com.custom; import java.sql.*;import javax.naming.*;import javax.sql.*; public class GetConnection { /** Uses JNDI and Datasource (preferred style). */ public static Connection getJNDIConnection(String dsContext){ //String DATASOURCE_CONTEXT = "jdbc/foodmart"; Connection result = null; try { Context initialContext = new InitialContext(); if ( initialContext == null){ log("JNDI problem. Cannot get InitialContext."); } DataSource datasource = (DataSource)initialContext.lookup(dsContext); if (datasource != null) { result = datasource.getConnection(); } else { log("Failed to lookup datasource."); } } catch ( NamingException ex ) { log("Cannot get connection: " + ex); } catch(SQLException ex){ log("Cannot get connection: " + ex); } return result; } private static void log(Object aObject){ System.out.println(aObject); }} import java.sql.*;import javax.naming.*;import javax.sql.*; public class GetConnection { /** Uses JNDI and Datasource (preferred style). */ public static Connection getJNDIConnection(String dsContext){ //String DATASOURCE_CONTEXT = "jdbc/foodmart"; Connection result = null; try { Context initialContext = new InitialContext(); if ( initialContext == null){ log("JNDI problem. Cannot get InitialContext."); } DataSource datasource = (DataSource)initialContext.lookup(dsContext); if (datasource != null) { result = datasource.getConnection(); } else { log("Failed to lookup datasource."); } } catch ( NamingException ex ) { log("Cannot get connection: " + ex); } catch(SQLException ex){ log("Cannot get connection: " + ex); } return result; } private static void log(Object aObject){ System.out.println(aObject); }} [/code] The next steps are: 1. Edit source code per your requirements 2. Compile the java code to GetConnection.class, pack it to a jar file. 3. Copy the jar archive to WEB-INFlib folder in JasperReports Server 5. Restart JasperReports Server 6. In the main report specify subreport's connection expression like com.custom.GetConnection.getJNDIConnection("java:comp/env/jdbc/foodmart") Please note you should specify JNDI name as java:comp/env/jdbc/<NAME> Also, the JNDI connection should be defined in application server. In case of JasperReports Server, it is defined in META-INFcontext.xml file. Ref. Case #00052505
  15. Did you try adding parameters to the REST URL like http:///?parameter1=value1&parameter2=value2 ?
  16. Hi, try using expression like java.sql.DriverManager.getConnection("jdbc:postgresql://localhost:5432/sugarcrm","postgres","postgres") as subreport Connection Expression value Best regards, Andrew
  17. Hi, iReport uses JasperReports Library to compile, fill and export reports. JasperReports Library is a Java Library that offers an interface to the JasperReports Library reporting engine. You can use the library in your application. Please review the article below to see how it works: http://community.jaspersoft.com/wiki/getting-started-jasperreports-library http://community.jaspersoft.com/wiki/jasperreports-library-tutorial Best regards, Andrew
  18. Hi Mohammed, try using Table element and PrintWhenExpression for a column to achieve the requirements. Best regards, Andrew
  19. Hi, you can use a Java expression like below to decrease 2 hours form a date field new Date($F{orderdate}.getTime() + 2 * 3600*1000) 3600*1000 is 1 hour in milliseconds
  20. Hi, you can find details in the article http://community.jaspersoft.com/wiki/how-use-json-remote-data-source-version-561
  21. Hi, as you modified optimized scripts, there is no need to re-optimize it again.
  22. Hi, for relative dates, you can change week start day in WEB-INFclassesrelativedate.properties file. For other cases, week start day is hard-coded in scripts located in bower_componentsjquery-uiuii18n for each locale: firstDay: 1 If you modify the scripts, you have to re-optimize them or configure JasperReports Server to use non-optimized scripts: http://community.jaspersoft.com/documentation/jasperreports-server-ultimate-guide/v561/customizing-javascript-files Hope, this helps
  23. Hi, I'm not familiar with Apex in details but from what I found out, Apex calls JasperReports server reports using HTTP API like http://jasperreport-server/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=/reports/report_name&output=pdf&j_username=jasper_user&j_password=jasper_password&rep_parm=parm_value If this is the case, to pass multiple values for a parameter, you should include it multiple time in the call: http://jasperreport-server/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=/reports/report_name&output=pdf&j_username=jasper_user&j_password=jasper_password&rep_parm=parm_value_1&rep_parm=parm_value_2&rep_parm=parm_value_3 Hope this helps
  24. Issue DescriptionIf you have a JRXML report with Table component and specify a complex expression in a Detail TextField element, it leads to disabling Filter/Sort JIVE functionality. Please find attached printscreen of the issue: ResolutionJIVE looks at the expression in the detail text field to understand what is the data source field or variable it needs to sort and filter after. When the text field uses a simple expression with only the name of a field or variable, things work smooth. Take the "Freight" column in the report attached.The text field in the detail cell has the following formula: "$" + $F{freight} The result of this formula is known only when JR renders the content of the text field and is not know when sorting or filtering occurs. Sorting and filtering are data processes which occur at data level, when only field and variables values are at hand, and when text field expression are not known. In short, we cannot sort and filter on text field expressions. We can only sort and filter on dataset fields and variables. The solution in such cases is to either take the text field formula and create a variable for it in the dataset, and then use this variable as the only thing in the text field expression. Another approach is to leave the expression of the text field in place, but specify at column level in the table component, which is the field or variable to use for sorting and filtering, using one of the following two custom properties that can be set in the column tag/object: net.sf.jasperreports.components.table.column.field net.sf.jasperreports.components.table.column.variable Ref. Case 00063266
  25. Issue DescriptionIf you have a JRXML report with Table component with a group and apply sort action to a column that is not in the 'group by' clause, it breaks the 'group by' behaviour. Please find attached printscreen of the issue: ResolutionSetup net.sf.jasperreports.create.sort.fields.for.groups=true property for Dataset which is used for Table. The property automatically adds a sort field that corresponds to the group in the report: http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.create.sort.fields.for.groups Result of applying the property: Ref. Case 00062619
×
×
  • Create New...