Friday, July 6th, 2012

Using RTE enabled fields in BI Publisher with PeopleTools 8.52

In PeopleTools 8.50 adding a Rich Text Editor to Long fields was introduced. With this RTE users are able to actually format text like you would do in for example Microsoft Word. This was a great feature for online entry and presentation in PeopleSoft. Unfortunately this does have a downside. The text that is entered and formatted using RTE gets stored in the database as HTML. This means that when you are using PSQuery to query the data, the data is presented as plain text with the HTML tags and therefor also not usable in any BI Publisher reporting.

With PeopleTools 8.52 a new tempate is introduced that solves this issue and renders the HTML tags in the Long field to the actual formatting the same way as presented in online PeopleSoft.

Enable Rich Text Editor

First you need to enable a Long field with the Rich Text Editor. After starting Application Designer, open the page that contains a long field and open the properties. On the Options Tab of the field properties, you can enable the RTE as shown in the following picture.

Now when you enter the text as show in the screenshot it will be stored in the database with HTML formatting. If you would create a PSQuery on this field, it will the return the text as plain text with HTML tags like shown in the following screenshot.

Pre-PeopleTools 8.52 Processing

When you would create a template and add the RTE enabled field to the template the text would be presented as plain text without formatting.

Template example

 Output

When you would create a Report Definition and run the report, it would result in the following output.

PeopleTools 8.52 Processing

With PeopleTools 8.52 the template HTML_SUB is introduced. This is in fact a XSL that will transform and render the HTML tags in the RTE enabled field from PSQuery and present the text in the BI Publisher output including the formatting.

First thing that needs to be done, is importing the subtemplate in the main template by adding the following line:

<?import:psxmlp://HTML_SUB?>

After this right click on the RTE enabled field and choose properties and enter the following code:

<xsl:apply-templates select="FIELD_NAME"/>

See following screenshot of the template as an example:

Now open the Report Definition and go to tab Properties. From the Property Group dropdown select PeopleTools Settings and enter all fields that are RTE enabled in the psxp_nocdatafields property. This will remove the CDATA block that PSQuery generates.

Now when you run the report it will format the text according the formatting used by the user with RTE.

If you want to be able to run a preview straight from Word, you need to save the PSXP_xhtml2fo.xsl locally from the content library (to be found with subtemplate HTML_SUB)  and change the import of the subtemplate HTML_SUB, to the following:

<?import:file:///C:\PSXP_xhtml2fo.xsl?>

In above example PSXP_xhtml2fo.xsl is saved to the root of the c drive.

 Viewed 373 times by 194 visitors


Category: General / Technical
You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.