2

I have a VF code below where I am trying to display the related list of an object using and command. I am rendering this page as PDF , doing that in my PDF I am unable to see the content in a tabular format. How can I make the content appear in a table?

    <apex:pageBlockSection columns="1" title="TECHNICAL ASSESSMENT">

        <apex:repeat value="{!interviewSkillReviews}" var="interview">

            <table border="1" cellpadding="6">
                <apex:pageblockTable value="{!interview.Skill_review__r}" var="skillreview">

                    <apex:column headerValue="Skill Name">                                
                        <apex:outputText value="{!skillreview.Skill__r.Name}"/>
                    </apex:column>
                <apex:column headerValue="Recommended Level">
                    <apex:outputText value="{!skillreview.Level__r.Name}"/>
                </apex:column>

                <apex:column headerValue="Rating">
                    <apex:outputField value="{!skillreview.RatingCopy__c}" rendered="{!NOT(interviewerMode)}" />
                    <apex:selectList value="{!rating}" multiselect="false" size="1" rendered="{!interviewerMode}">
                        <apex:selectOption itemValue="1" itemLabel="1"/>
                        <apex:selectOption itemValue="2" itemLabel="2"/>
                        <apex:selectOption itemValue="3" itemLabel="3"/>
                        <apex:selectOption itemValue="4" itemLabel="4"/>
                        <apex:selectOption itemValue="5" itemLabel="5"/>
                    </apex:selectList>
                </apex:column>

                <apex:column headerValue="Rating Level Description">
                    <apex:outputText value="{!skillreview.Skill_Level_Description__c}"/>
                </apex:column>


            </apex:pageblockTable>
        </table> 
    </apex:repeat>
</apex:pageBlockSection>

I tried using <table> command of HTML but I just get a border around the pageblocktable.

enter image description here

Example of table look and feel:

enter image description here

3
  • I see you updated your question. Now, what is missing? What is the expected result?
    – sfdcFanBoy
    May 26, 2016 at 4:42
  • @sfdcFanBoy The tablar format is missing( look and feel of a table) with lines. Please see an example screen shot attached.
    – SfdcBat
    May 26, 2016 at 4:47
  • Isn't the border:none removing the borders. try border: 1px;
    – sfdcFanBoy
    May 26, 2016 at 5:02

1 Answer 1

3

The PDF renderer sensibly skips a lot of styling as the usual Visualforce look isn't something that you're going to want on paper.

The pageBlockTable should work but in these situations I do prefer to use standard HTML elements so that I'm not having to experiment too much with what is and what isn't supported. You should be able to specify the following CSS to hide the borders you're seeing:

table
{
    border-collapse: collapse;
    border: none;
}
5
  • Reason for me to use repeat and pageblocktable is that they have value attribute associated with it which I show it in my apex:columns. I do not know if it will be possible to use standard HTML tag when you have value attribute.
    – SfdcBat
    May 25, 2016 at 23:27
  • You could just use a nested repeat instead of the pageblocktable to get the same functionality.
    – Matt Lacey
    May 26, 2016 at 0:42
  • Thanks! Would it help in rendering the repeat section in a table when I get this VF page as pdf?
    – SfdcBat
    May 26, 2016 at 1:27
  • I'm not totally sure what you mean, you can definitely use it to generate the table rows etc., I've done this on more than a few occasions.
    – Matt Lacey
    May 26, 2016 at 3:36
  • Pardon me, I am sure that it can be done but I could not figure it out how I can do it. Please see the screen shot on how my page looks currently with no rows and column. Any direction on how I can implement it?
    – SfdcBat
    May 26, 2016 at 4:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .