+ Start a Discussion

Data Table

I'm working with quotes and line items, I have a trigger that rolls up data on 5 quote line item product categories and calculates percentages for each. I want to a have a data table essentially, that displays the 5 categories as rows and a total for the aggregated totals for each as a 6th row and have the cells for each rolled up value display with the value and the percentage as $1500 (50%). 


Category          $1500 (50%)       50.0 (35%)

Category          $1500 (50%)       50.0 (35%)


and then I have a few google charts I created as formulas, that I display on the right side. 


My first approach was with some visualforce tags, but it wasn't formatting well. Then I tried simple html table tagging, which worked a lot better to display while editing, but once I added it to the page layout, because it's quotes and I can't override the detail page, the formatting was awful and very difficult to work with. 


I know that straight html is not the best solution, because using visualforce will allow me to dig into the formatting to get the display the way I need it, but I'm stuck on where to go. I've taken a look at visualforce datatable and facets, and considered using a custom controller to set the different rolled up values and percentages together in an array, and then looping through them, but after researching I really didn't see how to do this. 


Is there a better way I can present the data in this format? I'm relatively new with visualforce and using custom controllers, but good with apex,javascript and html/css. Any solutions, ideas, points in the right direction, board examples or other resources would be appreciated :].




can you post the code you have developed so far? This will help other to give suggestions.

JHayes SDJHayes SD

Just an idea -- rather than using the <apex:dataTable> element, you may want to try using <apex:pageBlockTable> and enclosing it in an <apex:pageBlock> or <apex:pageBlockSection>.  This may fix the the formatting when added to a page layout.