Skip to main content
meghna m ha preguntado en #Visualforce
Can any one help me out on this.How to create a Table in visualforce page which is in PDF format.Based on the years the the product name should get dentified in a quarters and get added.Any suggestion plz.

I get the Table Created as :

ProductName Q1 Q2 Q3 Q4 Total

BXCD 100 200 300 400 1000

BCRX 50 150 250 350 800

VERO 200 300 400 500 1400

SubTotal

GrandTotal

But the table should get displayed as :

ProductName Year Q1 Q2 Q3 Q4 Total

BXCD 2014 100 200 300 400 1000

2015 100 200 300

BCRX 2014 50 150 250 350 800

2015 300 300

VERO 2014 200 300 400 500 1400

  2015

SubTotal 350 650 950 1250 3200

GrandTotal 350 650 950 1250 3200

 
2 respuestas
  1. 9 mar 2015, 15:49
    I would suggest do it like this.

    1. use custom controller to organize the data.

    1.1. create a wrapped class (say wrappedProduct), including productname, year, Q1 to Q4 and total.

    1.2 create a class with list<WrappedProduct> variable. In the controller,manipulate the data per your expectation.

    2. Bind a repeating component with list<WrappedProduct> variable. ie, pageblocktable, datatable
0/9000