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
Jim MontgomeryJim Montgomery 

Combine data from 2 seperate custom objects into one list in apex class

I am trying to append data from 2 seperate lists into a single list in an apex class.
I keep getting an error"Illegal assignment from List<AMS_Renewal_Data__c> to List<Apttus_Proposal__Proposal__c> at line 12 column 1".
Class below.
Any assistance will be greatly appreciated!

public with sharing class AMSRDController {
Public List<apttus_proposal__Proposal__c> RenewalData{get;set;}
Public List<apttus_proposal__Proposal__c> Junk{get;set;}

Public AMSRDController() {
GetRenewalData();
GetJunk();
GetCombinedList();
}
Public Void GetRenewalData()
{
RenewalData = [select product_description__c from AMS_Renewal_Data__c where id = :ApexPages.currentPage().getParameters().get('id')];
}
Public Void GetJunk()
{
Junk = [select product_description__c from Apttus_Proposal__Proposal_Line_Item__c where id = :ApexPages.currentPage().getParameters().get('id')];
}
Public List<apttus_proposal__Proposal__c> GetCombinedList()
{
List<apttus_proposal__Proposal__c> CombinedItems=new List<apttus_proposal__Proposal__c>();
CombinedItems.addAll(RenewalData);
CombinedItems.addAll(Junk);

return CombinedItems;
}
}
Jim MontgomeryJim Montgomery
OK, found my stupid mistakes at the top.
I have corrected, but still don't know how to get all of this in one list at the bottom. Compile Error: Invalid type: CombinedItems at line 20 column 44

public with sharing class AMSRDController {
Public List<AMS_Renewal_Data__c> RenewalData{get;set;}
Public List<apttus_proposal__proposal_line_item__c> Junk{get;set;}

Public AMSRDController() {
GetRenewalData();
GetJunk();
GetCombinedList();
}
Public Void GetRenewalData()
{
RenewalData = [select product_description__c from AMS_Renewal_Data__c where id = :ApexPages.currentPage().getParameters().get('id')];
}
Public Void GetJunk()
{
Junk = [select product_description__c from Apttus_Proposal__Proposal_Line_Item__c where id = :ApexPages.currentPage().getParameters().get('id')];
}
Public List<apttus_proposal__Proposal__c> GetCombinedList()
{
List<CombinedItems> CombinedItems=new List<CombinedItems>();
CombinedItems.addAll(RenewalData);
CombinedItems.addAll(Junk);

return CombinedItems;
}
}
Pankaj_GanwaniPankaj_Ganwani
You are trying to assign AMS_Renewal_Data__c object data to RenewalData which is of type apttus_proposal__Proposal__c. That is the reason it is showing illegal assignment error. Please correc it.
Pankaj_GanwaniPankaj_Ganwani
public with sharing class AMSRDController {
Public List<AMS_Renewal_Data__c> RenewalData{get;set;}
Public List<apttus_proposal__proposal_line_item__c> Junk{get;set;}

Public AMSRDController() {
GetRenewalData();
GetJunk();
GetCombinedList();
}
Public Void GetRenewalData()
{
RenewalData = [select product_description__c from AMS_Renewal_Data__c where id = :ApexPages.currentPage().getParameters().get('id')];
}
Public Void GetJunk()
{
Junk = [select product_description__c from Apttus_Proposal__Proposal_Line_Item__c where id = :ApexPages.currentPage().getParameters().get('id')];
}
Public List<Sobject> GetCombinedList()
{
List<Sobject> CombinedItems=new List<Sobject>();
CombinedItems.addAll(RenewalData);
CombinedItems.addAll(Junk);

return CombinedItems;
}
}

Please refer above mentioned code. You will have to use List<Sobject> if you want to store the values of different objects in a single list.
Jim MontgomeryJim Montgomery
I have done that and now getting error Compile Error: Incompatible argument type List<AMS_Renewal_Data__c> for All method on List<SObject> at line 22 column 1. Added controller extension code a swell.


