I have to render VF page as PDF. It should display opportunity fields and a table showing related opportunity product details in PDF form.I am gettin a table for opportunity but am not able to populate the details of all the products related to opportunity which Shows product details in a table populating following opportunity product fields, a) Date b) Discount c) List Price d) Product Code e) Quantity f) Sales Price g) Subtotal h) Total Price Can anyone help me out with this.enter image description here

1 Answer 1

<apex:page standardController="opportunity" renderAs="pdf">
            <apex:pageBlockTable value="{!opportunity.opportunityLineitems}" var="product">
            <apex:column value="{!product.Name}"/>


You need to use {!opportunity.opportunityLineitems}

  • Thanq..this helped alot.. But now the problem is I want the opportunity fields like Opportunity Name,Parent Account Name,Stage,Type... together with product fields
    – wizard
    Dec 16, 2015 at 5:33
  • use like above {!opportunity.name}, {!opportunity.stage} and {!opportunity.Type} with my code
    – Ratan Paul
    Dec 16, 2015 at 5:39
  • ya perfectly workin.. but am not able to get the date field of product.. Otherwise all the other fields are coming
    – wizard
    Dec 16, 2015 at 5:57
  • close date? {!opportunity.CloseDate}, check date field having value or not also accessible or not?
    – Ratan Paul
    Dec 16, 2015 at 6:00
  • 1
    ya thanx a ton..everthingz perfect nw..
    – wizard
    Dec 16, 2015 at 6:13

You must log in to answer this question.

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