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

Prasad B

Jaspersoft Staff
  • Posts

    42
  • 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 Prasad B

  1. Question: How do we add resources to favourites using REST API? Answer: Use the following method to add the resources to Favorites. Method: POST, URL: http://<host>:<port>/jasperserver[-pro]/rest_v2/favorites The content type for this request is usually a JSON object that contains the list of resource URIs to be added to Favorites. The Return values for this request is as below: a) For Success: 201 Created - The request was successful. b) For Failure: i) 400 Bad Request - Invalid request syntax. ii) 403 Forbidden - When the logged-in user does not have permission to access the resource. iii) 404 Not Found - When the resource specified in the request does not exist. The following is an example of a sample payload. 1) { "favorites":[ { "uri":"/public/audit/datasources/AuditDataSource_1" }, { "uri":"/public/audit/datasources/AuditVirtualDataSource_1" } ] } 2) { "favorites":[ { "uri":"/public/audit/datasources/AuditDataSource_1" }, { "uri":"/public/audit/datasources/AuditVirtualDataSource_1" } ] } If a user adds a resource to the Favorites and later an admin removes the user's access to resources, the entry stays in the jifavoriteresource table, but the user will not be able to view or remove the resources from the Favorites. Note: Local resources cannot be added to Favorites.
  2. Question: How do remove resources from favourites using REST API? Answer: The following method is used to remove the starred resources from the Favorites. Method: POST URL: http://<host>:<port>/jasperserver[-pro]/rest_v2/favorites/delete The content type for this request is usually a JSON object that contains the list of resource URIs to be deleted from Favorites. The Return values for this request is as below: a) For Success: 204 No Content - The request was successful. b) For Failure: i) 400 Bad Request - Invalid request syntax. ii) 403 Forbidden - When the logged-in user does not have permission to access the resource. iii) 404 Not Found - When the resource specified in the request does not exist.
  3. Question: How do access resources in favourites using REST API? Answer: Use the following method to get the list of favorites. By default, favorites is false. Please find below Method and URL used for this request: Method: GET, URL:http://<host>:<port>/jasperserver[-pro]/rest_v2/resources?favorites=true The content type for this request is usually a JSON object that lists the resources added to Favorites. The Return values for this request is as below: a) For Success: 200 OK - The body contains a list of Favorites representing the results of the search. b) For Failure: i) 404 Not Found - When the resource specified in the request does not exist. ii) 204 No content - When the resources added to Favorites are not found.
  4. Question: How do we delete multiple permission for resource using REST API? Answer: The DELETE method removes all assigned permissions from the designated resource. After returning successfully, all effective permissions for the resource are inherited. Please find below Method and URL used for this request: Method: DELETE, URL: http://<host>:<port>/jasperserver[-pro]/rest_v2/permissions/path/to/resource The Return values for this request is as below: a) For Success: 204 No Content - The request was successful. b) For Failure: 404 Not Found - If the resource or the recipient in the URL is invalid.
  5. Question: How do we delete single permission for resource using REST API? Answer: To delete the single permission of the resource, we need to specify a recipient in the URL of the DELETE method to remove only that permission. Please find below Method and URL used for this request: Method: DELETE URL: http://<host>:<port>/jasperserver[-pro]/rest_v2/permissions/path/to/resource;recipient=<recipient> The arguments used for this request is as below: 1) recipient Type/Value: string required, Description: The recipient format specifies the user or role, the organization if necessary, and the object ID. The slash characters must be encoded, for example: user:%2Forganization_1%2Fjoeuser The Return values for this request is as below: a) For Success: 204 No Content - The request was successful. b) For Failure: 404 Not Found - If the resource or the recipient in the URL is invalid..
  6. The permissions for each user and each role are indicated by the following values. These values are not a true mask; they should be treated as constants. • No access: 0 • Administer: 1 • Read-only: 2 • Read-write: 6 • Read-delete: 18 • Read-write-delete: 30 • Execute-only: 32
  7. Question: How do we set single permissions for resources using the REST API? Answer: The POST method accepts a single permission descriptor. Please find below Method and URL used to set the single permission of resource: Method: POST, URL: http://<host>:<port>/jasperserver[-pro]/rest_v2/permissions The content for this request need to be passed in JSON format. The content of the JSON object would usually describe the single permission. eg. { "uri":"/properties", "recipient":"role:/ROLE_USER", "mask":"1" } The Return values for this request is as below: a) For Success: 201 Created - The request was successful. b) For Failure: 204 No Content - 400 Bad Request - The permission is already assigned or the given mask is invalid.
  8. Question: How do users view single permissions for resources using the REST API? Answer: We have to specify the recipient in the URL to see a specific assigned permission. Please find below Method and URL used to view the single permission of resource: Method: GET URL: http://<host>:<port>/jasperserver[-pro]/rest_v2/permissions/path/to/resource;recipient=<recipient> The arguments used for this request is as below: 1) recipient Type/Value: string required,Description: The recipient format specifies the user or role, the object ID, and the organization ID if necessary. The slash character must be encoded, for example: user:%2Forganization_1%2Fjoeuser It is accepting the option values in both XML and JSON formats. The Return values for this request is as below: a) For Success: 200 OK - The body describes the requested permission. b) For Failure: 204 No Content - 404 Not Found - When the specified resource URI or recipient is invalid, or when the recipient does not have any assigned permission (only inherited).
  9. Question: How do we move the resource using REST API? Answer: Moving a resource uses the PUT method, whereas copying it uses the POST method. Please find below Method and URL used to copy the resource: Method: PUT URL:http://<host>:<port>/jasperserver[-pro]/rest_v2/resources/path/to/folder?<arguments> The arguments used for this request is as below: 1) createFolders Type/Value: true|false, Description: True by default, and the service will create all parent folders if they do not already exist. When set to false, the folders specified in the URL must all exist; otherwise, the service returns an error. 2) overwrite Type/Value: true|false, Description: When true, the target resource given in the URL is overwritten, even if it is a different type than the resource descriptor in the content. The default is false. The options used for this request is as below: Content-Location: {resourceSourceUri} - Specifies the resource to be moved. The Return values for this request is as below: a) For Success: 201 Created - The request was successful and, for confirmation, the response contains the full descriptor of the resource that was just moved. b) For Failure: 204 No Content - 404 Not Found - When the {resourceSourceUri} is not valid.
  10. Question: How do we copy the resource using REST API? Answer: Copying a resource uses the Content-Location HTTP header to specify the source of the copy operation. If any resource descriptor is sent in the request, it is ignored. Please find below Method and URL used to copy the resource: Method: POST URL: http://<host>:<port>/jasperserver[-pro]/rest_v2/resources/path/to/folder?<arguments> The arguments used for this request is as below: 1) createFolders Type/Value: true|false, Description: True by default, and the service will create all parent folders if they do not already exist. When set to false, the folders specified in the URL must all exist, otherwise the service returns an error. 2) overwrite Type/Value: true|false, Description: When true, the target resource given in the URL is overwritten even if it is a different type than the resource descriptor in the content. The default is false. The options used for this request is as below: 1) Content-Location: {resourceSourceUri} - Specifies the resource to be copied. The Return values for this request is as below: a) For Success: 201 Created - The request was successful and, for confirmation, the response contains the full descriptor of the resource that was just copied. b) For Failure: 204 No Content - 404 Not Found - When the {resourceSourceUri} is not valid.
  11. Question: How do we delete the resource using REST API? Answer: The DELETE method has two forms, one for single resources and one for multiple resources. Method: DELETE URL: http://<host>:<port>/jasperserver[-pro]/rest_v2/resources/path/to/resource The Return values for this request is as below: a) For Success: 204 No Content - The request always returns 204. The resources with valid URIs are deleted.mes. b) For Failure: 204 No Content - The request always returns 204. No action is taken for invalid URIs.
  12. Question: How do we create the resource using REST API? Answer: The POST and PUT methods offer alternative ways to create resources. Both take a resource descriptor but each handles the URL differently. With the POST method, specify a folder in the URL, and the new resource ID is created automatically from the label attribute in its descriptor. Please find below Method and URL used to create the resource: Method: POST URL: http://<host>:<port>/jasperserver[-pro]/rest_v2/resources/path/to/folder?<argument> The arguments used to define it is as below: 1) createFolders Type/Value: true|false Description: By default, this is true, and the service will create all parent folders if they do not already exist. When set to false, the folders specified in the URL must all exist, otherwise, the service returns an error. The Content Type required for this request is as below: 1) application/repository.--> <resourceType>+json 2) application/repository. --> <resourceType>+xml
  13. Question: How do we delete an Exclusion Calendar for a specific schedule? Answer: Use the following method to delete a calendar by name:. Method: DELETE URL: http://<host>:<port>/jasperserver[-pro]/rest_v2/jobs/calendars/<calendarName>/ The Return values for this request is as below: a) For Success: 200 OK – Body contains a list of calendar names. b) For Failure: 404 Not Found – When the specified calendar name does not exist.
  14. Question: How do we list all calendar names for a specific schedule? Answer: The following method returns the list of all calendar names that were added to the scheduler. Method: GET URL: http://<host>:<port>/jasperserver[-pro]/rest_v2/jobs/calendars/?<argument> The arguments required for this API is as below: Argument: calendar Type, Type/Value: optional string, Description: A type of calendar to return: annual, cron, daily, holiday, monthly, or weekly. You may specify only one calendarType parameter. When calendarType isn't specified, all calendars names are returned. If calendarType has an invalid value, an empty collection is returned. The Return values for this request is as below: a) For Success: 200 OK – Body contains a list of calendar names. b) For Failure: 401 Unauthorized The list of calendar names in the result has the following format in XML: <calendarNameList> <calendarName>name1</calendarName> <calendarName>name2</calendarName> </calendarNameList>
  15. Prasad B

    Error in binary installation

    Question: I am getting error while installing jasperserver 9.0.0 on windows 2016 server. please review the screenshot and let me know if you need any other details Answer: This is a known issue (JS-69551), which was a regression and it started occurring in JRS 8.1.0. The workaround for this issue is to install JDK (either 8 or 11) explicitly and then proceed with the installation.
  16. Question: How do we add the parameter of multi-value input controls for the repository link in an ad hoc view? Answer: The syntax for defining multi-value input controls is as below: ?$P{"filter_in_target=", dashlet_param, "&"}. For example, the following link allows multi-select with the c_country_1 input control in the 05. Unit Sales Trend report: repo:/public/Samples/Reports/05._Unit_Sales_Trend?$P{"c_country_1=", Store Country, "&"}
  17. Question: We are able to connect to our remote SFTP server from the WinSCP client but are unable to get through the same connection from the Jasper server report schedule (output options tab) and are facing the below error on the Jasper server: === 2024-04-23T12:51:07,978 ERROR SecureExceptionHandlerImpl,http-nio-8088-exec-1:125 - There was an error on the server. Try again or contact site administrators. (Error UID: 665c5c52-ec2a-43a5-98dd-98b1be23942d) com.jcraft.jsch.JSchException: Algorithm negotiation fail at com.jcraft.jsch.Session.receive_kexinit(Session.java:590) at com.jcraft.jsch.Session.connect(Session.java:320) at com.jcraft.jsch.Session.connect(Session.java:183) === How do I resolve this issue? Answer: The error generated from the SFTP is this: 2024-04-23T12:51:07,978 ERROR SecureExceptionHandlerImpl,http-nio-8088-exec-1:125 - There was an error on the server. Try again or contact site administrators. (Error UID: 665c5c52-ec2a-43a5-98dd-98b1be23942d) com.jcraft.jsch.JSchException: Algorithm negotiation fail at com.jcraft.jsch.Session.receive_kexinit(Session.java:590) at com.jcraft.jsch.Session.connect(Session.java:320) at com.jcraft.jsch.Session.connect(Session.java:183) In JR Server version 8.1.1, we bundle in jsch-0.1.54.jar in the WEB-INF/lib, which is the external library used for the connection. As the error states, the problem is due to "Algorithm negotiation fail" and this error is not specific to the Jaspersoft product as it can occur with any application making a sftp connection over ssh. Hence, I am providing you with an external link where you can find solutions to this problem: https://stackoverflow.com/questions/6263630/jschexception-algorithm-negotiation-fail I would suggest the following action first, which is one of the solutions provided in the above article: - Install the oracle unlimited JCE and install in JRE_HOME/lib/security. If you are running on Java 8, then you can download this from: https://www.oracle.com/au/java/technologies/javase-jce8-downloads.html Make sure you back up the existing files before you copy the contents of jce_policy-8.zip into: /usr/java/jdk1.8.x_xx/jre/lib/security After performing the above, restart the JR Server and test again.
  18. Question: We are using special characters in our JRXML report. When we exported this report into PDF format, it was not showing in PDF. How do I resolve this issue? Answer: To print the special character in the pdf file, you have to use the font extension for the specific font. We are using here the Romanian font,AbhayaLibre-Regular. Please refer to the below steps for more details: 1) Download the provided ttf file from the case attachments (AbhayaLibre-Regular.zip). You have to use this ttf file for that respective font. 2) Go to Windows -->Preferences --> Jaspersoft Studio -->Fonts. You have to add this ttf file over here to use the font. Click on Add and make the required settings. Please refer to the attached screenshot (Adding_the_ttf_file.png) to make those required settings. 3) Make sure that you are using this font for that respective field. 4) Go to Windows --> Preferences --> Jaspersoft Studio --> Fonts. Select the font and click on export. So it generates .jar file for that font. 5) Import this font jar into the class path within the libraries in the jrxml report of the respective project. Please refer to the attached screenshot (import_font_in_classpath.png) for more details. 6) Place this jar inside the WEB-INF/lib directory. 7) Restart the server. 8) Save the JRXML report. Preview it in studio. Make the studio export. You can see that special character in that pdf file. 9) Publish this JRXML report to the JRS. 10) When you export this report in pdf format from the server, you can see special characters in the pdf export over the server as well. Please refer to the below article for more details about using the font extension: https://community.jaspersoft.com/knowledgebase/best-practices/custom-font-font-extension/ 02259619_Test2.jrxml AbhayaLibre-Regular.ttf
  19. Question: How do I download a list of JRS users with roles? We have too many users to copy/paste from the user list. All we need is the list of user names and their full names. Solution: The information of the users, along with their roles, is stored inside the jasperserver database. You can run the below against the jasperserver database to fetch the records: select JU.username, JU.fullname, JR.rolename from JIUser JU JOIN JIUserRole JUR on JU.id=JUR.userid JOIN JIRole JR on JUR.roleId= JR.id; Please refer to the below screenshot to find information on the result set for the above query. Ref Case: #02222636
  20. Question: How do I download a list of JRS users with roles? We have too many users to copy/paste from the user list. All we need is the list of user names and their full names. Solution: The information of the users, along with their roles, is stored inside the jasperserver database. You can run the below against the jasperserver database to fetch the records: select JU.username, JU.fullname, JR.rolename from JIUser JU JOIN JIUserRole JUR on JU.id=JUR.userid JOIN JIRole JR on JUR.roleId= JR.id; Please refer to the below screenshot to find information on the result set for the above query. Ref Case: #02222636
  21. Problem Statement: Our user has done the migration from JRS version 7.9 to 8.1.1. The export from JRS 7.9 is completed successfully. When they import it into the new JRS 8.1.1 environment, they get the below error: [java] Processing started [java] 2023-03-28T19:48:53,649 ERROR ImporterImpl:201 - Import failed as resources cannot be decoded [java] Import failed as resources cannot be decoded How do I resolve this error? Solution: This error generally occurs because the 'deprecatedImportExportEncSecret' keyword was not added to the import and export commands. Please use the below steps for the migrations: 1. At the time of export, please run the below command in the buildomatic of JRS 7.9.1: js-export.bat --everything --output-zip export111.zip --keyalias deprecatedImportExportEncSecret --> where export111.zip is the name of the zip file that will be generated after the export operation. 2. At the time of import, please run the below command in the buildomatic of JRS 8.1.1: js-import.bat --input-zip export111.zip --keyAlias deprecatedImportExportEncSecret ---> This same file would be used at the time of import into JRS 8.1.1. Ref Case: #02174474
  22. Problem Statement: Our user creates the schedule, and when they try to save the schedule, they are getting the error 'Failed to save the scheduled job'. The full response from the server is:{"errorCode":"unexpected.error","parameters":["java.lang.NullPointerException"] Solution: The issue is caused by setting the following property as true in the applicationContext-cascade.xml file <bean id="allowExtraReportParameters" class="java.lang.Boolean"> <constructor-arg value="true"/> </bean> This property is set to false by default, and when it changes to true, it allows you to send additional job parameters. --When the user faces this issue, kindly check the value of the property and change it to false. When the user restarts the server after saving the changes, they will not face this issue. Ref Case: #02168150
  23. Problem Statement: The user has installed Jaspersoft Studio 8.2. When they opened the Jaspersoft Studio, they saw the error "Edge browser engine is not setup. HTML and JRIO Preview will not work fine". Solution: -- This issue generally occurs when the user hasn't installed the webview for Microsoft Edge. -- Please download the webview from the below link: https://developer.microsoft.com/en-us/microsoft-edge/webview2/ Here, the recommended option is 'Fixed Version'. Select the architecture as 'x64'. -- After extracting the package in the local machine, we have added the two properties to Jaspersoft Studio Professional.ini file: -Dorg.eclipse.swt.browser.DefaultType=edge -Dorg.eclipse.swt.browser.EdgeDir=C:\dev\Jaspersoft\Microsoft.WebView2.FixedVersionRuntime.114.0.1823.51.x64 --> This is the path where we extracted the folder. -- After saving these configurations, restart Jaspersoft Studio, and this error was removed from the Jaspersoft Studio screen. (Reference: https://community.jaspersoft.com/documentation/jaspersoft-studio-user-guide-820/v820/using-edge-jaspersoft-studio-window-builds) Ref Case: #02190934
  24. Problem Statement: Why is there no header in an export (in CSV format) from Ad Hoc Report when there is no data? Solution: By default, there is no data in the adhoc report, export of the report appears to be empty without headers. It is an expected behaviour. However, you want to get the column headers for the no data, we can achieve it using the certain modifications. Please follow the below steps for more details: 1. Edit any of the report templates in Jaspersoft Studio. For reference, I have edited the Actual size template. It can be found at the public/Template Repository. 2. Edit the When No Data Type Property to "All Section No Detail". Please refer to the attached screenshot (Edit_Report_Property.jpg) for more details. 3. Publish this report template to the JasperReports Server to reflect the Changes. 4. On the JasperReports Server, create the Report for the existing ad hoc view. 5. When you load the report, you can see that only column headers will get rendered on the screen. Please refer to Column_headers_rendered.jpg for more details. 6. When you exported this ad hoc view report into csv format, you will find that only column headers got printed. Please see the attached CSV file for reference. Ref Case: #02192705
  25. Problem Statement: Is there any timeout setting for the JasperReports Server connection to the database? Solution: The user can see the settings available for the respective JDBC databases in the context.xml file, which is available in the <tomcat>/<jasperserver-pro>/<META-INF> directory. The timeout setting for the respective database is defined by using the 'maxWait' parameter. In JasperReports Server, the default timeout time is 10000 (10 seconds). The end user can increase the maximum value as per the requirement. A value of zero forces the user to wait indefinitely. Ref Case: #02193822, #02213117
×
×
  • Create New...