public with sharing class AMSRDControllerExtension {
Public AMSRDControllerExtension(ApexPages.StandardController stdController){}
Public List<AMS_Renewal_Data__c> RenewalData{get;set;}
Public List<apttus_proposal__proposal_line_item__c> Junk{get;set;}

Public AMSRDControllerExtension() {
GetRenewalData();
GetJunk();
GetCombinedList();
}
Public Void GetRenewalData()
{
RenewalData = [select product_description__c from AMS_Renewal_Data__c where id = :ApexPages.currentPage().getParameters().get('id')];
}
Public Void GetJunk()
{
Junk = [select product_description__c from Apttus_Proposal__Proposal_Line_Item__c where id = :ApexPages.currentPage().getParameters().get('id')];
}
Public List<SObject> GetCombinedList()
{
List<SObject> CombinedItems=new List<SObject>();
CombinedItems.addAll(RenewalData);
CombinedItems.addAll(Junk);

return CombinedItems;
}
}
Pankaj_GanwaniPankaj_Ganwani
Try with this:
 
public with sharing class AMSRDController {
Public List<apttus_proposal__Proposal__c> RenewalData{get;set;}
Public List<apttus_proposal__Proposal__c> Junk{get;set;}

Public AMSRDController() {
GetRenewalData();
GetJunk();
GetCombinedList();
}
Public Void GetRenewalData()
{
RenewalData = [select product_description__c from AMS_Renewal_Data__c where id = :ApexPages.currentPage().getParameters().get('id')];
}
Public Void GetJunk()
{
Junk = [select product_description__c from Apttus_Proposal__Proposal_Line_Item__c where id = :ApexPages.currentPage().getParameters().get('id')];
}
Public List<apttus_proposal__Proposal__c> GetCombinedList()
{
List<apttus_proposal__Proposal__c> CombinedItems=new List<apttus_proposal__Proposal__c>();
CombinedItems.addAll((List<sobject>)RenewalData);
CombinedItems.addAll((List<sobject>)Junk);

return CombinedItems;
}
}

 
Temoc MunozTemoc Munoz
Hi Jim.

You're trying to combine two lists of different data types.
I noticed you only have product_description__c as the common field in both lists. 

1. You can change the data type for the lists to String and only store product description. Then, combine at the end
List<String> renewalDataDescriptions = new List<String>();
for(AMS_Renewal_Data__c descr : [select product_description__c from AMS_Renewal_Data__c where id = :ApexPages.currentPage().getParameters().get('id')])
{
    renewalDataDescriptions .add(descr.product_description__c);
}

