Jump to content
Changes to the Jaspersoft community edition download ×

ktalarico

Members
  • Posts

    77
  • Joined

  • Last visited

  • Days Won

    1

ktalarico last won the day on January 8

ktalarico had the most liked content!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

ktalarico's Achievements

  1. Did anyone find a resolution to this? The issue is with jquery in the javascript. My CVC uses jquery also. It seems as if the exporter does not know about jquery. With additional log settings - this error is generated: ReferenceError: jQuery is not defined\n at file:///tmp/jr_res_16848789916710125977_clusteredmap.min.js:63:9\n
  2. I solved this issue using this post: https://community.jaspersoft.com/knowledgebase/how-to/accessing-jsqueryjs-custom-ui-pages-starting-jasperreports-server-v800/ Starting with JasperReports® Server v8.0.0 the libraries used by JasperReports® Server will not be exposed to the global scope. We are using jquery in the javascript accessed by the CVC. Therefore, jquery needed to be installed in the scripts directory on the server. Then needed to add this script tag to decoratorMinimalImports.jsp file: <script src="${pageContext.request.contextPath}/scripts/jquery.js"></script>
  3. We have a CVC that stopped working after installing on Jasper 8.2 server. The CVC is a Google Map with clustered markers. There is very little feedback to diagnose the condition other than the "Report render error". Nothing in the logs or developer console. I have a feeling there may be a missing configuration. I have installed Chromium on the server and set the chrome path in js.config.properties. When I try to run it in Studio it fails with net.sf.jasperreports.engine.jrruntimeexception: java.util.concurrent.timeoutexception. Tried setting the chrome timeout to 2 minutes. I know it's a not a database timeout because I can fetch the data fairly quickly in the SQL dialog. Any thoughts? clusteredmap.js main_jrxml
  4. This demo was executed using TIBCO JasperReports® Server 7.2 and Postman v7.16.1. BackgroundDeploying report (jrxml) files to the Jasperserver repository can become time consuming using Jasperserver's user interface or even by publishing via Jaspersoft Studio. Imagine you've made a change to a report that lives in multiple organizations or you've made a change to multiple dashlets in a dashboard that lives in multiple organizations. You can spend hours deploying the reports to the server if you have several iterations of changes to test. By leveraging Jasper's REST API and Postman Collections, this amount of time can be reduced to seconds. Step by Step GuideIn this example, we will create three requests inside of a Postman collection. The first is a GET request that will retrieve the appropriate report descriptor for the report unit. We will store the descriptor in a variable which will be used in the second request to update the report unit. Note that the Jasper REST API requires a complete report descriptor in order to update the report unit. The second is a PUT request that allows us to update the report unit. We are simply sending the report descriptor we retrieved in the first request. The sole purpose of doing this is to trigger Jasperserver to modify the "updateDate" attribute of the report unit so that we have a record of when we modified the report. The third and final request will update the jrxml file. [toc]Before creating the collection, create an environment in Postman within which you will store variables.Click on the "Manage Environments" icon . For this example, our environment is called "Dev". Create a variable in the "Dev" environment called "reportDescriptor". Figure 1 - create Dev environment with variable Create a new collection in Postman, providing your Jasperserver credentials on the Authorization tab. Use type Basic Auth. In this example, our collection is called "Demo". Figure 2 - create a new collection Add a GET Request to the Demo collection. In this example, our request is called "Get demo report descriptor." Note that you can retrieve the report URL by viewing the Path in the report's properties in Jasperserver. Figure 3 - report path Define two headers in the request. The first should have a key = "Accept" with a value of "application/json". The second should have a key = "Content-Type" with a value of "application/repository.reportUnit+json". Figure 4 - Headers of GET demo report descriptor In the Pre-request Script of the request, clear the reportDescriptor variable. Figure 5 - Pre-request Script of Get demo report descriptor In the Tests section of the request, set the reportDescriptor variable equal to the response body. Figure 6 - Tests of Get demo report descriptor Click the "Send" button to test the GET request. It should respond with at status of 200 OK as well as the report descriptor that is now stored in a variable. Figure 7 - response status of Get demo report descriptor If you want to verify what is being stored in the reportDescriptor variable, click the "Environment Quick Look" icon Figure 8 - contents of reportDescriptor variable Add a PUT Request to the Demo collection. In this example, our request is called "Update demo report unit." Provide the following keys in the Headers tab. Figure 9 - Headers of Update demo report unit In the body, specify the reportDescriptor variable enclosed in double curly brackets. The Body format should be "raw". Figure 10 - Body of Update demo report unit In the Pre-request Script tab, get the reportDescriptor variable. Figure 11 - Pre-request Script of Update demo report unit Click the "Send" button to test the PUT request. It should respond with a status of 200 OK. It should also return an updated report descriptor. Note that the version changed from 4 to 5. This is why we must always perform a GET request to retrieve the appropriate descriptor prior to updating. Jasperserver will update the version number behind the scenes each time we send a PUT request. If we do not provide the correct version number, Jasper will respond with a "mismatched version" error. Figure 12 - response of Update demo report unit Add a final PUT Request to the Demo collection. In this example, our request is called "Update demo report jrxml." You will need to query the jasperserver database to get the appropriate URL as this cannot be obtained by browsing the repository. Figure 13 - SQL query to obtain approriate URL SELECT concat(jrf.uri,'/',jir.name) FROM JIResource jirLEFT JOIN JIResourceFolder jrf ON jrf.id = jir.parent_folder WHERE jir.resourceType = 'com.jaspersoft.jasperserver.api.metadata.common.domain.FileResource' AND jir.name LIKE '%Demo_Report%'[/code] Figure 14 - Headers of Update demo report jrxml The body type should be "binary". Click "Select File" and browse to the location of the jrxml file on your PC. Note that you should configure your Working Directory in Postman to point to the location where you store your jrxml files. Select File-Settings. In the General tab you will see a WORKING DIRECTORY section where you can specify the location. Figure 15 - Postman Working Directory Figure 16 - Body of Update demo report jrxml Click the "Send" button to test the request. It should respond with at status of 200 OK. It should also return an updated descriptor for the jrxml. Figure 17 - response of Update demo report jrxml Continue to add requests to your collection as needed. Run your collection by clicking the "Play" button to the right of your collection name then clicking "Run". Figure 18 - run the Demo collection The Collection Runner will open up a separate window. Click "Run Demo". Figure 19 - Collection Runner Figure 20 - Collection Runner summary Page:
  5. Note that other times you will get a jquery error: jQuery.Deferred exception: s is not a constructor TypeError: s is not a constructor[/code]Solution below resolves both
  6. Solution provided by Tibco support: Our engineering team investigated this and says that the issue seems to be caused by some strange behavior in require.js. They say that the issue can be fixed by adding the module name in dashboardHyperlinkHandlerUpdateDashboardParams.js like this: replace define(function(require) {with define("dashboardHyperlinkHandlerUpdateDashboardParams", function(require) {
  7. We are using a custom dashboard hyperlink handler taken from here: https://community.jaspersoft.com/wiki/how-use-custom-hyperlink-handler-dashboard-tibco-jasperreports-server After upgrading to 7.2, we are getting the following error in the browser console and the dashboard fails to load: Error: Mismatched anonymous define() module: function(require) I have consulted https://requirejs.org/docs/errors.html#mismatch and I feel like I followed the solution but it did not help. The problem seems to be related to the order in which javascript modules are being loaded. The error does not happen consistently. I can execute dashboards several times in a row without error before it happens. I understand that RequireJS is a JavaScript file and module loader, but I know very little about javascript; so any suggestions for the layperson are welcome. The custom handler code is below. //define(function(require) {define(["require","jquery", "underscore"], function(require) { "use strict"; var $ = require("jquery"), _ = require("underscore"); return { events: { click: function(event, linkData) { if (window.location.href.indexOf("dashboard/viewer") > -1) { var hashParts = window.location.hash.split("&"), reportUri = hashParts[0], params = {}; for (var i = 1; i < hashParts.length; i++) { if (hashParts[i].indexOf("=") > 0) { var key = hashParts[i].split("=")[0], value = hashParts[i].split("=")[1]; if (key in params) { params[key].push(value); } else { params[key] = [value]; } } } location.replace(reportUri + "&" + $.param(_.extend(params, linkData.parameters), true)); } } } }});
  8. In 6.4, I successfully used the custom hyperlink handler from this post: https://community.jaspersoft.com/wiki/how-use-custom-hyperlink-handler-dashboard-tibco-jasperreports-server. However, does not work in 7.0 and I am desperately trying to find a solution.
  9. provide API key in /WEB-INF/classes/jasperreports.properties as follows net.sf.jasperreports.components.map.key=YOUR_API_KEY
  10. SOLUTION: provide API key in /WEB-INF/classes/jasperreports.properties as follows net.sf.jasperreports.components.map.key=YOUR_API_KEY
  11. Due to recent changes in Google Maps API, you now must provide API key with your call to the API. Keep in mind there are two API: the Javascript API and the Maps Static API (which is need to export Google map to format such as PDF or Excel). Your key must be valid for both. I have just recently run into same problem with exporting the map. I have provided my API key to the call to the Javascript API so my map displays in browser fine but export fails. I do not know where in Jasper code the call to the Maps Static API is. I have tried putting key in the jrxml file but was unsuccessful. Have you solved your problem as of yet? If so, I would love to know solution.
  12. Has anyone done this in Jasper with the leaflet marker clusterer plug-in?
  13. FWIW, I know I can create a parameter with an expression that makes an API call to get information about a report unit. For example, com.jaspersoft.jasperserver.api.engine.jasperreports.util.RepositoryUtil.getThreadRepositoryContext().getReportUnit().getName(). I have searched to no avail for an API call that gets information about a dashboard.
  14. I need a way to determine the resource path of a dashboard from within a jasper report. I want to use that as a parameter to set the data source of the underlying reports conditionally. Here is the use case: We have multiple tenants in our Jasper server repository. We have copies of a single dashboard living in each tenant organization. The dashlets/reports that run inside the dashboard live in the shared "public" area. This is so that we do not have to deploy each report to multiple organizations. The data source of the reports is dynamic - we are using organization-level attribute to set the data source. This works if the user running the dashboard belongs to an organization. For our internal users, who live at the root level, this does not work because we can of course only set one attribute for the datasource at the root level. So, if the datasource attribute is set to ABC_CORP on the root organization, and the internal user goes to run the dashboard in the XYZ_CORP organization, the dashboard will run with ABC_CORPs data. So I need to be able to extract the organization name from the dashboard's URI and store that in a parameter so I can set the datasource accordingly in my jasper report jrxml using the "com.jaspersoft.jrs.data.source" property. The only thing attached to the organization is the dashboard itself.
×
×
  • Create New...