Auto Numbring in Loop - document template

Posted by refael shira on 05-Jul-2017 08:20

Hi,

I have a report with a table (I'm using in loop function).

I want to add an auto-numbring(index) to the table first column.

could you please help me?

Regards,

Refael

All Replies

Posted by Srinivas Panyala on 07-Jul-2017 09:41

Hi Refael,

You can use HTML Template report.

Example:

<html>

<head>

<style>

 body

{

   counter-reset: Serial;           /* Set the Serial counter to 0 */

}

table

{

   border-collapse: separate;

}

tr td:first-child:before

{

 counter-increment: Serial;      /* Increment the Serial counter */

 content: counter(Serial); /* Display the counter */

}

 </style>

</head>

<body>

   <table border="1">

       <thead>

           <tr>

               <th>Automatic Serial number</th>

               <th>Name</th>

               <th>Email</th>

           </tr>

       </thead>

       <tbody>

                 {!#LOOP_BEGIN.all#apauBWFJQgacMUL2i8yEZg}

           <tr>

               <td></td>

               <!--leave it blank-->

               <td>{!lastName#value}</td>

               <td>{!email#text}</td>

           </tr>

               {!#LOOP_END.all}

       </tbody>

   </table>

</body>

</html>

Sample output:

Automatic Serial numberNameEmail
Emp2 Emp2@yopmail.com
Emp1 emp1@yopmail.com
Emp3 Emp3@yopmail.com

Posted by Srinivas Panyala on 07-Jul-2017 09:43

Thanks,
Srinivas

Posted by refael shira on 10-Jul-2017 05:36

Hi,

thanx on your answer.

It's Working just only in html template

but in action "render as pdf" is not

can you have a solution for this?

regards,

Refael.

This thread is closed