Posted by: shijesh | May 23, 2010

Vertical Report – Multi Column

Example

The steps below is based on above mentioned example in which I have used EMP table and Theme 20. The report has 4 columns.

Steps for creating Multi Column Vertical Report.

  1. Create a new report template (eg. Multi Column – Vertical Report).
  2. Edit the newly created template (eg. Multi Column – Vertical Report).
  3. Create a report and select the above created report new report tempage ( i.e. Multi Column – Vertical Report) as Report template.

 

1.       Creating a new report template for Multi Column Vertical Report

  • Go to Shared component.
  • Click on Templates (Under User Interface)
  • Click on Create >  button.
  • Select Report in Template Type and click on Next Button.
  • Select From Scratch and click on Next Button.
  • Type the name for your template Eg. Multi Column – Vertical Report. Leave the Theme dropdown with default value. In Template Class dropdown , select Value Attribute Pair. In template type  select  Named Column (row template). Click on create.

2.       Edit the newly created template

  • Now, from the list of template click on newly created template (eg. Multi Column – Vertical Report) to edit it.
  • In Row Template 1 enter the below code
    <tr>
        <td>
            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                <tr><th class="t20ReportHeader">EMPNO</th></tr>
                <tr><th class="t20ReportHeader">ENAME</th></tr>
                <tr><th class="t20ReportHeader">JOB</th></tr>
                <tr><th class="t20ReportHeader">HIREDATE</th></tr>
                <tr><th class="t20ReportHeader">SAL</th></tr>
            </table>
        </td>
        <td>
            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                <tr><td class="t20data">#1#</td></tr>
                <tr><td class="t20data">#2#</td></tr>
                <tr><td class="t20data">#3#</td></tr>
                <tr><td class="t20data">#5#</td></tr>
                <tr><td class="t20data">#6#</td></tr>
            </table>
        </td>

    In row template 1 Condition select  Use Based on PL/SQL Expression.
    Row template 1 Expression enter  mod(#rownum#,4)=1

  • In Report Template 2 and Report template 3 enter the below code.
    <td>
        <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr><td class="t20data">#1#</td></tr>
            <tr><td class="t20data">#2#</td></tr>
            <tr><td class="t20data">#3#</td></tr>
            <tr><td class="t20data">#5#</td></tr>
            <tr><td class="t20data">#6#</td></tr>
        </table>
    </td>

    In Row Template 2 Condition select Use Based on PL/SQL Expression.
    In Row Template 2 Expression enter mod(#rownum#,4)=2
    In Row Template 3 Expression enter mod(#rownum#,4)=3

  • In Report Template 4 enter the below code
    <td>
        <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr><td class="t20data">#1#</td></tr>
            <tr><td class="t20data">#2#</td></tr>
            <tr><td class="t20data">#3#</td></tr>
            <tr><td class="t20data">#5#</td></tr>
            <tr><td class="t20data">#6#</td></tr>
        </table>
    </td>
    </tr>
    <tr>
        <td colspan="2" class="t20seperate"><br /></td>
        <td colspan="2" class="t20seperate"><br /></td>
        <td colspan="2" class="t20seperate"><br /></td>
        <td colspan="2" class="t20seperate"><br /></td>
        <td colspan="2" class="t20seperate"><br /></td>
    </tr>
    
  • In row template 4 Condition select  Use Based on PL/SQL Expression.
    Row template 4 Expression enter  mod(#rownum#,4)=0
  • In Before row enter the below code
    <table cellpadding="0" cellspacing="0" border="0" summary=""#REPORT_ATTRIBUTES#>#TOP_PAGINATION#<tr><td><table cellpadding="0" cellspacing="0" border="0" summary=""> 
  • In After rows enter
    </table>
    <div class="t20CVS">#EXTERNAL_LINK##CSV_LINK#</div>
    </td></tr>#PAGINATION#</table>
    
  • Click on apply change

  3.       Creating a report based on our new report template

  •  Create a simple report ( eg. Select * from emp).
  • In Region Attribute , under Report Template select the template which we created above (eg. Multi Column – Vertical Report) from the dropdown and click on Create Region Button.

Thats it….  

Advertisements

Responses

  1. Hi Shijesh,

    This is good one. In step 2, you have hardcoded the column names. how to make this generic.
    And how to enable ‘column sorting’ features in this?

    Mohan


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: