I have a query which gives the out put like this...
EMPLOYEE_NUMBER, NAME, QUESTION, ANSWER.
I need to show these information in a report like this
EMPLOYEE NUMBER | NAME | QUESTION 01 | QUESTION 02 | QUESTION 03 ...
In these question columns, answers given by employees for that particular question should be displayed.
These question columns should be dynamically generated as the no of questions may be changed time to time. I'm using PIVOT/ UNPIVOT in the query to handle this and everything is all right except the rtf template.
Im using Oracle report builder for report creation and RTF templates are used for formatting. Finally these .rdf file and .rtf file is uploaded to oracle application. In oracle application, rtf out put is set to Excel. So that the user should be able to download the report as a Excel file.
So I'm trying to achieve this by using a RTF template as follows...
In first cell of fist column EMPLOYEE_NUMBER:
<?for-each-group@section:G_EMPLOYEE_NUMBER;./ EMPLOYEE_NUMBER?> <?variable@incontext:IND;EMPLOYEE_NUMBER?>
In QUESTION column (last column which is dynamic) header:
<?for-each-group@column: G_EMPLOYEE_NUMBER;QUESTION?>
In first cell of the QUESTION column:
<?for-each-group@cell://G_EMPLOYEE_NUMBER;QUESTION?>
<?current-group()[EMPLOYEE_NUMBER=$IND]/ANSWER?>
But this doesn't give the desired output. It seems some thing wrong in the .rtf template and even the output is not coming in Excel. It just open in a browse and columns are not showing properly. Any thoughts please? Do you see any mistakes in above code?
Note:
G_EMPLOYEE_NUMBER
is the grouping name in the report.
I,m new to these technologies.
Sample data in a row in xml:
<Row>
<Employee_Number>5001419</Employee_Number>
<Name>David Fernando</Name>
<Question>I'm able to use internal systems to find information on policies/people/projects</Question>
<Answer>b. Agree</Answer>
</Row>