3

I have a custom object as opportunity forecast , which is not related to Quote object,but i would like to create a visual force page on Quote object ,by calling the custom object fields (like partnos,quantity,price,)in a pivot table (Repeat for all periods (Month- year) This should be pivot as the data stored for every period in the opportunity forecast custom object).how to Achieve this?

2 Answers 2

2

First: if you can use Reports, please prefer them over coding anything from scratch.

If you still want/need something custom:

In the end pivoting ends up in the S(O)QL statement GROUP BY and for sure you can use this in Apex. To display the results you can create either your own HTML markup in Visualforce or you search for a Javascript component.

Depending on you data volume, you could also query all (or a lot of) data and do the (or some) pivoting client-side with Javascript.

A very quick search shows you some candidates for further investigation:

https://www.google.de/search?q=javascript+pivot+grid&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&channel=sb&gfe_rd=cr&ei=WSp-VJKYMOul8wfdy4C4BQ

I didn't use any of them, so I can't provide you a recommendation.

0

You may want to have a look at using a Matrix report type from the Report Builder... I don't think there's anything out of the box to allow for a pivot table in VF without manually coding it. Here's a link with info on creating matrix reports: http://www.salesforce.com/_app/video/chatter/help/matrix_reports.jsp.

You must log in to answer this question.

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