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 created a report mandatory Text input control with a regular expression to restrict usage of empty string. But when I run the report, it allows applying empty string (null) as the input control value which does not meet our requirements. How to configure JasperReports Server to apply regular expression even on empty string? ResolutionWhen defining text input controls, the default server behavior allows empty strings, even if you've configured a regular expression and made the input control mandatory. In order to change the server behaviour, you need to set property to true: applyRegexpToEmptyString in /WEB-INF/applicationContext-cascade.xml config file. The default value of false gives the traditional behavior: even if a regular expression is defined, it is not applied to empty strings. If you want to strictly enforce the regular expression, even on empty input strings, set this property to true. Ref. Case 01465816
  2. Issue DescriptionWe need to localize 'Diagnostic Report' report Input Control label ('Ignore Pagination') and List Of Values (Yes/No). ResolutionIn order to localize 'Diagnostic Report' report Input Control, the next steps should be performed: Create bundles files for each required locale. Attached are 2 files for default and deutsch locales. diag.properties content: IS_IGNORE_PAGINATION=Ignore Pagination EN IS_IGNORE_PAGINATION_DESC=If checked, the full report will show on one page EN YES=Yes EN NO=No EN diag_de.properties content (as an example, you should translate the content): IS_IGNORE_PAGINATION=Ignore Pagination DE IS_IGNORE_PAGINATION_DESC=If checked, the full report will show on one page DE YES=Yes DE NO=No DE Using Jaspersoft Studio, upload these files to Diagnostic report unit using New > Resource Bundle context menu In Studio, open the input control in question and change it's name and description to $R{IS_IGNORE_PAGINATION} $R{IS_IGNORE_PAGINATION_DESC} accordingly. In Edit Resource window, go to 'Input Control' tab , Local Resource and replace LOV item name from Yes to $R{YES} and from No to $R{NO} Submit the changes and re-run Diagnostic report in JasperReports Server. Solution tested with TIBCO JasperReports Server v.6.3.0 Ref. Case 01439173
  3. Hi, have you tried a solution provided in the similar question? http://community.jaspersoft.com/questions/823038/passing-main-parameter-sub-datasets-jasperstudio Best regards, Andrew
  4. Hi, after adding an Image element to report, you should be able to use any field from report dataset in image expression. In JRXML it looks like <image> <reportElement x="9" y="18" width="50" height="50" uuid="fd0c1fc5-742f-472b-b048-bc48c461a58f"/> <imageExpression><![CDATA[$F{img}]]></imageExpression> </image> Have you tried it? Best regards, Andrew
  5. Hi, according to Admin Guide, least restrictive permission should be applied: http://community.jaspersoft.com/documentation/tibco-jasperreports-server-administration-guide/v62/repository-permissions-0 Best regards, Andrew
  6. QuestionI created an Ad-Hoc view by using one calculation measure with Average() function and one dimension using sample supermart domain. When I observed the query generated I do not see an AVG function in the query. Could you please let me know the steps to validate the function? ExplanationSome of functions available in Calculated fields / measures are 'translated' and included into generated SQL while others are applied to returned dataset in memory. Function Average() is the one applied in memory, that is why you do not see it in generated SQL. You can debug the underlying behaviour by enabling a few debug parameters: - Ad Hoc WorkingDataSet- SQL query executer- Groovy code generation for memory datasets (including Ad Hoc dynamic filters) If you repeat the steps and review WEB-INFlogsjasperserver.log file, you can see something like (from my sample ad-hoc view, 'New Measure is calc measure used Absolute function'): DomainDataStrategy,http-apr-8630-exec-10:449 - complex filter in query: ((public_orders.shipcountry in ('Canada', 'Austria', 'USA')) and (NewMeasure in (10251, 10253, 10254, 10275, 10276, 10297, 10310, 10313, 10317, 10326, 10330)))2017-01-16 12:49:28,587 DEBUG CommonDomainDataStrategy,http-apr-8630-exec-10:489 -2017-01-16 12:49:28,587 DEBUG CommonDomainDataStrategy,http-apr-8630-exec-10:490 - hybrid calc DomainFilter2017-01-16 12:49:28,588 DEBUG CommonDomainDataStrategy,http-apr-8630-exec-10:498 - mem field public_orders.shipcountry: expr = shipcountry, type = java.lang.String2017-01-16 12:49:28,588 DEBUG CommonDomainDataStrategy,http-apr-8630-exec-10:498 - mem field NewMeasure: expr = null, type = java.lang.Integer2017-01-16 12:49:28,588 DEBUG CommonDomainDataStrategy,http-apr-8630-exec-10:510 - mem filter: ((shipcountry in ('Canada', 'Austria', 'USA')) and (Absolute(orderid) in (10251, 10253, 10254, 10275, 10276, 10297, 10310, 10313, 10317, 10326, 10330)))......Native query: select Sum("freight") as "Sum_freight","orderid","shipcountry","shipname"from "public"."orders"group by "orderid", "shipcountry", "shipname"order by "orderid", "shipcountry", "shipname"limit 200001 'Mem filter' means that filter applied in memory to result set returned by the query without WHERE clause..Ref. Case 01460258
  7. Hi, please find attached a sample Java code to create Table component dynamically. Hope, this helps you to achieve your requirements Best regards, Andrew
  8. Hi, it depenends on your requirements. You mentioned users in question: if I login from User A, Department A data should be displayedYou can use any of the built-in parameters per your scenario. Best regards
  9. Hi, jJasperDesign object can be created dynamically, without using a prepared JRXML file. Please review provided sample: http://jasperreports.sourceforge.net/sample.reference/noxmldesign/index.html Best regards, Andrew
  10. Hi, you can try to use Tooltip Formatter function to customize tooltip: http://community.jaspersoft.com/wiki/functions-can-be-used-format-html5-datalabels-and-tooltips Best regards, Andrew
  11. Hi, what you can try is to use LoggedInUsername buit-in parameter to retrieve logged in user and use it in a query to retrieve requried records: http://community.jaspersoft.com/wiki/built-parameters-logged-user Best regards, Andrew
  12. Issue DescriptionCustomer deployed TIBCO JasperRepors® Server v.6.3.0 with Oracle database respository using native Oracle JDBC driver. Now, they need to enable Oracle Advanced Security feature on the database side and configure TIBCO JasperReports®Server accordingly. ResolutionOracle Advanced Security (OAS) provides industry standards-based data privacy, integrity, authentication, single sign-on, and access authorization in a variety of ways: https://docs.oracle.com/cd/E11882_01/network.112/e40393/preface.htm#ASOAG10081 Customer shared sqlora.net config file with OAS details: [/code]NAMES.DIRECTORY_PATH = (TNSNAMES, EZCONNECT)ADR_BASE = /opt/oracle/baseDEFAULT_SDU_SIZE = 32767RECV_BUF_SIZE = 1875000SEND_BUF_SIZE = 1875000SQLNET.EXPIRE_TIME = 1SQLNET.ENCRYPTION_CLIENT = requiredSQLNET.ENCRYPTION_TYPES_CLIENT = (AES256)SQLNET.CRYPTO_CHECKSUM_CLIENT = requiredSQLNET.CRYPTO_CHECKSUM_TYPES_CLIENT = (SHA1)SQLNET.ENCRYPTION_SERVER = requiredSQLNET.ENCRYPTION_TYPES_SERVER = (AES256)SQLNET.CRYPTO_CHECKSUM_SERVER = requiredSQLNET.CRYPTO_CHECKSUM_TYPES_SERVER = (SHA1)SQLNET.ALLOWED_LOGON_VERSION = 12TIBCO JDBC driver for Oracle supports Oracle Advanced Security (OAS) data encryption and data integrity feature, including support for the following new connection properties: DataIntegrityLevel - sets the level of OAS data integrity used for data sent between the driver and database server.DataIntegrityTypes - specifies one or multiple algorithms to protect against attacks that intercept and modify data being transmitted between the client and server when OAS data integrity is enabled using the DataIntegrityLevel property.EncryptionLevel - determines whether data is encrypted and decrypted when transmitted over the network between the driver and database server using OAS encryption.EncryptionTypes - specifies one or multiple algorithms to use if OAS encryption is enabled using the EncryptionLevel property.In order to configure the server to use TIBCO JDBC driver for Oracle, the next steps should be performed: copy TIoracle-x.y.z.jar JDBC driver to <apache-tomcat>/lib foldermodify webapps/jasperserver-pro/META-INF/context.xml file, jdbc/jasperserver resource definition:change driverClassName to "tibcosoftware.jdbc.oracle.OracleDriver" change connection url to a value like "jdbc:tibcosoftware:oracle://servername:1521;SID=ORCL;DataIntegrityLevel=required;DataIntegrityTypes=SHA1;EncryptionLevel=required;EncryptionTypes=AES256" [/code]<Resource name="jdbc/jasperserver" auth="Container" type="javax.sql.DataSource"maxActive="100" maxIdle="30" maxWait="10000"username="JASPER" password="xxxxxxxxx"driverClassName="tibcosoftware.jdbc.oracle.OracleDriver"accessToUnderlyingConnectionAllowed = "true"validationQuery="SELECT 1 FROM DUAL"testOnBorrow="true"url="jdbc:tibcosoftware:oracle://servername:1521;SID=ORCL;DataIntegrityLevel=required;DataIntegrityTypes=SHA1;EncryptionLevel=required;EncryptionTypes=AES256"/> clear application server temp / work folders, start the serverThe exact value of the OAS related properties depends on values specified in sqlora.net file Ref. Case 01445369
  13. Issue DescriptionI created a crosstab Ad Hoc view with more than 7 columns and saved it without any issues. When I try to create a report using a custom developed template or any other except 'Actual Size', I get "Not enough space to render the crosstab." error. I'd like to modify the error message to be clearer for our end-users. ResolutionThe 'Actual size' template works for the crosstab because it allows the crosstab to freely stretch horizontally to the right. The other templates impose the crosstab to fit within the page width, and if the crosstab has many row groups, the group headers do not fit within the page. As a result, "Not enough space to render the crosstab." error generated PLEASE NOTE: the solution described here requires modification one of core jar package and is not officially supported. It's up to your responsibility to apply it. The error message is taken from jasperreports_message.properties file locate in WEB-INFlibjasperreports-X.Y.Z.jar file. Obtain the file from the server Unpack the file (it is a zip archive) Open jasperreports_message.properties file in text editor, locate string net.sf.jasperreports.exception.crosstabs.not.enough.space=Not enough space to render the crosstab[/code]Change the error message to required value Pack all files back into jasperreports-X.Y.Z.jar archive and replace it in WEB-INFlib folder (TIBCO JasperReports® Server should be stopped). Solution tested with TIBCO JasperReports Server v.6.3.0 Ref. Case 01443237
  14. Issue DescriptionI created a crosstab Ad Hoc view with more than 7 columns and saved it without any issues. But when I try to create a report using a custom developed template or any other except 'Actual Size', I get "Not enough space to render the crosstab." error. I can create a report with 'Actual Size' only template, but I have to apply my custom one. ResolutionThe 'Actual size' template works for the crosstab because it allows the crosstab to freely stretch horizontally to the right. The other templates impose the crosstab to fit within the page width, and if the crosstab has many row groups, the group headers do not fit within the page. As a result, "Not enough space to render the crosstab." error generated. The 'Actual Size' template contains a special property that tells the engine to stretch the report horizontally: <property name="com.jaspersoft.jasperserver.adhoc.actual.size" value="true"/> To be added to a custom template, the property allows to generate reports with 'wide' crosstab and avoid the error. This solution was tested with TIBCO JasperReports® Server v.6.3.0. Ref. Case 01443851
  15. Issue DescriptionWe have created an Ad-Hoc view with a BAR chart. Customer has a requirement of presenting more than 500 records of yAxis data on the chart. When we tried presenting the same the data is getting cluttered, labels in yAxis are overlapped. Could you please suggest us steps to solve this. ResolutionOne of the easiest solution is to set 'Interval between Y-axis labels' chart property to 2 or higher value if required. This property uses Highcharts' one - yAxis.labels.step http://api.highcharts.com/highcharts/yAxis.labels.step Setting the step to 2 shows every other label: Ref. Case 01465532
  16. Issue DescriptionWe have a custom application within which we have integrated JasperReports Server using iframe. Both the applications are on different domains. User is logged in to JasperReports Server and JSESSIONID cookie is created. We need to fetch this JSESSIONID from JasperReports Server and pass it to the application for futher usage within the same session. ResolutionIn most application servers default configuration, the HTTPOnly flag included in Set-Cookie HTTP response header to help prevent cross-site scripting attacks. This flag prevents passing JSESSIONID cookie from iFrame into the parent window. https://www.owasp.org/index.php/HttpOnly As a solution, you can disable the flag. For example, for Tomcat it is done in the next way: Locate Apache Tomcat application server context.xml file usually located in<tomcat>/conf/context.xml Edit the file by adding useHttpOnly="false" property:<Context useHttpOnly="false"> .................. </Context> Restart TomcatAfter these steps, you should be able to retrieve iFrame embedded page cookie from the parent window using JavaScript : window.frames[0].document.cookie[/code]As a test, you create a sample HTML page: <html> <head> <title></title> <script> function onMyFrameLoad() { alert(window.frames[0].document.cookie); }; </script> </head> <body><iframe id="jrs_frame" src="http://localhost:8630/jasperserver-pro/flow.html?_flowId=searchFlow&standAlone=true&j_username=jasperadmin|organization_1&j_password=jasperadmin&decorate=no", width="1000px", height="600px" onload="onMyFrameLoad(this)"/><body></html>[/code]Place the page in Tomcat and open it a browser As a result, alert message displays cookies including JSESSIONID, please find attached printscreen Ref. Case 01457000
  17. Issue DescriptionWe have created a jrxml based report and deployed at the Jasper Server. A chart in a report, which is filled data by executing the query in the Sub DataSet. Instead of executing the query, we need to pass the java List<Map> or List<?> as datasource to the chart. We can call the java class from jrxml based report (Have called the java class in a textField). But, we need to pass this collection to a chart. How to configure the jrxml which support the java collection as datasource to a chart? Please give us a sample report & provide steps to try it in our end. ResolutionWhat you need to do is to wrap the List of maps/objects in a JRMapCollectionDataSource/JRBeanCollectionDataSource instance. Please find attached a report which uses a JRMapCollectionDataSource with hardcoded values (written as Groovy literals) to fill a chart. The main idea is to specify property JRDatasource expression, please find attached printscreen: In sample report we use: new net.sf.jasperreports.engine.data.JRMapCollectionDataSource ( [ ["key" : "a", val: 5], ["key" : "b", val: 8], ["key" : "c", val: 3] ])[/code]but you can modify it per your requirements. The same idea can be used if you need to pass List of maps/objects to Table component. Ref. Case 01454782
  18. Issue DescriptionCustomer has a requirement to create a report which calls custom PostgreSQL function with 'character varying[]' parameter type (array of variable string). The question is how to pass java.util.Collection parameter to the function? ResolutionLet's assume the custom function DLL looks like CREATE OR REPLACE FUNCTION p1_matrix_arr_text(agreementtype_ar character varying[]) RETURNS text AS .... In JasperReports we usually use java.util.Collection type to work with list of values but java.util.Collection object can not be used directly in query in JasperReport. Within PostgreSQL the following SQL should be used to call the function: select p1_matrix_arr_text from p1_matrix_arr_text ('{par_value1,par_value1}') In order to 'convert' JasperReports' collection into the array of strings, we will create a Scriptlet with following Java code: public String Collection2String(java.util.Collection myCollection) throws JRScriptletException { StringBuilder sb = new StringBuilder(); Integer cnt = new Integer(1); sb.append("'{"); for (Object obj : myCollection) { String s = (String) obj; if (cnt == 1) {sb.append(s);} else {sb.append(",").append(s);} ++cnt; } sb.append("}'"); return sb.toString(); } The scriptlet function returns a string like {val1,val2,val3,...,valN} built on inbound java.uitl.Collection parameter. The next step is to compile the scriptlet, pack it to a JAR file and configure Jaspersoft Studio to use that scriplet. In report JRXML file, we need to specify 'Scriptlet Class' property to use our custom class. Due to some limitations, JasperReports Library does not allow using Collection type parameter in query, even if it as a part of expression like select p1_matrix_arr_text from p1_matrix_arr_text($P{REPORT_SCRIPTLET}.Collection2String($P{p_collection})) To avoid this limitation, we need to create a new String parameter p_string with expression $P{REPORT_SCRIPTLET}.Collection2String( $P{p_collection})So, the report query we use is: select p1_matrix_arr_text from p1_matrix_arr_text($P!{p_string})As a result, we can run the report, pass collection to stored function and get the function output. In order to make the report work in JasperReports Server, the scriptlet JAR file should be placed into WEB-INFlib folder. Attached are complete scriptlet code and report JRXML file Ref. Case 01443237 myutils.java pgsql_function.jrxml
  19. Hi, have you copied required JDBC driver (oajc.jar I guess) to WEB-INFlib folder? Best regards, Andrew
  20. Hi, you can specify your custom function in WEB-INFapplicationContext-semanticLayer.xml to convert varchar to float. There is str2int function already defined in the file, within "sqlserverGenerator" bean: <entry key="str2int"> <value>"cast(" + sqlArgs[0] + " as numeric(10,0))"</value> </entry> You can add your custom one like <entry key="str2float"> <value>"cast(" + sqlArgs[0] + " as float)"</value> </entry> then restart the server and use str2float() function in Domain Calculated field Best regards, Andrew
  21. Issue DescriptionCustomer would like to add a custom function to a list of functions available in Ad Hoc View Calculated Measure/Field mode . ResolutionThe Calculated Field or Calculated Measures dialog box allows you to create a calculated field or measure. TIBCO JasperReports® Server comes with a list of predefined functions, described in JasperReports Server User Guide: http://community.jaspersoft.com/documentation/tibco-jasperreports-server-user-guide/v630/calculated-fields-reference The list of functions defined in config file WEB-INFapplicationContext-el-operators.xml Let's review how to add ASCII PostgreSQL function which returns ASCII code of the first character of the argument, to the list. Solution tested with JasperReports Server v.6.3.0. https://www.postgresql.org/docs/9.4/static/functions-string.html 1. Add ASCII function definition within list <util:list id="operatorDefinitionList"> <bean parent="functionDef"> <property name="name" value="ascii"/> <property name="javaType" value="java.lang.Integer"/> <property name="argumentTypes"> <list> <value>#{ objectTypeMapper.checkType('String') }</value> </list> </property> <property name="properties"> <map> <!-- show in calc field dialog --> <entry key="inAvailableFunctions" value="true"/> <!-- always run in SQL --> <entry key="alwaysInSQL" value="true"/> </map> </property> <property name="inMemory" value="false"/> </bean>[/code] 2. The next step is to add the custom function description available in Ad-Hoc designer when you click on the function. You can achieve it by adding description text into bundle files: WEB-INFbundlesadhoc_messages.properties under # Functions descriptions section, for example: adh.calculated.fields.function.description.ascii=Returns ASCII code of the first character of the argument[/code] 3. After all the changes done, you should stop application server, clear temp folder and cache, start the server. Browser cache should be cleared as well. As a result, custom ASCII function is available in Ad Hoc Calculated Measure/Field mode: Ref. Case 01444676 UPD: How to Display Ad Hoc View Custom Function Arguments
  22. Work Around to Solve "An error occured while performing the previous request" When Adding Calculated Field/Measure with Integer() Function to Ad Hoc CrosstabThere’s a known issue in JasperReports Server v6.2,v.6.3, where it is impossible to add a custom calculated field/measure if it uses Integer() function. For example, a user creates an Ad Hoc view with Crosstab in JasperReports Server with a custom calculated measure using Integer() function. Attempt to add the calculated measure to Crosstab failes with 'An error occured while performing the previous request' message. Logfile contains stacktrace like ERROR AdhocAjaxController,http-apr-8630-exec-3:954 - ad hoc controller exception: An error occurred while performing the previous request.java.lang.RuntimeException: groovy evaluation failed on string if (args[0].getObjectType().toString() == 'String') { return args[0].value } else { return sqlArgs[0] } and expression Integer(store1.store_postal_code) at com.jaspersoft.commons.semantic.dsimpl.SQLGenerator.generateSQLForFunction(SQLGenerator.java:1266) at com.jaspersoft.commons.semantic.dsimpl.SQLGenerator.function(SQLGenerator.java:1212).......at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source)Caused by: java.lang.NullPointerException at com.jaspersoft.commons.semantic.dsimpl.SQLGenerator.generateSQLForFunction(SQLGenerator.java:1261) ... 161 more[/code] The same error appears in logfile in case of using the calc measure as a filter, there is no error message in UI though. We already had a bug report to address this problem. Until an official fix is made available, a user can use the following approach to work around the problem: use str2int() function instead of Integer() Although, the function str2int does not present in the list of available functions, it is possible to type it manually and it works as expected. Case #01444676
  23. Issue Description:Customer uses Maps Pro map and needs to display circle markers smaller or larger by dynamic values from a database, for example: the population of each region. Resolution:Maps Pro (or Fusion Maps) markers have a few properties that can be used to achieve the requirements: shapeId - using this attribute, you can set the shape that this marker will assume on the map. There 4 default shapes - circle, arc, triangle or diamondradius - in case of arc, circle or polygon, this attribute lets you set the radius of the sameTo have markes as circle with dynamic size, specify these 2 properties for the map <c:itemProperty name="shapeId" value="circle"/> <c:itemProperty name="radius" value="10"> <valueExpression><![CDATA[$F{population}/500000]]></valueExpression> </c:itemProperty> You may need to play with the radius expression to have required marker size. Ref. Case #00071793
  24. Issue DescriptionBy default, in commercial editions of TIBCO JasperReports® Server only superuser has access to 'Log Collectors' menu: http://community.jaspersoft.com/documentation/tibco-jasperreports-server-administrator-guide/v621/using-log-collectors Customer needs to configure JasperReports Server to allow ROLE_ADMINISTRATOR role access to log collectors. ResolutionIn order to make Log Collectors work with ROLE_ADMINISTRATOR role, you have to modify WEB-INFapplicationContext-security-pro-web.xml config file: add the following line within security:filter-security-metadata-source definition<security:intercept-url pattern="/logCollectors.html" access="ROLE_ADMINISTRATOR" /> permit access to /rest_v2/diagnostic URL for ROLE_ADMINISTRATOR:<security:intercept-url pattern="/rest_v2/diagnostic/**" access="ROLE_SUPERUSER,ROLE_ADMINISTRATOR" /> Restart JaspreReports Server, log in as jasperadmin and manually point to jasperserver-pro/logCollectors.html page in URL. Solution tested in JasperReports Server v.6.3.0. Please note, Log Collectors feature is not fully designed/tested to work with multitenancy (under jasperadmin) in v.6.3.0. Especially, there is no data isolation within a specific organization in generate logs. That is, jasperadmin can get all server-related data. Ref. Case 00071520
  25. Issue DescriptionI have a HTML scatter chart. In our data it's quite frequent that 2points from different series will have exactly the same x,y value.I'd like to define the size, symbol and color of 3 first series, so that the user will definitely see that there are 2 points and not 1. ResolutionYou can define the markers per series index by sorting by the series field and defining a variable that counts distinct field values. Then, create Bucker Properties for each of required HTML5 chart property: Property Name: colorProperty expression: $V{markerColors}.get(($V{nameCount} - 1) % $V{markerColors}.size())Property Name: radiusProperty expression: $V{markerRadii}.get(($V{nameCount} - 1) % $V{markerRadii}.size())Property Name: symbolProperty expression:$V{markerSymbols}.get(($V{nameCount} - 1) % $V{markerSymbols}.size())[/code]Where the variables are Lists of values (java.util.List): markerColors - java.util.Arrays.asList("rgba(223, 183, 103, .5)", "rgba(119,152,191,.5)", "rgba(119,191,152,.5)")markerSymbols - java.util.Arrays.asList("square", "triangle", "triangle-down")markerRadii - java.util.Arrays.asList(5, 10, 15)[/code]The next step is to specify the bucket property values as Measure advanced properties Please find attached JRXML report that demonstrates the idea. Ref. Case 00071530
×
×
  • Create New...