Wednesday, 31 July 2013

PeopleSoft Enhanced Feature in Reporting

1. Summary

This blog includes the steps to implement PeopleSoft enhanced features in reporting.

2. Working with PDF reporting options in BI Publisher

The following BI features are available on PDF documents.
ü  Counting the number of pages in a pdf file
ü  Merging PDF

2.1      Counting the number of pages in a pdf file

The java object ‘com.lowagie.text.pdf.PdfReader’ is used to find the number of pages in a pdf file.

Sample Code:
Local JavaObject &obj_Split_PDF_Size = CreateJavaObject("com.lowagie.text.pdf.PdfReader", “<PDF file with full path>");
/* &NumberofPages – gives the number of page in the PDF file */
Local number &NumberofPages = &obj_Split_PDF_Size.getNumberOfPages();

2.2      Merging PDF

The application Package PSXP_ENGINE:PDFMerger can be used to merge two PDF files.
Sample Code:
&Reportmrg = create PSXP_ENGINE:PDFMerger();
&ret = &Reportmrg.mergePDFs(<Array of input files to be merged as array of strings>, <Output Merged File>, &out);

Working with .RTF (Document) reporting options in BI Publisher

Following features are available on Oracle-PeopleSoft BI Publisher .rtf template.
ü  Using Barcodes on Report
ü  Dynamic/Conditional Watermark
ü  Dynamic images in the report output
ü  Headers & Footers.

3.1      Using Barcodes on Report

The following step needs to be carried out to use barcode on BI publisher reports.
ü  Corresponding barcode font has to be downloaded and placed in the local machine (C:\Windows\Font) and also the Application Server (<Server path>/fonts/truetype/).
ü  The field to be displayed as barcode is first included in the template and the font of the field is changed to the downloaded barcode font.
ü  In  File > Properties and in the custom tab enter the following details
Name: xdo-font.<font name>
Type: Text
Value: truetype.<path to the font file>
Setting this property will make the barcodes visible when the output is pdf





3.2      Dynamic Header and Footer

Form fields cannot be inserted into header/footer of rtf templates. So to have dynamic or conditional text in header or footer, the xml tags are directly written in header and footer which then converts to values when the report is run.
Eg: <?fld_DESCR?>

3.3      Dynamic/Conditional watermark

ü  Watermark is entered through Format> Background > Printed Watermark in the rtf template.
ü  In the text enter the condition
Eg: <?xdoxslt:ifelse(<condition>,'Watermark to be displayed when the condition is satisfied','Watermark to be displayed when the condition is not satisfied')?>



3.4      Dynamic images in report output

ü  The dynamic image may be in any of the following format- jpeg/ bmp/ gif/ png.
ü  Hold the path of the dynamic image in a record field used in the report.
ü  Insert a dummy image in the template.
ü  By double clicking and in the web tab of the image enter the dynamic value/field as below in the alternative text.
// - - > For level 0 record
.// - - > For level 1 record
ü  Fieldname is the record field that holds the path of the image in the report.



Following features are available on Oracle-PeopleSoft BI Publisher Excel template.
ü  Multi Sheet excel report- Excel object

4.1      Multi Sheet excel report- Excel object

The following peoplecode generates multisheet excel with the excel application
&oWorkApp = CreateObject("COM", "Excel.Application");
&oWorkApp.DisplayAlerts = "false";
ObjectSetProperty(&oWorkApp, "Visible", True);
&oWorkBook = ObjectGetProperty(&oWorkApp, "Workbooks");
&oWorkBook.add();
&oWorkSheet = &oWorkApp.Worksheets("Sheet1");
/* Modify the name of the worksheet */
&oWorkSheet.name = "Test Sheet";
/*Access the cells of the worksheet */
&oWorkSheet.Cells(1,1).Value=’Test’
&oWorkSheet = &oWorkApp.Worksheets("Sheet2");
&oWorkSheet.name = "Access";
/*Delete the third sheet */
&oWorkSheet = &oWorkApp.Worksheets("Sheet3");
&oWorkSheet.delete();
&oWorkApp.ActiveWorkbook.SaveAs("<File name with full path to save>");

&oWorkApp.ActiveWorkbook.close();&oWorkApp.Quit();

3 comments:

  1. Hi. The line "&oWorkSheet.Name" gives me the error OLE Automation error in Excel.Application.Worksheets: ObjectDoMethod: Bad index. (180,161)

    Is there other way to rename a worksheet?

    ReplyDelete
  2. Even i got the same bad index error

    ReplyDelete
  3. any solution for the bad index error. i got this error, when i try to have sheet4

    ReplyDelete