search cancel

JasperStudio input control - CSV or XML file

book

Article ID: 215010

calendar_today

Updated On:

Products

CA Service Management - Service Desk Manager CA Service Desk Manager

Issue/Introduction

In JasperStudio, is it possible to have a list value input control whose values are contained within a file (CSV or XML)?

Environment

JasperSoft 7.x

All Supported Windows Operating Systems

Service Desk Manager 17.x

Resolution

Since custom report writing is outside the scope of Broadcom Support, the information provided below is for informational purposes only.

To use the value of the Input control from CSV or XML, you will need to create a data adapter for the respective external file in JasperStudio.  By using the data adapter, you can create a query for the same and able to use it in a report.
 
For creating a data adapter for using CSV please refer to the below document:

https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v720/using-csv-data-sources-0
 
For creating a data adapter for using XML please refer to the below document:

https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v720/using-xml-data-adapters-0

In order to use a CSV file value as an input control in a report, first, you will need to create a data source for the CSV file in JasperSoft.

To enable file data sources in the JasperSoft:

1.    Open the file webapps\jasperserver-pro\WEB-INF\applicationContext-remote-services.xml for editing.
2.    Locate the element <util:set id="customDataSourcesToHide">
3.    Comment out the file data sources you want to display.  In your case comment the <value>textDataSource</value>
4.    Save the file and restart JasperSoft Tomcat service

Please refer to the following document for more details:

https://community.jaspersoft.com/documentation/tibco-jasperreports-server-administrator-guide/v720/file-data-sources

After the creation of the data source, you will need to create the input control using the CSV file.

For creating input controls, please refer to the following documentation :

https://community.jaspersoft.com/documentation/tibco-jasperreports-server-administrator-guide/v720/input-controls

Once the Input Control is created, select the report where you want to use the input control, click on edit, then select Controls & Resources.

In Controls & Resources, in the Input control section select add Input control.

In the Add Input control window, choose the option of select input control from the repository and browse to the location of Input control.

Then select Next and click on submit.