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

teodord

Members
  • Posts

    5,346
  • Joined

  • Last visited

  • Days Won

    1

 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 teodord

  1. This article shows how to retrieve JSON report data from a remote REST service using the built-in data adapter support from JasperReports Library and Jaspersoft Studio. Note that the same technique can be used to load XML, CSV or Excel data from remote URLs and is not specific to JSON data only. Here we recreate the report shown in this demo, but do so without using the custom web service extension demonstrated there. As opposed to the indicated demo, we are going to create a data adapter of type JSON File, which is a built-in type in JRL and JSS, instead of the custom data adapter type made available by that optional extension used in that demo. The JSON data adapter allows specifying a remote URL instead of a local JSON file, as the source for the data. When using an URL, the button next to the File/URL field changes from File to Options and thus allows setting request parameters and request headers for the HTTP call that will be made to the specified URL to retrieve the JSON data. Once saved, the data adapter file would be available in the list of data adapters from which we can pick during the report creation wizard. The report creation wizard will try connect to the remote URL and retrieve some data. It will show this data in the left panel and allows to select the node in the JSON object which represents the data source records for the report. Once the data source record node selected, it will propose the selection of available fields that can be picked from the record node to use as report fields. At the end of the report wizard, we obtain a JRXML file in which the main dataset has a JSONQL query and dataset fields that have special configuration properties which map them to specific nodes or attributes in the current record JSON node. Adding some fields in the detail band helps complete the creation of a simple tabular report displaying records coming from JSON data loaded from a remote REST location. Attached to this page are the data adapter file and the report template file used in this article. noaadataadapter.xml noaareport.jrxml
  2. This example shows how to use a data adapter to retrieve JSON data from a remote URL and use it to fill a report. The TIBCO JasperReports® Library offers built-in support for loading report data from remote URLs through data adapters. Data in JSON, XML, CSV or Excel format, can be loaded from local files or from remote URLs using data adapters and it can then be parsed into records using data format specific report queries (JSON QL, XPath) and/or report field mapping metadata. For more details about how this sample report uses the JSONQL query language to process the incoming JSON data into data source records, please see this documentation. The following example shows how to retrieve data about the current status of London Tube Network stations in JSON format, from a remote public URL, and use it to generate a report. We first need to create a JSON data adapter file to point to this remote source of data and we are using a TIBCO Jaspersoft® Studio wizard to do so: The tubestatus.jrxml report attached to this page can be open in Jaspersoft® Studio and previewed using the above created data adapter by selecting it in the data adapter combobox at the top left corner of the report designer preview tab as see below: For deploying this report and the data adapter to an instance of JasperReports Server, we would need to first make sure the report references the data adapter, as the preview operation did not actually link the two together. We are going to use a relative path to point from within the JRXML to the data adapter resource we are going to create in TIBCO JasperReports® Server. This is because the JRXML will be uploaded to a JasperReports® Server report unit, which acts itself like a subfolder containing its own resources and thus the JRXML would not be considered as being in the same folder as the data adapter resource. Use two dots to point to the data adapter resource as being in a parent repository folder as seen below: Now let's upload the two files to JasperReports Server. We can do this using either the Web UI of the JasperReports Server instance, or, in this case, the Jaspersoft® Studio plugin. After having configured the connection to our JasperReports Server instance from within JasperReports Server, we create a folder called tubestatus in the Public folder of the JasperReports Server repository. Right click the newly created /Public/tubstatus folder and pick the New option to create a new data adapter file resource. Make sure you use the name of the XML file as the name of your data adapter resource, because this is how we referenced it from the report in a step above. Pick the tubestatusDataAdapter.xml file from the Jaspersoft® Studio project to have it uploaded to JasperReports Server and hit Finish button. Let's create a report unit and upload the JRXML report template file as well. We can give any name we want to the report unit and then pick the local JRXML file from the Jaspersoft Studio project in the workspace. We don't need to specify any data source for this report unit as the data adapter property we set previously in the JRXML report template itself is enough to connect our report to the remote URL from where the JSON data will be read and then processed. After the report unit has been created, we can use the JasperReports Server Web UI to navigate to the repository folder where we uploaded it and run it. tubestatus_0.jrxml tubestatusdataadapter.xml
  3. Hi, The xpath2 is no longer supported. There are newer ways to get XML data from a remote location and query it using XPath. You need to explain where do you get your data from (HTTP, basic authentication, etc) and we'll try to direct you to achieve what you want with current functionality. Have you looked at the /demo/samples/httpdataadapter sample in the recent JR Lib releases? It demonstrates how to run a report against XML data coming from a report URL through HTTP. I hope this helps. Teodor
  4. Hi, What version of JasperReports Library are you using and how did you inspect the dependency tree? Recent versions of our product use a fork of iText called 2.1.7-js6, which you can find here: https://jaspersoft.jfrog.io/jaspersoft/list/third-party-ce-artifacts/com/lowagie/itext/2.1.7.js6/ We upgraded to org.bouncycastle:bcprov-jdk15on:1.52 a while ago. Thanks, Teodor
  5. Hi, JRL uses a forked version of iText 2.1.7 in which we implemented a custom feature to deal with fonts that have ligatures. We stayed with iText 2.1.7 under the terms of the MPL. JRL built-in PDF exporter would not even work with newer iText, because they changed the package names when moving to iText 5+. Thanks, Teodor
  6. Hi, Starting with the latest release of the Jaspersoft commercial product suite (version 7), we have decoupled the version numbers of the Community Editions (CE products) from Pro version numbers. For example, JasperReports Server Pro version 7.1.0 comes with JasperReports Library CE version 6.4.31 (which is a patched re-release of 6.4.3). The JasperReports Library CE and Jaspersoft Studio CE have had three releases since 6.4.3, namely: 6.5.0, 6.5.1 and recently 6.6.0. These CE releases are basically newer than what is found in Pro release version 7. In the future, the JRL CE and JSS CE version numbers will remain behind, in the form of 6.x, while the commercial products will increase their report version at a higher pace. They will no longer be in sync. The main reason to decouple version numbers is the different release cycle that the CE and Pro projects have at Jaspersoft. The CE ones need to have a much higher release rate, with releases being made every couple of months or even more often, while the commercial products are released once every six months or more. Also, commercial releases need to rely on very stable CE releases, which have been "baked" in the community for a while, to surface regressions if any. Thank you, Teodor
  7. Hi, JasperReports uses iText version 2.1.7, which was released under an MPL/LGPL dual license. Later releases of iText, starting with 5.0 have moved onto AGPL, which prevents use in commercial products. We had a brief attempt to upgrade to iText 5+ a few years ago, based on some contract we had with iText, but decided to pull it back as we experienced difficulties. Right now, if you need iText 5+ (although from JRL we don't need any feature that did not exist in iText 2.1.7), you could go with a separate JR exporter project which can be found here: https://github.com/Jaspersoft/jasperreports-pdf-lib5 This exporter is also AGPL, to comply with iText 5+ license. If you indeed purchase iText 5 commercial license, I'm sure we can arrange for a commercial one for the exporter. Right now, the exporter is work in progress, but if there is enough interest, I'm sure it can be finished soon. Thanks, Teodor
  8. Hi, We are using a custom version of iText 2.1.7 because we have fixed a couple of issues and made some improvements in the way certain types of fonts work (ligatures). We have made these modifications under the terms of the LGPL/MPL, under which the original iText 2.1.7 was release. We are not aware of any licensing issue with regards to iText 2.1.7 and so far the company behind iText did not provide details about the problems they found in it. They encourage people to move to iText 5+, which can no longer be used in commercial products unless commercial license is purchased from them. This might explain their current stance on 2.1.7. Thanks, Teodor
  9. You need to explain this again, because it is not clear to me what the problem is. On one hand you say you need to produce a single PDF for all accounts, but then you are concerned it would be about millions of accounts and probably too big. So do you want a single PDF, no matter how big, or what?
  10. Changed Resolution from Open to No Change Required Changed Status from Feedback Requested to Resolved
  11. Changed Resolution from Open to Works as Designed Changed Status from Feedback Requested to Resolved
  12. Changed Resolution from Open to Unable to Reproduce Changed Status from Feedback Requested to Resolved
  13. Changed Resolution from Open to Won't Fix Changed Status from Feedback Requested to Resolved
  14. Changed Resolution from Open to Won't Fix Changed Status from Feedback Requested to Resolved
  15. Changed Resolution from Open to Unable to Reproduce Changed Status from Feedback Requested to Resolved Feel free to reopen this if you still experience the problem and can provide more details to help us reproduce it.
  16. Changed Resolution from Open to Fixed Changed Status from New to Resolved Changed Assigned User from - to @teodord Hi,JRL currently uses Spring 3.2.18-RELEASE artifacts.Thanks,Teodor
  17. Hi, We would need to see the actual report template and maybe a PDF with the wrong output it produces, to understand which case scenario we find ourselves into. In the recently release JR 6.5.0, several problems related to page/column totals and non-splitting bands have been resolved. But if in your case, the problem is caused by the "keep together" feature, than there is little we can do as this feature simply moves content from one page to another and does not recalculate anything after the move. It works like this "by design". Thank you, Teodor
  18. Hi, Your detail band probably had isSplitAllowed=false or splitType=Prevent. This has been fixed in JR 6.5.0. Thanks, Teodor
  19. Hi, There was indeed a bug in the way we deal with fonts while rendering the chart with PhantomJS. This has been fixed now in the JR Library project and will be part of the next library release. But you are using JasperReports Server and right now, I can't promise you when this fix will arrive in JRS. Thank you, Teodor
  20. Hi, You need to package up the Calibri font intro a JR font extension. Basically, the font needs to be available to the Java Virtual Machine that runs the JR engine. Calibri is a Windows font and probably does not exist on the Linux/Unix machine where you run JR Lib and generate the PDF. You can create font extensions in JSS and it would help you package up the TTF files as JAR files, to add to your application classpath. I hope this helps. Teodor
  21. Changed Resolution from Open to No Change Required Changed Status from Feedback Requested to Resolved Hi,You mentioned the right word: "crosstab". If that is a crosstab, then you should use the crosstab component in the report and it will work like you want it to.Thanks,Teodor
  22. Changed Resolution from Open to Unable to Reproduce Changed Status from Feedback Requested to Closed Hi,Feel free to reopen this if you still experience the problem and can provide more details about it.Thank you,Teodor
  23. Changed Resolution from Open to No Change Required Changed Status from New to Resolved Changed Assigned User from - to @teodord Hi,I confirm that the stretchType was the cause of the issue. Stretch type is used when you want some element to grow proportionally with its container. But this is not the case for you here.With the property set, the elements were growing more than needed and they were thrown out below the bottom edge of the container, thus not printing anymore.Things have changed a bit with regards to stretch type in more recent versions of the library, in case you want to upgrade.Thanks,Teodor
×
×
  • Create New...