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. Issue DescriptionI have a request to create a Table report and merge rows that have repeated values within the first column. Please find attached Excel sample that deminstrate the requirement How to create such the report? ResolutionBased on the nature of report datasource, it is possible to achieve the requirements either by using Crosstab component or by using 2 datasets and Table component. Let's review the second option. We will use 2 datasets - the main report dataset returns distinct values for the first column which should be grouped. The second dataset returns 'details' records for each value of the main dataset. Attached is a sample report based on SugarCRM sample database that demonstrates the idea. The main report dataset returns distinct list of values which are used to group data (countries in my example). I added corresponding TextField element into Details band, specify alignment and text rotation (Left). Also, the element 'Stretch Type' property set to 'Relative to Band Height' and 'Print Repeated Values' unchecked. Into the same band I added Table component based on the second dataset (Dataset1) which returns records for each country via parameter. As a result, I got required output, find attached printscreen. Solution tested with TIBCO JasperReports® Server v.6.4.0 Ref. Case 01553661 tablemergedrows.jrxml
  2. Hi, what you could try is to use series Bucket Properties to specify required tooltip.valueDecimals value for each series. A similar solution to define series colors are described in the article: https://community.jaspersoft.com/wiki/dynamically-updating-bar-colors-html5-bar-charts Hope, this helps Best regards, Andrew
  3. Issue DescriptionI created an AdHoc View using MSSQL as a data source. As it turned out, the result may change depending on the JDBC driver selected in setting data source. For example, if a large value is entered in a Float type column, an error appears in the display result of the AdHocView. Using the TIBCO JDBC driver seems to map MSSQL Float type to Java Float type and using Microsoft driver seems to map Float type to Double type. Is this recognition correct? ResolutionTIBCO MSSQL JDBC Driver uses a version of the DataDirect Progress MSSQL Drivers. Per DataDirect Progress documentation, by default FLOAT database column type mapped to FLOAT Java type: http://media.datadirect.com/download/docs/jdbc/alljdbc/help.html#page/jdbcconnect%2FData_Types_7.html%23 Default type mapping can be changed in WEB-INF/applicationContext-semanticLayer.xml config file, property: In TIBCO JasperReports® Server v.6.4.0 the property contains mapping for Float type: It can be changed to: server restart required to apply the chnages. As a result, newly created domain based on TIBCO MS SQL driver connection containes java.lang.Double type for Float MS SQL type. Please note, you may need to re-save the existing domain to have them java.lang.Double type. Solution tested with TIBCO JasperReports® Server v.6.4.0 Ref. Case 01552601
  4. try to use the expression below to explicitly specify required locale: new SimpleDateFormat("d MMMM", Locale.FRANCE).format( $P{start_date} ) Best regards, Andrew
  5. Check WEB-INFlogsjasperserver.log file and share error details Best regards, Andrew
  6. Hi, please check TIBCO Jaspersoft Studio guide https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v60/creating-hyperlinks-html5-charts as well as a community article https://community.jaspersoft.com/wiki/how-do-i-set-chart-hyperlinks-html5-charts Best regards, Andrew
  7. Issue DescriptionWhile creating Ad Hoc View from domain based on MS SQL datasource, after adding a field in AdHoc Crosstab it shows error message: java.lang.RuntimeException: exception getting dataset from cache and jasperserver.log file contains error Caused by: java.sql.SQLException: [TIBCO][sqlServer JDBC Driver][sqlServer] The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP, OFFSET or FOR XML is also specified.[/code] What is the reason of the error and how to fix it? ResolutionAs it turned out, customer used a derived table in the underlying domain with query which contained ORDER BY clause. As stated in TIBCO JasperReports® Server User Guide, such SQL is not valid for MS SQL Server: https://community.jaspersoft.com/documentation/tibco-jasperreports-server-user-guide/v640/representing-derived-tables-xml In order to resolve the issue, the derived table query should be modified by adding TOP or FOR XML clause Generally, it's not a good idea to specify ORDER BY clause in view/subquery etc: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/8a239560-4272-4cca-ae31-2471edc79d2d/the-order-by-clause-is-invalid-in-views-inline-functions-derived-tables-and-subqueries-unless?forum=transactsql https://blog.sqlauthority.com/2010/08/23/sql-server-order-by-does-not-work-limitation-of-the-views-part-1/ Solution tested with TIBCO JasperReports® Server v.6.4.0 Ref. Case 01554414
  8. Issue DescriptionIn TIBCO JasperReports® Server Repository view, Created / Modified Date fields are represented in different formats. Why is this so and how can I change this? ResolutionDate Format in the Repository view based on date value: if this is a present date - Today value displayedif this is a yesterday date - Yesterday value displayedif this is a current year date - 'MMMMM d ' Java date format is used to display the date, something like 'February 26'otherwise, "M/d/yyyy" Java date format is usedThis is why you see dates in different formats. There is a way to configure current year and general date format in WEB-INF/bundles/jasperserver_config.properties config file. The properties in question are: #Date and time formats which are used in repository and in View -> Messages repository.date.format=M/d/yyyy repository.current.year.date.format=MMMMM d Solution tested with TIBCO JasperReports® Server v.6.4.0 Ref. Case 01530669
  9. Hi, what you could try is to create so-called Book report from that 5 different reports to generate a single file output. You may need to play with Excel Export properties to have each of the report in different tab http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.export.xls.one.page.per.sheet Best regards, Andrew
  10. Hi, you may need to set disableSendingAlertToOwner property to true in /WEB-INF/applicationContext-report-scheduling.xml config file. Check Admin Guide for more details: https://community.jaspersoft.com/documentation/tibco-jasperreports-server-administrator-guide/v640/configuring-scheduler#Failure_Notifications Hope, this help Best regards, Andrew
  11. Issue DescriptionCustomer has a requirement to create a Pie Chart in JRXML report based on 3 dataset fields. They created such chart in Ad Hoc View by adding 3 columns into Rows. How to achieve the same result in JRXML report? [toc]ResolutionBy default, Pie Chart expects that slices are represented different values of a single column/field. The requirements can be implemented by converting the threee values into a data source with three records and sending the data source to a subdatatset. Please find attached example, note that is uses Groovy as language for map literals. Report main dataset returns 3 dummy values: SELECT 5 as a, 8 as b, 4 as c[/code]Subdataset "chartData" contains only a list of fields, key and vallue, without any query. Pie Chart's dataset uses a DataSource expression to 'convert' values into records: new net.sf.jasperreports.engine.data.JRMapCollectionDataSource([[key:"a",value:$F{a}],[key:"b",value:$F{b}],[key:"c",value:$F{c}]])[/code] Solution tested with TIBCO JasperReports® Server v.6.4.0 Ref. Case 01530898
  12. Issue DescriptionWe have created a Calculated Measure while creating an Ad Hoc view. Now, we need to localize that Calculated Measure. We are able to localize the Dimensions, Measures and calculated filed created at Domain level. Is there any way to localize Ad Hoc View Calculated Meausre? ResolutionWhen an Ad Hoc View created, JasperReports Server automatically creates a separate copy of domain bundle file which is stored in Ad hoc View internal structure. A possible solution to achieve the requirement is: create a bundle file and assign it to domain (if the file is already there, skip this step) create and Ad Hoc View from the domain, create required calculated measure, save the view export the Ad Hoc View to a zip archive unzip the arcive, locate topicJRXML.data file within the Ad Hoc view folder locate created calc measure definition at the end of the file within <field name ... /field> XML tag add 2 properties into the measure definition: <property name="semantic.item.desc.id" value="TAX.DESCR"/><property name="adhoc.display" value="$R{TAX.LABEL}"/>[/code]where TAX.DESCR and TAX.LABEL are keys used to translate the measure locate domaini18n.properties.data file inside the Ad Hoc View folder add translations for the custom keys: TAX.LABEL=Freight TAXTAX.DESCR=Freight TAX Description[/code]pack the files back into a zip archive and import it into the server with Update flag test the Ad Hoc View Attached is a printscreen that demonstrates the idea. Solution tested with TIBCO JasperReports® Server v.6.4.0 Ref. Case 01552568
  13. Issue DescriptionDue to a report performance issue, we have to execute a SQL SET optimizer_search_depth = 0; before executing the report main SQL. Setting this parameter globally in MySQL has negative impact for other processes that are running queries over the database. Is there a way to specify the parameter value at the connection level? [toc]ResolutionAccording to MySQL doc, optimizer_search_depth variable can be set at both Global and Session level: https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_optimizer_search_depth MySQL JDBC connection URL has an option to include session variable: https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-configuration-properties.html ------------ sessionVariables A comma or semicolon separated list of name=value pairs to be sent as SET [sESSION] ... to the server when the driver connects. ----------- So, if you use a JNDI datasource, you can modify it's definition in context.xml file (or another config file based on your deployment) and add a directive like this &sessionVariables=optimizer_search_depth = 0 to URL The complette URL should look like url="jdbc:mysql://127.0.0.1:3306/<database_name>?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&autoReconnectForPools=true&sessionVariables=optimizer_search_depth = 0" Ref. Case 01518302
  14. Issue DescriptionI have a requirement to hide Manage > Organizations menu for all users except superuser. How can I achieve it? ResolutionThe requirement can be achieved by modifying webappsjasperserver-proWEB-INFactionModel-navigation.xml config file. in line ~46 there is a definition of Manage > Organizations menu: <condition test="showMTMenuItem"> <option labelKey="NAV_055_TENANT" action="primaryNavModule.navigationOption" actionArgs="organization"/> </condition>You should include one more condition to check ROLE_SUPERUSER role: <condition test="checkAuthenticationRoles" testArgs="ROLE_SUPERUSER"> <condition test="showMTMenuItem"> <option labelKey="NAV_055_TENANT" action="primaryNavModule.navigationOption" actionArgs="organization"/> </condition> </condition>Server must be restarted. Solution tested with TIBCO JasperReports® Server v.6.4.0 Ref. Case 01516078
  15. Issue DescriptionInside my report I have 3 Pie charts on the same line with the same width/height. The problem is about the height of the pie chart because it changes according the number of category it's showing: fewer are the categories and bigger will be the chart. I would like to get all the three Pie Charts with the same height and aligned vertically. ResolutionThe default behavior is to scale pie chart to the plot area and give room for data labels within the plot area. As a consequence, the size of the pie may vary when points are updated and data labels more around. To avoid the behavior you should specify plotOptions.pie.size property for each pie chart: https://api.highcharts.com/highcharts/plotOptions.pie.size It can be a percent value, for example 80% Ref. Case 01558092
  16. Issue DescriptionAfter upgrading to TIBCO JasperReports® Server v.6.4.0, customer noted that they could not open Ad Hoc Views with a filter criteria contains a slash "/", created in v.6.3.0. They get error like: Errors were encountered when compiling report expressions class file: Invalid escape sequence (valid ones are b t n f r " ' \ ) value = java.util.Arrays.asList(new Object[]{"ECSA - FAR EAST","CHILE - FAR EAST","ECSA - MED","ECSA - N EUROPE","FAR EAST - ECSA","ST LAWRENCE - BRAZIL","ATLANTIC\/PACIFIC"}); //$JR_EXPR_ID=1$ < -----------------> Invalid escape sequence (valid ones are b t n f r " ' \ ) value = java.util.Arrays.asList(new Object[]{"ECSA - FAR EAST","CHILE - FAR EAST","ECSA - MED","ECSA - N EUROPE","FAR EAST - ECSA","ST LAWRENCE - BRAZIL","ATLANTIC\/PACIFIC"}); //$JR_EXPR_ID=1$ < -----------------> Invalid escape sequence (valid ones are b t n f r " ' \ ) value = java.util.Arrays.asList(new Object[]{"ECSA - FAR EAST","CHILE - FAR EAST","ECSA - MED","ECSA - N EUROPE","FAR EAST - ECSA","ST LAWRENCE - BRAZIL","ATLANTIC\/PACIFIC"}); //$JR_EXPR_ID=1$ < ----------------->3 errors Customer asked to identify the issue and provide a solution/workaround ResolutionThere was a defect in TIBCO JasperReports® Server v.6.3.0 related to storing Ad Hoc View with filter which contained selected value with forward slash character ("/"). That defect fixed in v.6.4.0. Newly created Ad Hoc Views are not affected, but it is impossible to open Views created in v.6.3.0 due to the error. A possible solution to 'fix' the broken Ad Hoc Views is as follows: export affected Ad Hoc View from TIBCO JasperReports® Server repository and save archive in PC unzip the archive locate ad hoc view's topicJRXML.data file open the file in a text editor (it's actually an XML file) and manually remove backslaches in the view parameter defaultValueExpression; for example change from <defaultValueExpression> <![CDATA[java.util.Arrays.asList(new Object[]{"AUS - FAR EAST","BC - FAR EAST \/ SE ASIA ","CHILE - FAR EAST","ECSA - FAR EAST","NZ - FAR EAST","USEC\/USG - FAR EAST"})]]> </defaultValueExpression> to <defaultValueExpression> <![CDATA[java.util.Arrays.asList(new Object[]{"AUS - FAR EAST","BC - FAR EAST \/ SE ASIA ","CHILE - FAR EAST","ECSA - FAR EAST","NZ - FAR EAST","USEC\/USG - FAR EAST"})]]> </defaultValueExpression> save the changes pack the unzipped files back into archive; make sure that resources and index.xml should be the archive root, not somefolder which contains resources, index.xml import the modified archive into v.6.40: login as superuser, go to Manage > Server Settings > Import menu, make sure to check 'Update' option try to open the view Ref. Case 01515698
  17. Issue DescriptionI would like to export an Ad Hoc View Chart as a A4 Landscape PDF file. But the default export PDF file is Letter Portrait page size and orientation. How can I change the behavior? ResolutionWhen an Ad Hoc View is exported to PDF or any other formats, the server automatically creates a temporary report using the default template, which is ‘Actual Size’. Although the ‘Actual Size’ template is meant for online viewing and doesn't restrict the size of the contents, PDF exporter as well as other exporters use template’s page size and orientation. As a result a chart might look not so good as in JRS UI. A possible workaround is to create a custom template based on ‘Actual Size’ template but with required page size and orientation. Then, specify this custom template as a default in config file if it should be applied to all ad hoc views: /WEB-INF/applicationContext-adhoc.xml defaultTemplateUri property Or manually create a report from the affected ad hoc view using custom template. Ref. Case 01523666
  18. Issue DescriptionI created an Ad Hoc View with Dual Level Pie Char. By default, a list of predefined colors are used for slices. How can I change the color of slices? ResolutionNOTE: provided solution tested with TIBCO JasperReports® Server v.6.4.0. It requires Javascript files customizations. Make sure to back the files. Ad Hoc engine uses a list of colors defined in a JavaScript file: webappsjasperserver-proscriptsadhocintelligentChartpalettedefaultPalette.js colors: [ '#0d233a', '#2f7ed8', '#910000', '#8bbc21', '#492970', '#ff7f27', '#ffc90e', '#1aadce', '#c42525', '#158349', '#77a1e5', '#c40062', '#dbaa00', '#4572a7', '#aa4643', '#89a54e', '#80699b', '#74462e', '#c03c03', '#b58c00' ], These colors are used for the inner slices. For outer slices, there is a calculation to define a brighter color based on the parent color: webappsjasperserver-proscriptsadhocintelligentCharthighchartsDataMapper.js brightness = 0.2 - (outerPiecesCounter / rowAxisLeafNode.parent.children.length) / 5; ... color: Highcharts.Color(rowAxisLeafNode.parent.color || colors[0]).brighten(brightness).get() Ad Hoc supports advanced 'colors' property to extend the default palette: http://community.jaspersoft.com/wiki/advanced-chart-formatting If you need just to extend the default palette with your custom colors, you can add colors property with a list of required colors, preferably in hex format. If you don't want to use the default palette but only your custom colors, you can either modify colors [] array in defasultPalette.jsor modify highchartsDataMapper.js script by commenting line ~135 HDM.colors = $.extend(_.clone(defaultPalette.colors), advancedColors); and adding custom code HDM.colors = advancedColors; In this way, Ad Hoc will use only palette specified in colors property. If you use optimized version of scripts, you need either to add _opt=false parameter to the URL or re-compile optimized scripts after the changes as described in the doc: http://community.jaspersoft.com/documentation/jasperreports-server-ultimate-guide/v561/customizing-javascript-files Ref. Case 01481214
  19. Issue DescriptionCustomer created a font extension to use AngsanaUPC font to work with Thai lang text. They identified that some characters are not displayed properly in PDF output while in MS Excel, Word export everything looks good: ResolutionIn order to fix the issue, a property should be added to the report: net.sf.jasperreports.export.pdf.glyph.renderer.blocks.x <property name="net.sf.jasperreports.export.pdf.glyph.renderer.blocks.x" value="thai"/> This bypasses iText's text layout by using Java/AWT to render the text in PDF. After the property applied, generated PDF contains correct charactrers: The property value is Unicode block name, case is ignored: https://en.wikipedia.org/wiki/Unicode_block Ref. Case 01519705
  20. Issue DescriptionI created a JRXML report with Crosstab. One of group column based on a String field which returns period values like 'Aug 2017', 'Jan 2017' etc. By default, the column sorted alphabetically. How can I change it to sort the values as Date type, Jan-2017, Feb-2017 an so on? ResolutionSolution requires creating a custom Java class that implements Comparator interface. That class converts strings with values like 'Apr 2017' into a Date value and then compare them. In order to use custom comparator in Crosstab, report hidden parameter required to call the custom class: <parameter name="myOrder" class="com.sample.DateComparator" isForPrompting="false"> <defaultValueExpression><![CDATA[new DateComparator()]]></defaultValueExpression> </parameter> Then, the parameter is used in crosstab column group comparator expression: <columnGroup name="period" height="20"> <bucket class="java.lang.String"> <bucketExpression><![CDATA[$F{period}]]></bucketExpression> <comparatorExpression><![CDATA[$P{myOrder}]]></comparatorExpression> </bucket> ............ </columnGroup> The custom class should be specified in Import property of the report: <import value="com.sample.*"/> Attached are: - custom comparator Java code - compiled package - JRXML report Ref. Case 01466303 datecomparator_0.java datecomparator.jar support_period_sortorder.jrxml
  21. Issue DescriptionWhen we add a dimension to column grouping we are able to see the data of the dimension in adhoc view, but when we create a report and try to view the report it is throwing an error saying: "calculator not found for java.lang.String" How to fix it? ResolutionAs it turned out, the error was related to the fact, that Ad-Hoc engine tried to apply Sum() calculation on a field which returned integer values but has VARCHAR type in database and java.lang.String type in domain. After default aggregation function was changed to CountAll() in domain designer, customer managed to open the report. Ref. Case 01464329
  22. Issue DescriptionI create a calculated field in ad hoc view, but the item list of "Fields and measures" lined up at this time is different from the order specified at domain creation, it is hard to select. Is there a way to keep the order specified during domain creation when creating calculated fields in ad hoc view? ResolutionBy default, Fields and Measures items are sorted by item label alphabeticaly. The sort order is coded in a Javascript file: webappsjasperserver-proscriptsadhoccalculatedFieldsviewExpressionEditorView.js renderFields function definition, line ~93: .sortBy("label") Commenting out that line resuls in displaying items in the same order they are defned in domain designer. In order to test the solution, you have to either switch JasperReports Server to use non-optimized scripts or add &_opt=false parameter to the URL. Once you test that fix works for you, you need to re-build optimized scripts as described in Ultimate Guide: https://community.jaspersoft.com/documentation/jasperreports-server-ultimate-guide/v561/customizing-javascript-files Ref. Case 01520665
  23. Issue DescriptionI created an Ad Hoc Crosstab with a Datetime column, changed grouping to Month. As a result, values are displayed as 'January 2017', 'February 2017' etc. How can I change that format to a custom one? ResolutionIn JasperReports Server v.6.4.0 there is a way to specify custom datetime format for each grouping. Default formats are defined in WEB-INFapplicationContext-catFactory.xml configuration file: <util:map id="adhocCategorizerMasks"> <entry key="year" value="yyyy"/> <entry key="quarter" value="QQ yyyy"/> <entry key="month" value="MMMM yyyy"/> <entry key="day" value="medium,hide"/> <entry key="hour_by_day" value="short,short"/> <entry key="minute_by_day" value="short,short"/> <entry key="second_by_day" value="short,medium"/> <entry key="millisecond_by_day" value="MMM dd, yyyy hh:mm:ss.SSS aa"/> <entry key="hour" value="hide,short"/> <entry key="minute" value="hide,short"/> <entry key="second" value="hide,medium"/> <entry key="millisecond" value="HH:mm:ss.SSS"/> </util:map>[/code]Java formats are used in this configuration. If wee need to change monthly grouped data format, key="month" value should be modified, for example: <entry key="month" value="MM - yyyy"/> Server restart required to apply the changes. Unfortunately, in previous versions of JasperReports Server, formats are hardcoded. Ref. Case 01517657
  24. Hi, you may need to play with 'ignorePagination' and/or 'onePagePerSheet' parameters in the call: http://community.jaspersoft.com/documentation/tibco-jasperreports-server-rest-api-reference/v640/reports-service Best regards, Andrew
  25. Issue DescriptionI created and Ad Hoc View Crosstab with fields and measures in Columns. If I export the crosstab to Excel or PDF, the column titles are not visible, only measures names are displayed. How to fix it? ResolutionThis behavior is configurable in WEB-INF/applicationContext-adhoc.xml. You need to set the createColumnCrosstabHeaders property of the defaultCrosstabReportBuilder bean to true: <bean id="defaultCrosstabReportBuilder" scope="prototype" class="com.jaspersoft.ji.adhoc.service.CrosstabReportBuilder"> <property name="createColumnCrosstabHeaders" value="true"/> </bean> JasperReports Server should be restarted. Ref. Case 01467650
×
×
  • Create New...