function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ShashvatMahendruShashvatMahendru 

Need to create a Grid in VF Page from 3 different Objects

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