List<String> junkDescription = new List<String>();
for(Apttus_Proposal__Proposal_Line_Item__c  descr : [select product_description__c from Apttus_Proposal__Proposal_Line_Item__c where id = :ApexPages.currentPage().getParameters().get('id')])
{
   junkDescription.add(descr.product_description__c);
}
Temoc MunozTemoc Munoz
the second option would be:
public with sharing class AMSRDController {
Public List<apttus_proposal__Proposal__c> RenewalData{get;set;}
Public List<AMS_Renewal_Data__c> Junk{get;set;}
.....

List<sObject> CombinedItems=new List<Object>();
CombinedItems.addAll((List<sobject>)RenewalData);
CombinedItems.addAll((List<sobject>)Junk);



 
Jim MontgomeryJim Montgomery
There will be more fields in each list. I was just starting with a single field. Jim Montgomery Manager, Sales Intelligence Operations Wolters Kluwer Tax & Accounting 20101 Hamilton Ave. Torrance, CA 90502 877-346-7148 jim.montgomery@wolterskluwer.com
Pankaj_GanwaniPankaj_Ganwani
Hi Jim,

Can you please let us know what exactly you want to achieve? We can better assist you if we know the actual requirement.

Thanks,
Pankaj
Jim MontgomeryJim Montgomery
I am attempting to combine 2 lists of data(same field names in both lists), and have gotten the extension controller to save correctly. I am now attempting to access the data in the CombinedItems list in an apex page block table, but am getting the error “Unknown property 'Apttus_Proposal__Proposal__cStandardController.CombinedItems'”. Class public with sharing class AMSRDControllerExtension { Public AMSRDControllerExtension(ApexPages.StandardController stdController){} Public List RenewalData{get;set;} Public List Junk{get;set;} Public AMSRDControllerExtension() { GetRenewalData(); GetJunk(); GetCombinedList(); } Public Void GetRenewalData() { RenewalData = [select product_description__c from AMS_Renewal_Data__c where id = :ApexPages.currentPage().getParameters().get('id')]; } Public Void GetJunk() { Junk = [select product_description__c from Apttus_Proposal__Proposal_Line_Item__c where id = :ApexPages.currentPage().getParameters().get('id')]; } Public List GetCombinedList() { List CombinedItems=new List(); CombinedItems.addAll((List)RenewalData); CombinedItems.addAll((List)Junk); return CombinedItems; } } Page textarea { resize: none; } @media print { .noprint {display:none;} .Break {page-break-before:Always;} .Body {zoom:120%;} } @media screen { .medium {color: #F00;} }



Jim Montgomery Manager, Sales Intelligence Operations Wolters Kluwer Tax & Accounting 20101 Hamilton Ave. Torrance, CA 90502 877-346-7148 jim.montgomery@wolterskluwer.com
Pankaj_GanwaniPankaj_Ganwani
Alright, I also came across with the similar requirement once and I used the below mentioned approach. You can also refer the same:
 
public without sharing class InvestorContactAndFundVFController 
{
    /* Start - Variables */
    public List<String> lstHeaders                  	{set;get;}//list to hold names of the headers
    public List<String> lstFieldAPINames            	{set;get;}//list to hold the api names of the fields that needs to be displayed on page
    public List<RecordWrapper> lstRecordWrapper     	{set;get;}//list to hold wrapper class objects to show on the page.
    public String strObjectId                       	{get;set;}//Id of the element that needs to be deleted
    public Boolean isRender								{get;set;}//flag variable to hold the status of rendering
    public Boolean isEditable							{get;set;}//flag variable to hold the status of checkboxes
    public String ContactId								{get;set;}//variable to hold contact id
    /* End - Variables */
    
    /*Start - Class Variables */
    private static final String ACTIVE_STATUS	= 'Active';//this variable is used to show the active status for fund of interest object record
    private String strContactName;
    /*End - Class Variables */
    
    /* Start - Constructor */
    public SL_InvestorContactAndFundVFController()
    {
		//Do  Nothing
    }
    /* End - Constructor */
    
     /** 
        * @ClassName      : RecordWrapper
        * @parameter      : NA
        * @Description    : This class is used to contain the sobject records and their type to show on the inline vf page
    */ 
    public class RecordWrapper
    {
        public Sobject objSobject   			{set;get;}// variable to hold sobject record
        public String strType       			{set;get;}// variable to hold the type of sobject
        public String strObjectName 			{set;get;}// variable to hold the name of the sobject
        public RecordWrapper(Sobject objSobject, String strType, String strObjectName)
        {
            this.objSobject = objSobject;
            this.strType = strType;
            this.strObjectName = strObjectName;
        }
    }
     
     /** 
        * @Name         : getRecords
        * @parameter    : Field set name, sobject name
        * @Description  : This method is used to frame soql and retrieve the records from corresponding sobject and fill the wrapper class objects accordingly.
    */ 
    private List<RecordWrapper> getRecords(String strFieldSetName, String strSobjectName, String strType)
    {
        List<RecordWrapper> lstRecords = new List<RecordWrapper>();
        Schema.FieldSet objFieldSet = Schema.getGlobalDescribe().get(strSobjectName).getDescribe().FieldSets.getMap().get(strFieldSetName);
        String strQuery = 'SELECT Id,';
        try
        {
        	//Iterating over field set member object to fill the header list and field api list
            for(Schema.FieldSetMember objFieldSetMember : objFieldSet.getFields())
            {
                if(strType == 'Investor Contact' && objFieldSetMember.getFieldPath()!='Investment__c')
                {
                    lstHeaders.add(objFieldSetMember.getLabel());
                    lstFieldAPINames.add(objFieldSetMember.getFieldPath());
                }
                strQuery+=objFieldSetMember.getFieldPath() +',';
            }
            strQuery = strQuery.substring(0,strQuery.length()-1);
            strQuery+=' FROM '+strSobjectName;
            strQuery+= strSobjectName == 'Investor_Contact__c' ? ' WHERE Contact__c =: ContactId' : ' WHERE Contact__c =: ContactId AND Status__c=:ACTIVE_STATUS';
            
            //Iterating over records to fill the wrapper class list to bind with the page
            for(Sobject objSobject : Database.query(strQuery))
            {
                lstRecords.add(new RecordWrapper(objSobject, strType, strSobjectName));
            }
        }
        catch(Exception ex)
        {
            System.debug('================'+ex.getMessage()+'======================'+ex.getLineNumber());
        }
        return lstRecords;
    }
    
    /** 
        * @Name         : saveRecords
        * @parameter    : -
        * @Description  : This method is used to save the records updated on the page side
    */ 
    public void saveRecords()
    {
        List<Sobject> lstSobject = new List<Sobject>();//list to hold the objects that needs to be updated
        try
        {
	        //Iterating over record wrapper list to collect the objects into a list to update them.
	        for(RecordWrapper objRecordWrapper : lstRecordWrapper)
	        {
	        	lstSobject.add(objRecordWrapper.objSobject);
	        }
	    	update lstSobject;
	    	isEditable = false;
        }
        catch(Exception ex)
        {
        	System.debug('================='+ex.getMessage());
        }
    }
    
    /** 
        * @Name         : editRecords
        * @parameter    : -
        * @Description  : This method is used to enable the checkboxes on click of edit button
    */ 
    public void editRecords()
    {
    	isEditable = true;
    }
    
     /** 
        * @Name         : redirectFundOfInterest
        * @parameter    : -
        * @Description  : This method is used to redirect the standard New Fund of Interest page.
    */ 
    public Pagereference redirectFundOfInterest()
    {
    	return new Pagereference('/a0u/e?CF00NL0000003IwZg='+strContactName+'&CF00NL0000003IwZg_lkid='+ContactId+'&saveURL='+ContactId+'&retURL='+ContactId);
    }
    
    /** 
        * @Name         : redirectInvestorContact
        * @parameter    : -
        * @Description  : This method is used to redirect the standard New Investor Contact page.
    */ 
    public Pagereference redirectInvestorContact()
    {
    	return new Pagereference('/a03/e?CF00Ni000000DjVDG='+strContactName+'&CF00Ni000000DjVDG_lkid='+ContactId+'&saveURL='+ContactId+'&retURL='+ContactId);
    }
    
     /** 
        * @Name         : deleteRecords
        * @parameter    : -
        * @Description  : This method is used to delete a particular record based on its Id.
    */ 
    public void deleteRecords()
    {
    	//creating new object record
        sobject objSobject = Schema.getGlobalDescribe().get(String.valueOf(Id.valueOf(strObjectId).getSobjectType())).newSObject();
        objSobject.put('Id', strObjectId);
        delete objSobject;//deleting the sobject
        initializeElements();//initializing the elements
    }
    
     /** 
        * @Name         : initializeElements
        * @parameter    : -
        * @Description  : This method is used to initialize the elements.
    */ 
    public void initializeElements()
    { 
	    isRender = true;
	    lstHeaders = new List<String>{'Name'};
        lstFieldAPINames = new List<String>();
		lstRecordWrapper = new List<RecordWrapper>();
	    lstRecordWrapper = getRecords('SL_InvestorContactFieldSet', 'Investor_Contact__c', 'Investor Contact');//calling function for investor contact object
        lstRecordWrapper.addAll(getRecords('SL_FundOfInterestFieldSet', 'Fund_of_Interest__c', 'Fund Of Interest'));//calling function for fund of interest object
        strContactName = [SELECT Name FROM Contact WHERE Id=:ContactId].Name;
        if(lstRecordWrapper.isEmpty())
        	Apexpages.addMessage(new Apexpages.Message(ApexPages.Severity.INFO,'No Records to display.'));
    }
}

VF Page:
 
<apex:component controller="InvestorContactAndFundVFController" allowDML="true">
    <apex:attribute name="conId" description="this is an id of contact record" type="String" required="true" assignTo="{!ContactId}"/>
    <base target="_parent"/>
    <head>
        <style>
        .investorContactTable  
        {
            border:2;
            font-size: 12px;
            table-layout:fixed;
        }
        .investorContactTable td
        {
            border-width: 1px 1px 1px 1px;
            border-style:solid;
            border-color:#D2DAE0;
            font-size:0.9em;
            font-weight:bold;
            background: none repeat scroll 0% 0% #F2F3F3;
            padding:0 0 0 2px;
        }
        #buttonsDiv
        {
            text-align:center;
            padding-bottom: 10px;
            font-size: 100%;
        }
        .investorContactTable .investorRecords td
        {
            font-weight:normal;
            background:white;
            font-size:1.0em;
            border-width: 0px 0px 0px;
            padding-top:4px;
        }
        .btnDisabled
        {
            font-family:'Verdana','Geneva',sans-serif;
            background-image:url("/img/bgButtonDisabled.gif");
            background-repeat:repeat-x;
            background-position:left top;
            border-right:1px solid #999;
            border-bottom:1px solid #999;
            border-top:1px solid #ccc;
            border-left:1px solid #ccc;
            font-size:80%;
            color:#c1c1c1;
            padding:0 3px 1px 3px;
            cursor:default;
            font-weight:bold;
        }
        .editAndDelLinks a
        {
        	color:#015BA7;
        	text-decoration:none;
        }
        .actionStatusDiv
		{
			margin-top:2px;
			text-align:center;
			font-weight:bold;
			font-size:1.0em;
			background: none repeat scroll 0% 0% #F2F3F3;
		}
        </style>
    </head>
    	<apex:form >
           <apex:actionFunction name="deleteRecordsAF" action="{!deleteRecords}" rerender="pageData,showMessage" status="processing">
           	<apex:param value="" name="recordId" assignTo="{!strObjectId}"/>
           </apex:actionFunction>
           <apex:actionFunction name="saveRecordsAF" action="{!saveRecords}" rerender="pageData" status="processing" onComplete="enableButton('{!$Component.saveRecord}','{!$Component.editButton}');"/>
           <apex:actionFunction name="editRecordsAF" action="{!editRecords}" rerender="pageData" status="processing" />
           <div Id="buttonsDiv">
               <apex:commandButton value="New Fund of Interest" action="{!redirectFundOfInterest}"/>
               <apex:commandButton value="New Investor Contact" action="{!redirectInvestorContact}"/>
               <apex:commandButton value="Edit" id="editButton" onClick="return disableButton('{!$Component.saveRecord}',this);"/>
               <apex:commandButton value="Save" onClick="return saveRecords();" id="saveRecord" disabled="true"/>
           </div>
           <apex:actionFunction name="initializeElementsAF" action="{!initializeElements}" rerender="pageData,showMessage" status="loading"/>
           <apex:outputPanel id="dummy"/>
           <script>
           	window.onload = function(){
           	initializeElementsAF()
           	};
           </script>
        <apex:outputPanel id="pageData">
	        <apex:outputPanel rendered="{!isRender}">
		          <table width="100%" cellspacing = "0" cellpadding="0" class="investorContactTable">
		              <thead>
		                  <tr>
		                      <td width="6%">
		                          Action
		                      </td>
		                      <apex:repeat value="{!lstHeaders}" var="headerName">
		                          <td width="{!IF(headerName == 'Name','20%','7%')}">
		                              {!headerName}
		                          </td>
		                      </apex:repeat>
		                      <td width="15%">
		                          Type
		                      </td>
		                  </tr>
		              </thead>
			               <tbody class="investorRecords">
			                   <apex:repeat value="{!lstRecordWrapper}" var="objRecordWrapper" rendered="{!lstRecordWrapper!=null && lstRecordWrapper.size > 0}">
			                       <tr>
			                           <td class="editAndDelLinks">
			                               <a href="/{!objRecordWrapper.objSobject['Id']}/e?retURL={!ContactId}">Edit</a>
			                               |
			                               <apex:commandLink value=" Del" onClick="return deleteRecords('{!objRecordWrapper.objSobject['Id']}');"/>
			                           </td>
		                               <td>
		                                   <apex:outputField value="{!objRecordWrapper.objSobject['Investment__c']}" rendered="{!IF(objRecordWrapper.strObjectName == 'Investor_Contact__c',true,false)}"/>
		                                   <apex:outputField value="{!objRecordWrapper.objSobject['Fund_Family__c']}" rendered="{!IF(objRecordWrapper.strObjectName == 'Fund_of_Interest__c',true,false)}"/>
		                               </td>
			                            <apex:repeat value="{!lstFieldAPINames}" var="fieldName">
			                                 <td>
			                                     <apex:outputField value="{!objRecordWrapper.objSobject[fieldName]}" rendered="{!IF(((fieldName != 'Investment__c' && fieldName != 'Fund_Family__c' && objRecordWrapper.strObjectName == 'Investor_Contact__c') || (objRecordWrapper.strObjectName == 'Fund_of_Interest__c' && fieldName != 'Investment__c' && fieldName != 'Fund_Family__c' && (fieldName == 'Estimate__c' || fieldName == 'Monthly_Update__c' || fieldName == 'Quarterly_Letter__c'))) && !isEditable, true, false)}"/>
			                                     <apex:inputCheckbox value="{!objRecordWrapper.objSobject[fieldName]}" rendered="{!IF(((fieldName != 'Investment__c' && fieldName != 'Fund_Family__c' && objRecordWrapper.strObjectName == 'Investor_Contact__c') || (objRecordWrapper.strObjectName == 'Fund_of_Interest__c' && fieldName != 'Investment__c' && fieldName != 'Fund_Family__c' && (fieldName == 'Estimate__c' || fieldName == 'Monthly_Update__c' || fieldName == 'Quarterly_Letter__c'))) && isEditable, true, false)}"/>
			                                 </td>
			                            </apex:repeat>
			                           <td>
			                               <apex:outputText value="{!objRecordWrapper.strType}"/>
			                           </td>
			                       </tr>
			                   </apex:repeat>
			                   <apex:outputText value="No records to display" rendered="{!lstRecordWrapper.size == 0}"/>	                  
			               </tbody>
		          </table>	          
	          </apex:outputPanel>
          </apex:outputPanel>
          <div class="actionStatusDiv">
			<apex:actionStatus startText="Loading..." id="loading"/>
		  </div>
		  <apex:pageMessages id="showMessage"/>
<!-- 	Start -       Action Status component -->
	      <c:ActionStatusComponent />
<!-- 	End -       Action Status component -->
        </apex:form>
        <script>
        function saveRecords()
        {
        	saveRecordsAF();
        	return false;
        }
        function deleteRecords(objectId)
        {
        	if(confirm('Are you sure?')) 
        		deleteRecordsAF(objectId);
        	return false;
        }
        function disableButton(saveButtonId, editButtonId)
        {
        	document.getElementById(saveButtonId).className = 'btn';
        	document.getElementById(saveButtonId).removeAttribute('disabled');
            editButtonId.className = 'btnDisabled';
            editButtonId.disabled = true;
            editRecordsAF();
            return false;
        }
        function enableButton(saveButtonId, editButtonId)
        {
        	document.getElementById(editButtonId).className = 'btn';
        	document.getElementById(editButtonId).removeAttribute('disabled');
            document.getElementById(saveButtonId).className = 'btnDisabled';
            document.getElementById(saveButtonId).disabled = true;
        }
        </script>
</apex:component>

 
Jim MontgomeryJim Montgomery
OK, so I have this updated controller code, and in the VF page, I get results from Renewal Data or Junk, but I get an error object.product_description__c does not exist when using CombinedItems. I have tires sObject as well. Same error.

Class
public with sharing class AMSRDControllerExtension {
Public List<AMS_Renewal_Data__c> RenewalData{get;set;}
Public List<apttus_proposal__proposal_line_item__c> Junk{get;set;}
Public List<Object> CombinedItems {get;set;}
Public AMSRDControllerExtension(ApexPages.StandardController stdController){

GetRenewalData();
GetJunk();
GetCombinedList();
}
Public Void GetRenewalData()
{
RenewalData = new list<ams_renewal_data__c>([select product_description__c from AMS_Renewal_Data__c where Proposal_id__c = :ApexPages.currentPage().getParameters().get('id')]);
}
Public Void GetJunk()
{
Junk = new List<apttus_proposal__proposal_line_item__c>([select product_description__c from Apttus_Proposal__Proposal_Line_Item__c where apttus_proposal__Proposal__c = :ApexPages.currentPage().getParameters().get('id')]);
}
Public Void GetCombinedList()
{
CombinedItems=new List<Object>();
CombinedItems.addAll((List<object>)RenewalData);
CombinedItems.addAll((List<object>)Junk);

}
}

Page

<apex:page StandardController="Apttus_Proposal__Proposal__c" extensions="AMSRDControllerExtension"  sidebar="False" showHeader="false" pageStyle="width:1100px;"  >
<head>
<style type="text/css">

textarea {
    resize: none;
}


@media print

{

.noprint {display:none;}
.Break {page-break-before:Always;}
.Body {zoom:120%;}
}
@media screen
{   
.medium {color: #F00;} 
    
}
</style>
</head>
<apex:form >
<div class="noprint">
<apex:Pageblock >
<apex:commandButton value="Print" onclick="window.print()" />
</apex:Pageblock>
</div>
<body class="Body">
<b><apex:outputLabel style="position:fixed;left:300px;font-size:25px;" Value="2016 CCH"/><apex:outputLabel style="position:fixed;left:417px;" value="®"/></b>
<b><apex:outputLabel style="position:fixed;left:427px;font-size:25px;" Value="Prosystem fx"/><apex:outputLabel style="position:fixed;left:585px;" value="®"/></b>
<b><apex:outputLabel style="position:fixed;font-size:25px;left:600px;" value="Renewal Notice"/></b>
<apex:outputLabel style="position:fixed;left:900px;" Value="Account #:"/>
<apex:outputText value="{!Apttus_Proposal__Proposal__c.AMS_Account_Number__c}" style="position:fixed;left:975px;"/>
<br/>
<apex:outputLabel style="position:fixed;left:900px;" Value="Order#:"></apex:outputLabel>
<apex:outputText value="{!Apttus_Proposal__Proposal__c.Contract_Number__c}" style="position:fixed;left:975px;"/>
<br/>
<BR/>
<apex:outputLabel style="position:fixed;left:250px;border:1px solid;" value="RENEW BY FAX:1-866-584-3582"/>
</body>
<br/>
<be/>
<apex:pageBlock >
<apex:pageBlockTable value="{!RenewalData}" var="Items">
<apex:Column value="{!Items.Product_Description__c}"/>
</apex:pageBlockTable>

</apex:pageBlock>
</apex:form>
</apex:page>