+ Start a Discussion
Laura SpellmanLaura Spellman 

How to display List of lists in visualforce, similarly to the customizable forecast page?

Hey there!

I am new to visualforce and am currently recreating the customizable forecast tab to add some features needed by our exec team. My current question is in regards to recreating the top section of the page, seen belowootb customizable forecast - top section

Currently, I have added the new features to the page and I have to data stored in a list of lists of a class defined as forecastValues. I'll include the data structure code below.
public class forecastValues {
    public Decimal quantity{ get; set; }
    public Decimal revenue{ get; set; }
public List<forecastValues> forecastCategValues{get; set;}
public List<List<forecastValues>> monthlyValues{get; set;}

        Public static forecastValues initializeForecastValues(){
            forecastValues fv = new forecastValues();
            fv.quantity = 0; fv.revenue = 0;
            return fv;

        Public List<forecastValues> initializeforecastCategValues(){
            forecastCategValues = new forecastValues[5]; //one for each category: closed, commit, bestCAse, Pipeline, TOTALS

            for (integer i = 0; i < forecastCategValues.size(); i++){
                forecastCategValues[i] = initializeForecastValues();
            return forecastCategValues;

       Public List<List<forecastValues>> initializemonthlyValues(){
            monthlyValues = new List<List<ForecastValues>>();
            for (integer i = 0; i < integer.valueOf(selectedRangeLength); i++){ // one for each period in forecasting range: 1-6
            return monthlyValues;

So I have a <List<list<forecastValues>> monthlyValues where all of the data I'd like to display is located. From this point though, I would appreciate some help on how to display it in a visualforce table. I essentially have a groups of quantities and revenues that need to be associated with a month and forecast category on the page, but this information isnt explicitly noted in monthlyValues.

I would much appreciate any advice or help that you may have for me.  is there a way to manually name the rows and columns, etc??

Thank you!
Laura SpellmanLaura Spellman
As clarification, the visualforce table should look like or close to the photo at the top.