You need to sign in to do that
Don't have an account?
SF Dakshendra
HI i try this code for getting contact address information under account related list,its worked but i need the address information by only 3 coloums.if it has 4 contacts with same account the 4 th will be appeared in next colomn
Here my code is
public class getaddress
{
public String obj;
public account acc{get;set;}
public List<contact> cons{get;set;}
public id accid=apexpages.currentpage().getparameters().get('id');
public getaddress()
{
acc=[select id,name from account where id=:accid];
cons= [SELECT ID,Name,Mailingstreet,Mailingcity,Mailingcountry,Mailingstate,Mailingpostalcode FROM contact where accountid=:accid];
}
}
Visual page:
<apex:page controller="getaddress" renderAs="pdf" >
<apex:form>
<apex:outputPanel layout="block" style="overflow:auto;height:190px;">
<table width="100%" ><tr><apex:repeat value="{!cons}" var="u"><td width="100%" colspan="3" style="display:block;float:horizental">
<apex:outputfield value="{!u.Mailingstreet}"></apex:outputfield><br/>
<apex:outputfield value="{!u.Mailingcity}"></apex:outputfield><br/>
<apex:outputfield value="{!u.Mailingstate}"></apex:outputfield><br/>
<apex:outputfield value="{!u.Mailingcountry}"></apex:outputfield>
<apex:outputfield value="{!u.Mailingpostalcode }"></apex:outputfield>
</td><br/></apex:repeat></tr></table>
</apex:outputPanel>
</apex:form>
</apex:page>
public class getaddress
{
public String obj;
public account acc{get;set;}
public List<contact> cons{get;set;}
public id accid=apexpages.currentpage().getparameters().get('id');
public getaddress()
{
acc=[select id,name from account where id=:accid];
cons= [SELECT ID,Name,Mailingstreet,Mailingcity,Mailingcountry,Mailingstate,Mailingpostalcode FROM contact where accountid=:accid];
}
}
Visual page:
<apex:page controller="getaddress" renderAs="pdf" >
<apex:form>
<apex:outputPanel layout="block" style="overflow:auto;height:190px;">
<table width="100%" ><tr><apex:repeat value="{!cons}" var="u"><td width="100%" colspan="3" style="display:block;float:horizental">
<apex:outputfield value="{!u.Mailingstreet}"></apex:outputfield><br/>
<apex:outputfield value="{!u.Mailingcity}"></apex:outputfield><br/>
<apex:outputfield value="{!u.Mailingstate}"></apex:outputfield><br/>
<apex:outputfield value="{!u.Mailingcountry}"></apex:outputfield>
<apex:outputfield value="{!u.Mailingpostalcode }"></apex:outputfield>
</td><br/></apex:repeat></tr></table>
</apex:outputPanel>
</apex:form>
</apex:page>
Can you please try below class and VF page.
Class:- VF Page:-
Thanks,
Swaraj
I tried above code i ont get any change in that.For example if i have 9 contacts under same account it displays 3 coloumns and 3 rows.if i have three it just displays horizentally in 3 columns.
Thanks
Dakshendra.R