Display CSV files in the portal

 

+

Search Tips   |   Advanced Search

 

To display a file made up of data arranged in comma-separated values (CSV) format (or any other separator for that matter), we 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

  1. Go to Home.

  2. Select the page where you want to deploy this portlet.

  3. Select Edit Page (under Administration)

  4. Select Add Portlet under the column where you want to see the CSV portlet added.

  5. Select the CSV portlet from the given list.

  6. Select OK.

  7. On the refreshed page, select the edit icon from the CSV Viewer portlet's title bar.

  8. 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:

  9. Find the CSV File Viewer.ear on the server's file system under...

    portal_server_root/installedApps

    A unique ID has been assigned to this ear upon its installation into WebSphere Portal. (For instance, it may be named...

    CSV_File_Viewer_PA_aiz6pvy.ear

    An example Data File URL based upon the above unique ID would be...

    http://locahost:10038/wps/PA_1_0_4J/CSVPortlet/test.txt

    ...where CSVPortlet is a folder under the root of the csv.war and test.txt is a file of CSV format.

  10. 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.

  11. Select Save to commit the changes.

The CSV Viewer portlet should now appear on the page displaying the data from the input file.

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:

  1. Go to...

    Administration | Portlet Management | Portlets

  2. 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

  3. Select the Configure option for the CSV File Viewer portlet.

  4. 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 the changes, then select OK.

  5. Select OK to save 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.

Related information

 

Parent topic:

Use portlet templates