+ Start a Discussion
RajitRajit 

Issue with repeat tag while rendering as pdf

Hi Everyone,

 

I am having a strange problem while rendering a page as pdf.

 

Please help guys!

 

 

Problem :

I am trying to use apex:repeat for iterating over a List<List<Sobject>>. my VF page as html renders well.

But when I try to render it as pdf ,it gives me a blank pdf.

 

My Code :

<apex:Page .... renderas="pdf">

 <apex:repeat value="{!ListListOFSOBJECT}" var="list" id="theRepeat">

    <table >

          <apex:repeat value="{!list}" var="item">
                  <tr>
                       <td>
                            {!item.name}

                        </td>

                  </tr>      
                        
         </apex:repeat>
     </table>
</apex:repeat>

</apex:page>

 

This is resulting into blank pdf.

As a workaround i tried to pass the list <apexclassX> to repeat tag

where class X {

 list<SOBJECT>

}

 

But this approach also resulted in a blank pdf.

 

Please Help!

 

RajitRajit

Any Idea on this?

apexsutherlandapexsutherland

I'm also encountering this issue. Did you ever find a workaround?

arizonaarizona

I have found that the pdf page will not gather the data.  The data needs to be in the list before calling the page.  Therefore you need to call a page that will show the data and have a button on the page that calls a method that calls your pdf page. The data will already be in the list so it will show in the page.