![]()
Portal Express, Version 6.0
Operating systems: i5/OS, Linux, Windows
Displaying CSV files in the portal
If you want to display a file made up of data arranged in comma-separated values (CSV) format (or any other separator for that matter), you can use the CSV Viewer portlet (CSV File Viewer). The CSV data will be displayed in tabular format with alternate row shading and headings.
A maximum of 5 records will be shown. To view all the records, click the maximize button.
Setting up the CSV Viewer
The CSV Viewer portlet should now appear on the page displaying the data from your input file.
- Go to Home.
- Select the page where you want to deploy this portlet.
- Select Edit Page Layout (under Administration)
- Select Add Portlet under the column where you want to see the CSV portlet added.
- Search for the CSV File Viewer portlet and select it from the list.
- Select OK.
- On the refreshed page, select Edit Shared Settings from the drop down portlet menu.
- Enter Data File URL by specifying the location of a CSV data file to view in the CSV Viewer. To create this URL, do the following:
- Create a directory called 'Text' under <Portal Server Root>\installedApps\CSV_File_Viewer_PA_cs7e3l0.ear\csv.war and place a test file for example, 'test.txt' in the directory.
- Find the context root identifier in the file application.xml. For example, <Portal Server Root>\installedApps\CSV_File_Viewer_PA_cs7e3l0.ear\META-INF\application.xml contains a line similar to<context-root>/wps/PA_cs7e3l0</context-root>
- Construct the URL http://localhost:10038/wps/PA_cs7e3l0/Text/test.txt to the file test.txt using the context root identifier found in the file application.xml.
The test.txt file is the csv file that was created in the directory Text under <Portal Server Root>\installedApps\CSV_File_Viewer_PA_cs7e3l0.ear\csv.war
- Enter Data Separator Character. If the file uses a separator character other than a comma, for example a colon (:) or logical or (|), enter that character in the field.
- Select a Data Encoding Format (for example US ASCII).
- Select Save to commit your changes.
In order to change the portlet's title from its default of "CSV File Viewer" to something more appropriate to its content, take the following steps:
- Go to the Administration page.
- Select Portlet Management from the list on the left.
- Select Portlets from the options under Portal Management.
- Find the CSV File Viewer portlet. You may do this by browsing the list of available portlets, or by using the Search feature, with "Title starts with" set to "CSV File Viewer".
- Select the Configure option for the CSV File Viewer portlet.
- To change the title of the portlet, select I want to set titles and descriptions. On the following page, select Edit next to the language-specific title you want to modify, make your changes, then select OK.
- Select OK to save your changes.
The settings that you specify when editing this portlet (above) are not global (as opposed to the configuration settings), so the same portlet can be deployed on different pages with different settings. The portlet's title is global, however, so if it needs to be different, you will need to clone the CSV viewer portlet and create a new one. In order to do this, go to Administration > Portlets > Portlet Management > Portlets. There you may select the CSV File Viewer portlet from the given list and select the Copy icon.
Parent topic:
Using portlet templates