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

Dhiraj Pahlani

Jaspersoft Staff
  • Posts

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

Everything posted by Dhiraj Pahlani

  1. Requirement:To embed and export different foreign languages' fonts (like Hindi, Japanese, Korean, Russian, and Thai) in PDF format. Solution:Sometimes it may happen when using special fonts that the PDF export of those reports may seem incorrect with the special fonts exported in PDF format as ?s, boxes, or just blank. There can be some problems with fonts in PDF exporter. The PDF format has its own set of fonts and, if a document needs to use other fonts, they must be embedded inside the PDF. To address this issue, we need to apply font extension. With font extension, we can check the option 'Embed this font in PDF document' to make sure the font will be included into generated PDF document and the content will be displayed properly. Refer below Wiki article to know about font extensions and how to use them with report exports: Font extensions required for each of the foreign languages' font can be downloaded from the internet, or may be supplied by the client or other teams, etc. For convenience, font extensions for languages - Hindi, Japanese, Korean, Russian, and Thai can be found in the attachments section of this article. A user may download/use a separate .ttf font extension file as per their requirements if a particular font extension attached doesn't seem to work for them. Using multiple foreign languages' fonts in one report under one column itself: Further, if your requirement is to use multiple foreign languages' fonts in one report under one column itself, we can use font set to combine multiple font extensions and achieve our requirement to embed and export different foreign languages' fonts in one PDF export. Font set is a combination (set) of different font extensions and is useful when we are required to use different fonts under one detail field, for example. Once a font set is created, we can use this font set's font name for the field value having multiple foreign languages' fonts data while designing the reports in Studio. The report exported to PDF then should output correctly and display all the fonts. To create a font set in Studio, simply ctrl-select all the required font extensions under Window > Preferences > Fonts section in Studio and click on 'Create Set' button. A sample .jrxml report (i18ntesting (1).jrxml) using different foreign languages' fonts in one report under one column and its PDF output (i18testing_Final.pdf) can also be found in the attachments section of this article for reference. hindi.zip japanese.zip korean.zip russian.zip thai.zip i18ntesting_1.jrxml i18testing_final.pdf
  2. Converting a Jaspersoft Studio project to a JasperReports IO project results in a 'Service Unavailable' error in Studio - org.apache.http.client.HttpResponseException: Service Unavailable at com.jaspersoft.studio.jrio.server.JrioRunner.lambda$1(JrioRunner.java:144) ... Problem: A report compiles and runs fine in Jaspersoft Studio in standard mode (JasperReports Library), but converting this into a JasperReports IO project results in a 'Service Unavailable' error in Studio - org.apache.http.client.HttpResponseException: Service Unavailable at com.jaspersoft.studio.jrio.server.JrioRunner.lambda$1(JrioRunner.java:144) ... Cause: This issue may arise when a user is working in a domain environment as a “normal” user or maybe not using Jaspersoft Studio with a kinda local administrator account, which may block the ability of Jaspersoft Studio / JasperReports IO to expand some artifacts or write some additional/mandatory files. Usually most internal Eclipse operations (therefore Jaspersoft Studio) are performed using the workspace (i.e. the .metadata folder), and to work with the same and edit or make changes to configuration file, like Jaspersoft Studio Professional.ini file, we require privileged credentials. Solution: Following suggestions can be followed for the above causes of the issue: 1. With a low level domain user, have domain admin add the ability to write for normal users in the Jaspersoft Studio Installation folder (for example, C:programstibcojss installation). 2. With a user also having the local machine administrator credentials, try to run the scenario at least once with the privileged credentials (for example, Run as administrator on Windows).
  3. Hi, Could you please tell how exactly are you using this expression and where? Thanks!
  4. Requirement: When restricting the minimum and maximum date values for date input controls and selecting the date outside this limit, we receive a message 'Less-than-or-Equal-to validation failed'. Is it possible to change this message and display a desired message instead? If yes, how can we achieve the same? Solution: To change this date limit message, we need to modify 2 files - 1. InputControlsValidation.properties file (<jasperserver-pro>/WEB-INF/bundles) fillParameters.error.smallerOrEqual=Less-than-or-Equal-to validation failed. 2. jasperserver_messages.properties file (<jasperserver-pro>/WEB-INF/bundles) fillParameters.error.smallerOrEqual=Less-than-or-Equal-to validation failed. We can change this message to a desired one like "Please enter a valid date", save the files, and restart the server for the changes to reflect.
  5. Requirement: Where to set memory settings for JaspersoftETL Studio? Solution: In <Studio_installation_folder> you will find the Studio's .ini file. Edit this file to add memory settings for Studio: Add -vmargs Xms1024mXmx4096mXX:MaxPermSize =512mDfile.encoding =UTF 8(These values can be changed as per the requirements)
  6. Requirement: Where to check if a JAR file is missing for JaspersoftETL Studio? Solution: 3rd party libraries are stored in a folder named .m2. The location path is indicated in the studio_installation_folder/configuration/maven_user_settings.xml
  7. Requirement: Where to check if a JAR file is missing for the Commandline? Solution: 3rd party libraries are stored in a folder named .m2. The location path is indicated in the commandline_install /configuration/maven_user_settings.xml file.
  8. Requirement: How to set Java memory in Job Server? Solution: In the start_rs.bat file, add the following: set MY_JMV_ARGS=" Xms1024M Xmx2048M " The start_rs.bat file can be found in the Job Server installation folder. Change the memory as per your requirements.
  9. Requirement:How to increase JVM memory in JaspersoftETL Administration Center? Solution:If JaspersoftETL Administration Center is deployed under Tomcat, to change the memory settings: Add or update a file named setenv.bat located under apache tomcat bin set "JAVA_OPTS=%JAVA_OPTS% Xms2048m Xmx4096m“ (this is an example, please set the memory values as per your requirements.) If Tomcat is a service in Windows, you can add them in the Start Parameters. Application Server Administrator should be able to help with such requirements
  10. Requirement: To rotate an image in report. Solution: To rotate an image in report, we need to create a new style, and using the rotate attribute, select the required orientation. Then, apply this style to the image element. See below screenshots for illustration. A sample imageReport.jrxml report can also be found in the attachments section of this article for reference. imagereport.jrxml
  11. Problem: The sorting and filtering options are disabled for some of the columns in a report, whereas other columns in the same report have these options enabled. How to enable these options for all of the columns in a report? Cause: One of the causes for this could be the columns which are affected are using text fields with complex expressions to get the values, whereas the ones which are working fine only use the direct data from the database, and the sorting function is not able to deduce the end value returned after the expression is resolved to be able to sort it. It looks at the expression in the detail text field to understand what is the data source field or variable it needs to sort and filter after. When the text field uses a simple expression with only the name of a field or variable, things work smooth. Solution: The solution in such cases is to take the text field formula and create a variable for it in the table dataset, and then use this variable as the only thing in the text field expression of the table column field. Two sample .jrxml reports created for this test, sortReport.jrxml and sortReport2.jrxml reports, can be found in the attachments section of this article, and these reports can be run using the sample Foodmart DB. In the sortReport.jrxml report, the table column field is using a text field expression with a complex expression to retrieve the end value, and the same table column field in the sortReport2.jrxml is using a variable. This variable is created using the same complex expression to return the end value. The only difference between the two is, the first one is using a text field with complex expression and the second one is using a variable, which is like a place holder for the expression returning the end value. So, it is like a direct value in case of the variable and we can sort the column in this manner. A short recorded video (sortReport.mp4) demonstrating the report rendering of these sample reports can also be found in the attachments section of this article for reference. sortreport.jrxml sortreport2.jrxml sortreport.mp4
  12. Requirement: To integrate Git with Jaspersoft Studio Solution: Please follow below steps to integrate Git with Jaspersoft Studio: 1. Open Jaspersoft Studio. 2. Click on Window > Open Perspective > Other. 3. Select Git and then click Open. To switch views between Studio's Project Explorer and Git there is an icon at the top right corner (refer attached screenshot).
  13. Auto Start/Stop with Bundled Tomcat and PostgreSQL (Linux) Problem: Not able to configure the binary bundled installed JasperReports Server to auto-start after system reboot on a Linux OS. Cause: When trying to configure the binary bundled installed JasperReports Server to auto-start after system reboot by following the below Installation guide, we receive an error while executing sudo /sbin/chkconfig --add jasperserver. The error seen is - service jasperserver does not support chkconfig https://community.jaspersoft.com/documentation/tibco-jasperreports-server-installation-guide/v750/starting-and-stopping-jasperreports#:~:text=Auto%20Start/Stop%20with%20Bundled%20Tomcat%20and%20PostgreSQL As per the readme.txt file, this command - sudo /sbin/chkconfig --add jasperserver, adds a service to system startup. Since we are not able to execute this command, the jasperserver service is not getting auto-started with system reboot. Resolution: Try to add below 2 lines in the jasperserver script (both at <js-install>/scripts/linux/jasperserver and /etc/init.d/jasperserver), save the file, and then try to run the command, sudo /sbin/chkconfig --add jasperserver and sudo /sbin/chkconfig jasperserver on # chkconfig: 2 3 5 # description: some startup description The readme.txt file and the jasperserver script can be found in the attachments section of this article for reference. readme_1.txt jasperserver.
  14. Exporting Ad Hoc Reports in PDF with Landscape Orientation Requirement: We would like to export an Ad Hoc Report as an A4 Landscape PDF file, but the default export PDF file is Letter Portrait page size and orientation. How can we change this behavior so that the PDF export of the Ad Hoc Report is in landscape orientation? Solution: When an Ad Hoc View is exported to PDF or any other formats, the server automatically creates a temporary report using the default template, which is the ‘Actual Size’. Although the ‘Actual Size’ template is meant for online viewing and doesn't restrict the size of the contents, PDF exporter as well as other exporters use template’s page size and orientation. As a result, a chart might look not so good as in the JasperReports Server UI, for example. We can create a custom template based on the ‘Actual Size’ template, but with required page size and orientation. After this, we can create an Ad Hoc Report from the Ad Hoc View and use this custom template for the report. This Ad Hoc Report when exported to PDF should be displayed in the landscape orientation. Follow below steps for creating a custom Ad-Hoc template and using that template to create Ad Hoc Reports: 1. Open Repository Explorer tab in the Jaspersoft Studio. 2. Go to public/templates/ActualSize, and open ActualSize.jrxml report in the Studio. 3. Click on File > Save As... 4. Give this file a name and save it. 5. Now, this file should be opened in your Design view. 6. Click the top report name node from the Outline view, then under the Properties tab, click on the Edit Page Format button from the Page Format section. 7. Now, select Landscape for the page orientation and click Ok. 8. Save this .jrxml report. 9. Now right-click Templates(public/Templates) from the Repository Explorer and select New. 10. In the Add Resource wizard select JRxml and click Next. 11. Give the name of the report you saved in the previous steps and click on Next 12. Now, select Upload from Workspace from the drop-down menu and select the report saved in the previous steps from your Jaspersoft Studio Workspace. Click on Finish. 13. Confirm that the custom template created can be seen in the Repository Explorer tab of the Studio under public/Templates 14. Now, go to JasperReports Server. 15. Go to the Ad Hoc View from the repository with which you want to create a report. 16. Right click that Ad Hoc View and select Create Report. 17. Select Custom Report Template radio button and browse the template created in the previous steps. Select that template and click Ok 18. The report will now be generated as per your requirement.
  15. Hi, I have created a Wiki article for this similar requirement, which you may refer: https://community.jaspersoft.com/wiki/split-string-columns
  16. Hi, I have created a Wiki article for this similar requirement, which you may refer: https://community.jaspersoft.com/wiki/split-string-columns
  17. Hi, I have created a Wiki article for this similar requirement, which you may refer: https://community.jaspersoft.com/wiki/split-string-columns
  18. Hi, I have created a Wiki article for this similar requirement, which you may refer: https://community.jaspersoft.com/wiki/split-string-columns
  19. Hi, I have created a Wiki article for this similar requirement, which you may refer: https://community.jaspersoft.com/wiki/split-string-columns
  20. Hi, I have created a Wiki article for this similar requirement, which you may refer: https://community.jaspersoft.com/wiki/split-string-columns
  21. Split String into Columns Requirement: The DB table contains a column with string data, which we wish to split into different columns and use these columns in our .jrxml report creation. For example, say, one of our DB tables has a column named item_summary which contains the summary of items in the format say: Main Product - Sub_product - Units Required - Vendor Name, like: Wheeler-Irvin Machiner - 2700 units - Sarah Since our DB table has only one column with the data in the above format, we wish to divide this data into multiple columns, like Main Product, Sub-product, Units Required, and Vendor Name and use these columns in our .jrxml report creation instead of just one column item_summary so as to have easy readability when previewing the report. Solution: To achieve this requirement, follow below steps: 1. First, download the resultset from the DB client in a .csv file. 2. Open this downloaded file, and just keep the values of the column and remove the column name. Save the file. 3. Now, open Jaspersoft Studio and create a new CSV data source. When creating this CSV data source, use the CSV file from the above step. For CSV data sources, we have an option to select a field separator and with this, we can select to define how our column gets separated, like comma, tab, space, semicolon, etc. (For our above example, we can define this separator as a hyphen -). For information on creating CSV data sources, see “Using CSV Data Sources” section from our Studio guide: https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v790/using-csv-data-sources 4. Once the CSV data adapter is created, create a new blank .jrxml report. 5. Then, open the ‘Dataset and Query Dialog’. Select the CSV data adapter created in the above steps from the drop-down menu, and then click on ‘Read Fields’. Click ‘Ok’ 6. Now, we should be able to see the ‘Fields’ in the ‘Outline’ view. Drag the fields into the ‘Detail’ band. Then, rename the column names as required by selecting each column under the ‘Column Header’ from the ‘Outline’ view and renaming it under the ‘Static Text’ tab from the ‘Properties’. 7. Save the report and then preview it. Publishing the report and the CSV data adapter to JasperReports Server To have the report use this CSV data adapter as default when rendering the report on server, follow below steps: 1. Log in to JasperReports Server and go to the repository path where we wish to upload this data adapter. Right-click this folder > Add Resource > File > XML. Then select the .xml CSV data adapter file from the Jaspersoft Workspace directory and finally click on ‘Submit’. The CSV data adapter is now uploaded to the server. 2. Next, we will have to define this repository path of the data adapter as default data adapter for the .jrxml report inside Studio. To do this, open the report in Studio. Select the report name from the ‘Outline’ view which will be the top node. 3. Now, click on the 3-dot button of the ‘Default Data Adapter’ option under the ‘Properties’ view, and define the repository path of the uploaded data adapter. 4. Save the report and then publish it. 5. While publishing the report, select ‘Don’t use any Data Source’ radio button. 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 uploaded data adapter. A sample splitStringIntoColumns.jrxml report and its CSV adapter, splitStringIntoColumnsDataAdapter.xml, can be found in the attachments section of this article. splitstringintocolumnsdataadapter.xml splitstringintocolumns.jrxml
  22. Hi, Yes, you can upload report with its subreport(s) using REST API. Refer below Wiki article, which I have created for this requirement: https://community.jaspersoft.com/wiki/uploading-reports-subreports-using-rest-api
  23. Hi, Yes, you can upload report with its subreport(s) using REST API. Refer below Wiki article, which I have created for this requirement: https://community.jaspersoft.com/wiki/uploading-reports-subreports-using-rest-api
  24. Hi, Yes, you can upload report with its subreport(s) using REST API. Refer below Wiki article, which I have created for this requirement: https://community.jaspersoft.com/wiki/uploading-reports-subreports-using-rest-api
  25. Hi, Yes, you can upload report with its subreport(s) using REST API. Refer below Wiki article, which I have created for this requirement: https://community.jaspersoft.com/wiki/uploading-reports-subreports-using-rest-api
×
×
  • Create New...