0

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
<apex:page standardController="opportunity" renderAs="pdf">
    <apex:form>
        <apex:pageBlock>
            <apex:pageBlockTable value="{!opportunity.opportunityLineitems}" var="product">
            <apex:column value="{!product.Name}"/>
        </apex:pageBlockTable> 
        </apex:pageBlock>

    </apex:form>
</apex:page>

You need to use {!opportunity.opportunityLineitems}

| improve this answer | |
  • 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 '15 at 5:33
  • use like above {!opportunity.name}, {!opportunity.stage} and {!opportunity.Type} with my code – Ratan Paul Dec 16 '15 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 '15 at 5:57
  • close date? {!opportunity.CloseDate}, check date field having value or not also accessible or not? – Ratan Paul Dec 16 '15 at 6:00
  • 1
    ya thanx a ton..everthingz perfect nw.. – wizard Dec 16 '15 at 6:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.