Jump to content
Changes to the Jaspersoft community edition download ×

imoehld

Members
  • Posts

    5
  • Joined

  • Last visited

imoehld's Achievements

  1. I have reports that contain a logo image (loaded in from the database, converted to a BufferedImage, and passed in as a parameter), and I have set isUsingCache = true for these image elements. This setting works as expected, and significantly reduces the size of the exported pdf's (We have reports that can be hundreds of pages long, so this size reduction is necessary). However, we have a logo image for each organization, and all of the reports for these organizations are generated on the same server. We are concerned that caching these logos could cause the cache to fill and eventually error out. So, my question is relatively simple, how long will these cached images stay on the cache? Are they only cached for the duration of the creation of the report, or do we have to clear the image from the cache?
  2. I got this to work by setting the IS_IGNORE_PAGINATION parameter to false when our format was "PDF" and to true when our format was anything else: if(format.equals("PDF")){ parameters.put(JRParameter.IS_IGNORE_PAGINATION, Boolean.FALSE); } else { parameters.put(JRParameter.IS_IGNORE_PAGINATION, Boolean.TRUE); }[/code]Where "parameters" is the Map<String, Object> that is sent to Jasper.
  3. I believe what I am trying to do is impossible, per a couple sources: https://community.jaspersoft.com/questions/976451/set-report-properties-expression https://community.jaspersoft.com/wiki/how-configure-jasperreports-server-not-truncate-adhoc-crosstabs-columns So, I have transitioned to trying to complete this in Java code. I have run across this example that seems to be exactly what I want: https://community.jaspersoft.com/questions/534046/excel-report-crosstab However, for some reason this solution doesn't work for me (possibly due to the fact that the solution is 9 years old). I do not have access to the JasperReport object, but I have access to a JasperPrint object, which also has a setProperty(String, String) method. Trying to set "JRCrosstab.PROPERTY_IGNORE_WIDTH" to "true" doesn't do anything. I also tried to use an JRXlsExporter's getPropertyUtil() to get access to the propertyUtil's setProperty(String, String) method, but this also doesn't work. Any suggestions on how to get this to work?
  4. I can confirm that the "Format" parameter is being set, as toward the bottom of the page I have: <printWhenExpression><![CDATA[!$P{Format}.equals("XLS")]]></printWhenExpression> This works exactly as expected.
  5. I am attempting to create a report with a crosstab that will ignore the width of the page when exported to Excel, but won't ignore the width of the page when exported to PDF. I am setting the report's ignore width property: <propertyExpression name="net.sf.jasperreports.crosstab.ignore.width"><![CDATA[$P{Format}.equals("XLS") ? ("true") : ("false")]]></propertyExpression>[/code]This is set at the top of the page with the other <property> tags. In my parameters, I also have: <parameter name="Format" class="java.lang.String"/>[/code]When we run this report with Java code and pass a value into the format parameter, this code never ignores the width of the page (even when we assign Format="XLS"). However, if I run this in Jaspersoft Studio, this code will work as long as I have isForPrompting="true" (if it is false and I assign a default value, this code also fails to work). Is this because I am referencing the parameter before it is defined? If so, where should I move the property expression to get this code to work?
×
×
  • Create New...