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

prusyn

Members
  • Posts

    45
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Downloads

Everything posted by prusyn

  1. You can define printWhenExpression for detail band. For example, <detail> <band height="30" splitType="Stretch"> <printWhenExpression><![CDATA[<place your condition here>]]></printWhenExpression> ... ... ... </band></detail>[/code]
  2. Issue:[toc on_off::hide=1] Customer has a date field $F{DATE1} as class java.util.Date. Customers requirements are to print and concatenate $F{DATE1} and $F{DATE1} + 6 days So, result will look like this: 01/01/2019 | 01/07/2019 Resolution:First approach would be to create Text Field with expression below: new SimpleDateFormat("MM/dd/yyyy").format($F{DATE1}) + "|" + new java.sql.Date($F{DATE1}.getTime()) .toLocalDate() .plusDays(6) .format(java.time.format.DateTimeFormatter.ofPattern("MM/dd/yyyy"))[/code]The second approach is more flexible and faster. You need parameter: <parameter name="cal" class="java.util.Calendar" isForPrompting="false"> <defaultValueExpression><![CDATA[Calendar.getInstance()]]></defaultValueExpression> </parameter>[/code]and variable: <variable name="newDate" class="java.util.Date"> <variableExpression> <![CDATA[ ( $P{cal}.set($F{birthdate}.getYear()+1900, $F{birthdate}.getMonth(), $F{birthdate}.getDate()) || $P{cal}.add(Calendar.DATE, 6) ) ? null : $P{cal}.getTime() ]]> </variableExpression> </variable>[/code]Result looks like that: http://prntscr.com/m8xtdz Sample report attached.
  3. Hi, I had to play around a bit, but was able to achieve your desired result. I have created parameter: <parameter name="cal" class="java.util.Calendar" isForPrompting="false"> <defaultValueExpression><![CDATA[Calendar.getInstance()]]></defaultValueExpression> </parameter>[/code]and variable: <variable name="newDate" class="java.util.Date"><variableExpression> <![CDATA[ ( $P{cal}.set($F{birthdate}.getYear()+1900, $F{birthdate}.getMonth(), $F{birthdate}.getDate()) || $P{cal}.add(Calendar.DATE, 6) ) ? null : $P{cal}.getTime() ]]></variableExpression></variable>[/code]Result looks like that: http://prntscr.com/m8xtdz I'll attach sample report with sample data. You should be able to run it without any issues. Let me know if this fits your requirements :)
  4. Issue:[toc on_off::hide=1] Customer has problem with some reports execution after upgrade from JRS 6.1 to 6.4. These are reports that has custom chart theme They created the chart theme and upload to the Jasper Server as told in these links: https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v60/chart-themes https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v60/creating-and-uploading-chart-themes However, when running these reports, this error occurs: Chart theme "ComplyChartThemeTemplate" not found. (Error UID: fed1208b-a4a4-4806-8865-00f4043233a6) Resolution:The problem is caused by a bug. Something goes wrong and JR does not load the chart theme extension from the classloader that JRS creates for the jars linked to the report unit. Defect has been logged for it and will be fixed in our future releases. Possble workaround would be to place theme.jar file in classpath, specifically in WEB-INF/lib folder. Also, you may encountered error net.sf.jasperreports.engine.JRRuntimeException: org.exolab.castor.xml.MarshalException: com.jaspersoft.studio.jasper.CachedImageProvider{File: [not available]; line: 2; column: 438} Caused by: java.lang.ClassNotFoundException: com.jaspersoft.studio.jasper.CachedImageProvider..... So, by doing File -> New -> Others -> Chart Themes, JSS creates file named chart_template.jrctx and by default it has <background file ... png .../> specified and point to /net/sf/.../jasperreport.png which doesn't exist. The missing file is why this error happens. So you have to remove <background ../> part from source editor and re-export to jar and deploy to JRS and it worked. There are 2 entries in default theme jrtctx file: <background-image xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" file="net/sf/jasperreports/chartthemes/simple/jasperreports.png" xsi:type="file" /> Here's screencast that demonstrates this behavior. It should explain everything: https://screencast-o-matic.com/watch/cqVDXu3o7v Solution has been tested on JasperReports Server 6.4.3
  5. If i understood you correctly, this is something you want to acheive: http://prntscr.com/lllkox If so, I have attached sample report to my original answer. I hope this helps.
  6. You are using report rendering function for rendering dashboards - That's the problem. You should be using v.dashboard. For example: visualize({ auth: { name: "jasperadmin", password: "jasperadmin", }}, function (v) { var dashboard = v.dashboard({ resource: "/public/Workshop/Profit_Dashboard", container: "#container" });});[/code]
  7. As you might notice in logs, your issue is thrown by SQL Validator. By default it does not allow some SQL queries for security purpose. You can edit security configuration options to allow specific SQL or disable the validation completely: 1 - The following regex fix should work for most cases. In this file: webapps/jasperserver/WEB-INF/classes/esapi/security-config.properties/validation.properties Validator.ValidSQL=^s*(?i)(withs+.*)?(select|call|exec(ute)?)s+[^;]+$[/code]2 - Alternatively turn it off here: webapps/jasperserver/WEB-INF/classes/esapi/security-config.properties security.validation.sql.on=false[/code]
  8. As far as I understand, export to DOC creates tables in table. So from Word perspective if you remove the first page table, you just remove the content of outer table. That is why it doesn't automatically occupy free space, as in fact the space isn't free - it is reserved by first row of outer table. So, if you want to delete the first page table, you also might want to delete the row in outer table. I tried to screencast it. Hope this helps: https://www.screencast.com/t/oQxkgriDDgsV
  9. As I understand the problem is you see two charts, while you should be seeing only one. In this case the problem is that you put the chart in detail band. Everything present in detail band is printed as many times as there are rows in dataset. If you had 100 rows in dataset, you'd end up with 1000 charts :) Another issue you might experience would be Caused by: net.sf.jasperreports.engine.JRRuntimeException: Error incrementing bidimensional dataset. What I would suggest - place Chart into Summary band.
  10. are you able to connect to this db using any sql client just to test if db is working? I mean, looks like schemas are missing at all. Use this article as guide for working with db: https://aws.amazon.com/getting-started/tutorials/create-connect-postgresql-db
  11. Issue:[toc on_off::hide=1] Customer wonders how to hide the button that allows you to select a new domain when using the adhoc view editor. It's identified as "span id = topicMutton" when I inspect the page. I am searched through the themes and cannot find a specific reference to this button, although I may have missed it. My next search will be through the JSP pages, but I'd like to avoid that if possible. Can anyone help me here? Resolution:What you can do here - is to edit theme applied on server. Look at the result: http://prntscr.com/li7o2r Basically, edit or add overrides_custom.css file to theme with something like that: span#topicMutton.button.mutton { display: none;}[/code]And upload it to theme. Here's the screencast to demonstrates how it works: https://www.screencast.com/t/BeMr6s4XnAPN
  12. You can set this in Adhoc Editor itself by right clicking on Date field, like this: http://prntscr.com/li80om Also, you can do same thing on Domain level by editing field Data format in Display tab: http://prntscr.com/li81ge
  13. What you can do here - is to edit theme applied on server. Look at the result: http://prntscr.com/li7o2r Basically, edit or add overrides_custom.css file to theme with something like that: span#topicMutton.button.mutton { display: none;}[/code]And upload it to theme. Here's the screencast to demonstrates how it works: https://www.screencast.com/t/BeMr6s4XnAPN
  14. Issue:[toc on_off::hide=1] Is there an option to check if filed isNull in the filter condition for domain? Equals 'null' returns the wrong result set. Resolution:At this moment this feature is missing. However, there is an existing enhancement request for ability of Domain Filter for null values and empty values. The possible solution is to create a calculated field with boolean type and expression like "IsNull(target_field)" and set a filter on it rather than on target field.
  15. Usually, when you open Domain Designer, it should pop-up what schema to use, like this: https://prnt.sc/li78o3 In your case, can you please in Domain Designer on Tables view, click on Data Source selected: http://prntscr.com/li79bj It should open pop-up Manage Data Source. Click on Select Schemas..: http://prntscr.com/li79sj . "Select DB Schemas" pop-up should appear.
  16. Issue:TIBCO JasperReports® Server allow to hide table report columns if required, so you can exclude from exporting unnecessary table columns. As a part of this functionality, it allows to show previously hidden colums, which are listed as dropdown menu, after clicking Show Columns: The problem comes if you have a lot of columns to hide and drop down menu becomes bigger. If it gets bigger height, it can get invisible for user to choose. The problem is clear on sceenshot below. Resolution:At this moment, it is a known issue, which will be fixed in future releases. Meanwhile, the possible solution would be to apply specific styling for this drop down, used in Show columns tab: ul.pmenu { display: none; max-height: 200px; max-width: 300px; overflow: hidden auto; top: 161px; left: 150px; }I did it by creating new overrides_custom.css file with these styles and reapplying it to theme (pods_summer in example). Provided workaround works in Chrome, but not in Internet Explorer as style selectors are a bit different for IE 10, 11. ul.pmenu { -ms-overflow-y: auto; max-height: 300px; max-width: 300px; }Confirmed as viable solution for JasperReports® Server 6.4.3
  17. Issue:In TIBCO JasperReports® Server 7.1.0 issue has been observed - huge Input Control values break Input Control CSS styles. Please, check screenshot: Resolution:This issue is adressed and will be fixed in upcoming releases. Meanwhile, the possible workaround might be to define custom theme to override default CSS. In this example, I edited easy_access theme by adding few additional styling properies to overrides_custom.ccs: .jr-mMultiselect-listContainer.jr.jr-isInactive { min-width: 300px; max-width: 600px; } .jr-mMultiselect-listContainer.jr.jr-isActive { min-width: 300px; max-width: 600px; }To learn more about themes and how to edit them or create new theme, follow Chapter 6 from JasperReports Server Admin Guide: .
  18. Issue:[toc on_off::hide=1] Sometimes, there is a need of using report parameter names in report development. For example, if user wants parameters name and values to be displayed in exported report. Resolution:$P{REPORT_PARAMETERS_MAP} is one of default report parameters. It is a java Map component, which stores all user defined and built-in parameters and their values. Mostly, it is used to map report parameters to subreports. In this case, it will be used to resolve parameter name by its value. For this purpose, there has been used simple scriptlet, that iterates over map and returns required parameter name. For more information about scriptlets, please check this article. Here's java code of scriptlet: import java.util.Map;import net.sf.jasperreports.engine.JRDefaultScriptlet;import net.sf.jasperreports.engine.JRScriptletException;public class FindKey extends JRDefaultScriptlet { public static <K, V> K getKey(Map<K, V> map, V value) throws JRScriptletException { for (Map.Entry<K, V> entry : map.entrySet()) { if (value.equals(entry.getValue())) { return entry.getKey(); } } return null; }}[/code]This scriptlet has only one method getKey. It takes REPORT_PARAMETERS_MAP and parameter value as inputs. Report expression should look like that:$P{find_key_SCRIPTLET}.getKey($P{REPORT_PARAMETERS_MAP}, $P{p_hireDate}). As result, it displays required parameter name: Works on JasperReports Server aswell. JRXML file of sample report and JAR file of scriptlet attached.
  19. GROUP means that an expression should be evaluated after each group break. NOW specifying that an expression should be evaluated at the exact moment in the filling process when it is encountered. This is covered in the JasperReports API documentation: http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/type/EvaluationTimeEnum.html
×
×
  • Create New...