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
SF DakshendraSF Dakshendra 

When i click on Get Contacts button i need address information of multiple contacts under account list..for example if i had 6 contacts under same account i need 6 contacts address information like below page.it supposed to be appear in 3 columns.

Hi
When i click on Get Contacts button i need address information of multiple contacts under account list..for example if i had 6 contacts under same account i need 6 contacts address information like below page.it supposed to be appear in 3 columns.Help me the button code?User-added imageUser-added image
VineetKumarVineetKumar
Try the something like this :

Controller :
public List<Integer> numberOfColumns {get; set;}

In constructor 
	numberOfColumns = new List<Integer>{1, 2, 3};

Page : 
<apex:page controller="getaddress" renderAs="pdf" >
	<apex:form>  
		<apex:outputPanel layout="block" style="overflow:auto;height:190px;"> 
				<table>
                <apex:variable var="counter" value="{!0}"/>
                <apex:repeat value="{!cons}" var="row">
                    <tr>
                        <apex:repeat value="{!numberOfColumns}" var="column">   
                            <apex:outputPanel  rendered="{!IF(cons.size > (column + counter*numberOfColumns.size)-1, true, false)}">
                                <td>         
                                    <apex:outputfield value="{!cons[(column + counter*numberOfColumns.size)-1].Mailingstreet}"></apex:outputfield><br/>
									<apex:outputfield value="{!cons[(column + counter*numberOfColumns.size)-1].Mailingcity}"></apex:outputfield><br/>
									<apex:outputfield value="{!cons[(column + counter*numberOfColumns.size)-1].Mailingstate}"></apex:outputfield><br/>
									<apex:outputfield value="{!cons[(column + counter*numberOfColumns.size)-1].Mailingcountry}"></apex:outputfield>
									<apex:outputfield value="{!cons[(column + counter*numberOfColumns.size)-1].Mailingpostalcode }"></apex:outputfield>
                                </td>
                            </apex:outputPanel>
                        </apex:repeat>
                        <apex:variable var="counter" value="{!counter+1}"/>
                    </tr>   
                </apex:repeat> 
		</apex:outputPanel>            
	</apex:form>    
</apex:page>