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

Neobye

Members
  • Posts

    29
  • 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

Posts posted by Neobye

  1. As far as we could test, the image caching is only working for png (/jpeg/tiff/bmp), but not for scalable graphics like svg.

    We would like to use an svg logo in our documents, but when producing documents with tousands of pages, the svg logo is added as many pages as the document has.

    I saw, that the used code for svg is absolutely different from the code used for png.
    For png, the Renderer is identified by id and stored in a HashMap, so that the image with the same renderer is reused from the map.

    While using svg, each svg produces an PdfTemplate with its svg-path in the document.

    I would expect the same mechanism as for png, while the svg-path would be stored only once in the pdf, and each re-occurence would just produce a kind of reference in pdf.

    I'm not very familiar with itext, but I would expect to have such references in iText.

     

    Is there a way to have caching with svg?

  2. We try to fill the reports in a parallel mode to speed up the fill process.
    JasperReports allows to fill a a report with a list of objects (JRBeanCollectionDataSource), but the filling is done serial, even when you use JRThreadSubreportRunnerFactory.

    Therefore we try to use Java parallelStream.


    The trial setup is the following:

    public class MyReportManager{    JasperReport jasperReport;    LocalJasperReportsContext context;        public MyReportManager(InputStream theInputStream){        // single instance of JasperReport //        jasperReport = (JasperReport) JRLoader.loadObject(theInputStream);                // single instance of context //        context = new LocalJasperReportsContext(DefaultJasperReportsContext.getInstance());        context.setClassLoader(getClass().getClassLoader());    }        public parallelFill(List<MyReportData> myReportData){        // parallel fill process        myReportData.parallelStream().forEach(data-> {            JasperFillManager fillManager = JasperFillManager.getInstance(context);            JasperPrint jasperPrint = fillManager.fill(report, data.getParams(), data.getDataSource());            data.setJasperPrint(jasperPrint);        });    }    ...    }[/code]

     

    public class MyReportData{    Map<String, Object> params;    JRDataSource dataSource;    JasperPrint jasperPrint;        public MyReportData(Map<String, Object> theParams, JRDataSource theDataSource){        params = theParams;        dataSource = theDataSource;    }        public Map<String, Object> getParams(){        return params;    }        public JRDataSource getDataSource(){        return dataSource;    }        public JasperPrint getJasperPrint(){        return jasperPrint;    }        public void setJasperPrint(JasperPrint theJasperPrint){        jasperPrint = theJasperPrint;    }}[/code]

     

    When we call the parallelFill with about 15000 ReportData, the process is working...most of the time, but not always.
    Sometimes we suddenly encounter an JRException:

    net.sf.jasperreport.engine.JRException: Byte data not found at: myStyle.jrtxat net.sf.jasperreports.repo.RepositoryUtil.getBytesFromLocation(ReporitoryUtil.java:210)at net.sf.jasperreports.engine.xml.JRXmlTemplateLoader.loadTemplate(JRXmlTemplateLoader.java:114)at net.sf.jasperreports.enginge.fill.JRFillReportTemplate.loadTemplate(JRFillReportTemplate.java:110)...[/code]


    It looks like it tries to load the style in every fill process.


    My Questions:

    • is it possible to use parallel stream in conjunction with JasperFillManager? How do we achieve this?
    • do I have to use a separate context for every fill process?
    • why is the JasperStyleTemplate not loaded once in the JasperReport during it's load through JRLoader?

     

    regards

  3. I would like to have a Header that contains a different title for every detail band in the masterReport.

    Scenario:

    I do have the following layout:

    MasterReport

    • PageHeader -> containing HeaderSubreport & a textFields for "Page / Pages"
    • Detail1 -> containing DetailSubreport1
    • Detail2 -> containing DetailSubreport2

    HeaderSubreport

    • containing Logo & TextField for a HeaderTitle

    DetailSubreport1

    • containing Data1 -> should have Title1 in Header

    DetailSubreport2

    • containing Data2 -> should have Title2 in Header

     

    Question

    Is it possible to define a PageHeader Band in the Master & a Subreport ? (I tried it but it lead to infinite loop)

    Most desired I would like to keep the HeaderSubreport in the PageHeader band of the MasterReport (because of single place of declaration and because of textFields "Page / Pages". But I have to set the title depending on the current DetailSubreport that is currently processed.

    Is there a possibility to set a global variable in the detail band of the Masterreport?

  4. Hy Teodor,

    Is marging mirroring still an unsupported feature in JasperReports?

    iText supports the method setMarginMirroring(true) on the Document (resp. PdfDocument) that does the mirroring of even/odd pages.

    I think it would be nice to have this feature in the JRPdfExporter by setting a JRPDFExporterParameter.MARGIN_MIRRORING or the JRPdfExporterParameter.MARGIN_MIRRORING_TOP_BOTTOM.

     

    What do you think?

     

    regards

    Andi

  5. Found the solution:

    If you take the jasperreports-chart-themes-x.x.x.jar and try to create your custom chart-theme, you 2 possibilities:

    • either just add your customChartPropertiesBean.xml, register it in the chartThemesBeans.xml and repackage to jasperreports-chart-themes-x.x.x.jar
      -> this has the disadvantage that if you like to use this chart-theme, you have to statically package this to your eclipse-plugin net.sf.japserreports_x.x.x.jar to be available during development
    • create your own customChartPropertiesBean.xml, register it in your own customChartThemesBeans.xml and configure this customChartThemesBeans.xml in your jasperreports_extension.properties of your extension jar.
      -> take attention that you use a unique name for your chart themes bundle xml (e.g. myChartThemesBeans.xml), because if you reuse the name "chartThemesBeans.xml" for your custome extension, it won't work!
  6. I got a report that takes 300kb when it's saved as pdf.

    When I print this report directly from JasperReports, it sends about 130mb to the printer.
    But the same report printed from Acrobat only sends about 3mb.

    When I remove the charts from the report, both JasperReports-printing and Acrobat-printing are equal.

    I already tried to switch the render type in Jasperreports between default, draw, image, svg, but with no change to memory consumtion in printer.

    What could be the problem with charts?

  7. I created my own custom charttheme as a spring-bean-based-extension.jar

    It works in the runtime if I add the spring-bean-based-extension.jar to the classpath.
    But I also want to use the charttheme in Jasperstudio during design-time. Jasperstudio doesn't seem to recognize my custom charttheme meanwhile if I put the spring-bean-based-extension.jar to the classpath of the project.

    Question:

    • How do I have to configure Jasperstudio/MyProject so that my custom charttheme is available for selection in the properties of the charttheme editor.
    • Is the spring-bean-based charttheme the better one or shall I use the .jrctx approach (castor). I have the problem that I have to remove shadows in PieCharts and Labels and found no solution in the .jrctx apporach, but with the spring-bean approach it's very easy and clear.

    BTW: It works in iReport if I add my spring-bean-based-extension.jar to the classpath of iReport.

  8. I like to use bookmarking in pdf creation out of JasperReports.

    Therefore I use the anchorNameExpression-tag and the bookmarkLevel-attribute on textField elements. They automatically produce bookmark in pdf when the jasperPrint is exported as pdf.

    But the position of the bookmarks are calculated with the wrong position. They use relative position of the text elements instead of absolute position on a page.

    What I do is the following:

    I got a jrxml which contains the following elements

    • textField1 (position x=10, y=10)
    • a frame2 (position x= 50, y=50), which contains itself a textField2 (position x=5, y=5)

    I have designed the following anchors in jrxml:

    • textField1: anchorName="bookmark1", bookmarkLevel=1
    • textField2: anchorName="bookmark2", bookmarkLevel=1

    What happens is that the bookmarks in pdf will have the following positions:

    • bookmark1: position x=10, y=10
    • bookmark2: position x=5, y=5

    -> the bookmark should have the absolut position, calculated with its surrounding container:

    • bookmark2: position x=55 ( sum of the x-position of the frame and the x-position of the textField2). Same for y-position
×
×
  • Create New...