• ShashvatMahendru
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies

Hi

 

I am trying to render  a VF page  as PDF, the issue is that it looses all its CSS styling when I do that, please help :

 

VF page :

 

<apex:page controller="APController" id="pgAP" sidebar="false" showHeader="false">   
   <head>
     <style>
        .cls {font-size:9pt;
              font-weight:bold!important;
              white-space:pre-wrap;}  
     </style>
   </head>
   <apex:form id="frm1">
      <!-- <apex:pageBlock title="AP report" id="blk1">  -->
         <table border="1">
           <th>Contact</th>
            <tr>
             <td width="300">   
              <apex:repeat value="{!lstContacts}" var="cn" id="theRepeat">
                <apex:outputText styleClass="cls" value="{!cn.Name}" id="theName" /><br/>
                <apex:outputText styleClass="cls" value="{!cn.Title}" id="theTitle"/><br/>
              </apex:repeat>
             </td>
            </tr>
           </table>
      <!--  </apex:pageBlock>  -->
   </apex:form>
</apex:page>

 

Thanks

Shasvat

Hi

 
I need to create a grid in a VF page rendered as a PDF (Cannot use jQuery or JScript).
 
  1. On the Account Standard Page I have a custom button , which redirects us to this VF Page passing the Id of the Account.
  2. On this VF page I have to display a grid. Following are the specifications of the grid :
  • First Column would List all the Contacts related to the Account whose Id was passed to this VF page. This could be easily implemented but the complexity is that in Contact object we have a self look up field called Reports_To__c and these Contacts in the first column should be displayed in parent child heirarcal fashion and indented too like -
            Adam B. (CEO)
                  John M (CFO)
                  Joseph K (CIO)
                          Andrew (Director - IT)
                                    Robert T (Manager-IT)
                                         Jose C (Developer)
  • The next 4 columns would be Product categories as Prod-1, Prod-2, Prod-3, Prod-4.
  • Now we have a custom Object lets say PI__c, this object is child of Opportunity. there could be multiple PI__c's related to a Contact and to Opportunity.
  • Now what we want is on the each cell intersection for e.g. first row and second column i.e. Contact = Adam B. and Product Category = Prod 1, we want to list all the PI__c's in this cell which would have Prod Category = 1 (we can find this by going from PI__c to Opportunity and from Opportunity to Product->Product Category) and Contact of that PI__c = Adam B.
  • The issue is that we cannot use jQuery and also the table would have dynamic number of rows depending on the number of Contacts that are related to that Account.
Please help.
 
Thanks
Shashvat