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
Jerry ClifftJerry Clifft 

List is single column / field and 100 rows long, BUT I need to display as 5 columns of 20 rows.

Having a little difficulty figuring this one out, hopefull you can help. I have a list to print as a PDF, single column / field, data is 100 rows long, BUT I need to display as 5 columns of 20 rows.

 

Right now I have:

Name

blah

blah

blah

blah

.....

 

I want to:

Name       Name      Name    Name      Name

blah           blah        blah        blah          blah

blah           blah        blah        blah          blah

 

 

This is my controller:

public class dataTableCon {

    List<Packages__c> pds;

    public List<Packages__c> getpds() {

  pds = [select Name, Channel_Name__c, Logo__c, Parent_Product_Content__c, Parent_Product_Content__r.Name, Product_del__c, Product_del__r.Name
FROM Packages__c
WHERE Product_del__r.Name = 'Whatever Name'];

        return pds;

    }

}

 

Here is my visualforce:

<apex:page controller="dataTableCon" renderAs="pdf" applyBodyTag="false">
    <head>
    </head>
    <body>
        <h1>Name!</h1>

<div style="height:500px; border:5px; background-color:#FFA500;">
<apex:dataTable value="{!pds}" var="p" id="theTable" rowClasses="odd,even">
    <apex:column >
        <apex:facet name="header">Channel Name</apex:facet>
        <apex:facet name="footer">column footer</apex:facet>
        <apex:outputText value="{!p.Channel_Name__c}"/>
    </apex:column>
</apex:dataTable>
</div>

   </body>
</apex:page>

 

Thanks!

ericmonteericmonte

You might want to look into Bob Buzzard's blog

http://bobbuzzard.blogspot.com/2011/03/edit-parent-and-child-records-with.html

 

it's similar to what you want, but basically his doing an inputfield rather than output field.

 

You might want to also look into Jeff Douglas' blog he had something similar in the past.