+ Start a Discussion

Dispalying more than 1000 records in to pdf.



i am one requirement , i have to display all values in accounts. I am posting my controller & visualforce page.


public class Raja_Test{
 public Raja_Test(ApexPages.StandardController controller)
    {  }
  public String[] states {get;set;}
  public Account[] ac {get;set;}

 public Raja_Test()
ac = [Select id,name,Bill_To__c,Bill_To__r.Name from account where Bill_To__c != NULL ];

Set<String> stateSet = new Set<String>();

    for(Account a : ac)
    states = new String[stateSet.size()];
    Integer i = 0;
    for (String state : stateSet) { 
    states[i] = state;



Visulforce Page :


<apex:page Controller="Raja_Test">
<table border = '1'>
  <apex:repeat value="{!states}" var="a">
 <apex:repeat value="{!ac}" var="a1">
<apex:outputPanel rendered="{!IF((a1.Bill_To__r.Name = a) ,true,false)}" >


Can any one help on this 


What is the error message you are getting?


Collection size 1,024 exceeds maximum size of 1,000.


You can only have 1,000 items in a list. Instead, use a nested list, which gives you a collective 1,000,000 items that you can store. You'll meet your heap/query limits before this limit, so it happens to be a lot better. The page looks like this:


<apex:page controller="test2">
    <apex:repeat value="{!accountlists}" var="index">
        <apex:repeat value="{!accountlists[index]}" var="record">
public class test2 {

    public Map<Integer,List<Account>> getaccountlists() {
        Map<Integer,List<Account>> accounts = new Map<Integer,List<Account>>();
        Integer ctr = 0;
        accounts.put(0,new List<Account>());
        for(Account[] a:[select id,name from account]) {
            if(accounts.get(ctr).size()+a.size()>1000) {
                accounts.put(ctr,new List<Account>());
        return accounts;




try this as this is a new release you can have this from 23.0 only


readOnly attribute on apex:page component  using this you can render 10k records


like this

<apex:page controller="MerchandiseController" readOnly="true">

<p>Here is all the merchandise we have:</p>

<apex:dataTable value="{!AllMerchandise}" var="product">


<apex:facet name="header">Product</apex:facet>

<apex:outputText value="{!product.Name}" />






public class MerchandiseController {

public List<Merchandise__c> getAllMerchandise() {

List<Merchandise__c> theMerchandise =[SELECT Name, Price__c FROM Merchandise__c LIMIT 10000];return(theMerchandise);}



it is hitting error as :

Error: Unsupported attribute readonly in <apex:page> in Merchandise at line 1 column 63


thats y i told you it is supported in api version 23.0 .. just check with your sandbox is updated to 23.0 r not