+ Start a Discussion
Daniel BleasdaleDaniel Bleasdale 

Page a021r00000hWJOKAA4 does not exist -- This is what I get when I try to use my Print function on my VF Page

Ive made a print function that I would like to use to print out my learning agreement form with all the data included but when I press print It says "Page a021r00000hWJOKAA4".

This is my page that the print buton is on -

User-added image
This is what shows up:-
User-added image
Here is my Print function in an Apex Extention :-
public class PrintableView
   public final Apprentice__c App;
   public PrintableView(ApexPages.StandardController stdController) {
        this.App = (Apprentice__c)stdController.getRecord();
  public Apprentice__c ApprenticeObj{get;set;}
  public Programme_Area__c ProgramArea {get;set;}
  public Boolean bolPrintableView {get;set;}
    public void init() {
   String strPrintableView = ApexPages.currentPage().getParameters().get('print');
   bolPrintableView = (strPrintableView == '1');
        Programme_Area__c ProgramArea = new Programme_Area__c();
        ProgramArea.PA_Code__c = '112';
    public PrintableView(){
        ApprenticeObj = new Apprentice__c();
        ProgramArea = new Programme_Area__c();

Here is my visual force page with the print function at the top -
<apex:page lightningStyleSheets="True" StandardController="Apprentice__c" extensions="PrintableView" title="Learning Agreement" showHeader="{!bolPrintableView}" sidebar="{!bolPrintableView}" action="{!init}">
    <apex:form >
    <apex:outputPanel rendered="{!NOT(bolPrintableView)}">
    <a href="{!$CurrentPage.parameters.id}/returl/?print=1" target="_blank">Printable View</a>

<apex:outputPanel rendered="{!bolPrintableView}">
     Apprenticeship: Learning Agreement <br />
                        This document forms a learning agreement between you and East Riding college. The College agrees to provide the resources necessary to achieve
                         your learning goals and you agree in turn to register for the appropriate qualification and to complete the programme of study which you <br /> have chosen. 
                         Please complete this document as fully as possible. Without your details, we cannot apply for the funding which allows 
                         us to run the course that you wish to study. Discuss any problems or uncertainties that you may have with staff and then finally sign and date the agreement.
        <apex:pageBlock >
         Learner ID :- <apex:inputField value="{! Apprentice__c.Learner_Reference_Number__c }"/>
            <apex:pageBlockSection columns="3">
                <apex:inputField value="{! Apprentice__c.Date_of_Birth__c}"/>
                <apex:inputField value="{! Apprentice__c.Surname__c}"/>
                <apex:inputField value="{! Apprentice__c.First_Name__c}"/>
                <apex:inputField value="{! Apprentice__c.Middle_Other_Names__c}"/>
                <apex:inputField value="{! Apprentice__c.Previous_Surname__c}"/>
                <apex:inputField value="{! Apprentice__c.Preferred__c}"/>
                <apex:inputField value="{! Apprentice__c.Gender__c}"/>
                <apex:inputField value="{! Apprentice__c.ULN__c}"/>
                <apex:inputField value="{! Apprentice__c.NI_Number__c}"/>
         <apex:pageBlock >
            <apex:pageBlockSection columns="2">
               <apex:inputField value="{! Apprentice__c.Address__c}"/>
               <apex:inputField value="{! Apprentice__c.Postcode__c}"/>
               <apex:inputField value="{! Apprentice__c.Mobile__c}"/>
               <apex:inputField value="{! Apprentice__c.Home_Phone__c}"/>
               <apex:inputField value="{! Apprentice__c.Alternative_Phone__c}"/>
               <apex:inputField value="{! Apprentice__c.Email__c}"/>
               <apex:inputField value="{! Apprentice__c.Emergency_Contact__c}"/>
               <apex:inputField value="{! Apprentice__c.Emergency_Contact_Phone__c}"/>
                <apex:inputField value="{! Apprentice__c.Emergency_Contact_Relationship__c}"/>
               <apex:inputField value="{! Apprentice__c.Parent_Guardian_Name__c}"/>
               <apex:inputField value="{! Apprentice__c.Parent_Guardian_Phone__c}"/>
               <H4>Reminder -</H4> If any of your details change during the year please inform the college. <br />
               <H4>Note -</H4> By providing your mobile no. you may recive SMS messages relevant to your course.
     <!--End of Personal Details Section-->
     <!--Country Of Residence-->
       <apex:pageBlock title="Country Of Residence">
            <apex:pageBlockSection >
                <apex:inputField value="{! Apprentice__c.Nationality__c}"/>
                <apex:inputField value="{! Apprentice__c.British_Citizen__c}"/>
                <apex:pageBlockSection >
                <apex:inputField value="{! Apprentice__c.Lived_In_England_Or_EEA_for_3_Years__c}"/>
                <apex:inputField value="{! Apprentice__c.If_no_date_of_entry_to_UK_or_EU__c}"/>
                <H5>*If you have answered NO to the question above please complete the following details and state date of entry into the UK or EU:</H5>
                <H5>*Please tick the relevant box if your passport indicates that your current status is any of the following:</H5>
                <apex:inputField value="{! Apprentice__c.Passport_Status__c}"/>
                <H5>Non-UK residents will be required to produce evidence of their current status (Passport or other official documentation e.g. visa details)</H5>
      <!--End of Country Of Residence-->
        <!--End of Ethnic Origin-->
        <apex:pageBlock title="Ethnic Origin">
            <apex:pageBlockSection >
                <apex:inputField value="{! Apprentice__c.Ethnicity__c}"/>
      <!--End of Ethnic Origin-->
      <!--Personal Needs-->
        <apex:pageBlock title="Personal Needs">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! Apprentice__c.Recorded_Disabilities__c}"/>
                <apex:inputField value="{! Apprentice__c.Learning_Difficulties__c}"/>
                <apex:inputField value="{! Apprentice__c.Other_Disabilities__c}"/>
      <!--End of Personal Needs-->
      <!--Prior Attainment-->
        <apex:pageBlock title="Prior Attainment">
            <apex:pageBlockSection columns="2" >
                <H5>Please select the level that corresponds with your highest qualification before coming to the College. </H5>
                <apex:inputField value="{! Apprentice__c.Highest_Previous_Attainment__c}"/>
      <!--End of Prior Attainment-->
      <!--Employment Information-->
        <apex:pageBlock title="Employment Information">
            <apex:pageBlockSection columns="4" >
                <H4>I am a New STARTER with this employer and have been recruited specifically to fill a new Apprenticeship vacancy.</H4>
                <apex:inputField value="{! Apprentice__c.Employer_Status_New_Starter__c}"/>
                <H4>My full-time contract started on</H4>
                <apex:inputField value="{! Apprentice__c.New_Start_Contract_Date__c}"/>
                <H4>I am an EXISTING EMPLOYEE that is moving up from part-time hours to fill a new Apprenticeship vacancy </H4>
                <apex:inputField value="{! Apprentice__c.Employer_Status_Existing_from_P_Time__c}"/>
                <H4>My full-time contract started on</H4>
                <apex:inputField value="{! Apprentice__c.Existing_Staff_New_Contract_Start__c}"/>
                <H4>I am an EXISTING EMPLOYEE that is changing job role to fill a new Apprenticeship Vacancy.</H4>
                <apex:inputField value="{! Apprentice__c.Employer_Status_Existing_from_Changing__c}"/>
                <H4>My full-time contract for the new job role started on</H4>
                <apex:inputField value="{! Apprentice__c.Existing_Staff_New_Job_Start__c}"/>
                <H4>I am an EXISTING EMPLOYEE full-time that is continuing with my current job role but require significant new knowledge and skills</H4>
                <apex:inputField value="{! Apprentice__c.Employer_Status_Existing_Development__c}"/>
                <H4>My approximate start date with this company was</H4>
                <apex:inputField value="{! Apprentice__c.Existing_Staff_Company_Start__c}"/>
      <!--Employment Information-->
      <!--Employment Status on the day ... -->
        <apex:pageBlock title="Employment Status on the day before you started your Apprenticeship">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! Apprentice__c.Pre_Apprenticeship_Employed_Hours__c}"/>
                <apex:inputField value="{! Apprentice__c.Seeking_Not_Seeking_Work__c}"/>
                <apex:inputField value="{! Apprentice__c.Previous_Employer__c}"/>
                <apex:inputField value="{! Apprentice__c.Not_employed_status_benefits__c}"/>
                <apex:inputField value="{! Apprentice__c.Period_Not_Employed__c}"/>
      <!--End of Employment Status on the day ... -->
      <!--At the start of my ... -->
        <apex:pageBlock title="At the start of my apprenticeship I will be Employed by">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! Apprentice__c.Employer_name__c}"/>
                <apex:inputField value="{! Apprentice__c.Employer_Address__c}"/> <!--Set As Address-->
                <apex:inputField value="{! Apprentice__c.Postcode__c}"/>
                <apex:inputField value="{! Apprentice__c.Hours_Worked_Per_Week__c}"/>
                <apex:inputField value="{! Apprentice__c.ERN__c}"/>
      <!--End of At the start of my ... -->
      <!--Enrolment Details 
        <apex:pageBlock title="Enrolment Details">
            <apex:pageBlockSection columns="2" >
      <!--End of Enrolment Details -->
       <!--Privacy Notice-->
        <apex:pageBlock title="PRIVACY NOTICE 2017/18">
            <apex:pageBlockSection columns="1" >
<h4>How We Use Your Personal Information</h4> 
This privacy notice is issued by the Education and Skills Funding Agency (ESFA), on behalf of the Secretary of State for the Department of Education (DfE). <br /> It is to inform learners how their personal information will be used by the DfE, the ESFA (an executive agency of the DfE) and any successor bodies to these organisations. <br /> For the purposes of relevant data protection legislation, the DfE is the data controller for personal data processed by the ESFA. <br /><br />
Your personal information is used by the DfE to exercise its functions and to meet its statutory responsibilities, including under the Apprenticeships, Skills, Children and Learning Act 2009 and to create and maintain a unique learner number (ULN) and a personal learning record (PLR). Your information will be securely destroyed after it is no longer required for these purposes. <br /><br />
Your information may be shared with third parties for education, training, employment and well-being related purposes, including for research. <br /> This will only take place where the law allows it and the sharing is in compliance with data protection legislation. <br /> The English European Social Fund (ESF) Managing Authority (or agents acting on its behalf) may contact you in order for them to carry out research and evaluation to inform the effectiveness of training. <br /><br />
You can agree to be contacted for other purposes by ticking any of the following boxes:
Further information about use of and access to your personal data, details of organisations with whom we regularly share data, information about how long we retain your data, and how to change your consent to being contacted, please visit:  https://goo.gl/0rwQMT
Any changes to the privacy notice will be published on Moodle (for current students) and the website (for applicants) as soon as they become available.  Please check for updates. 
<h4>Learning Records Service Privacy Notice</h4>

The information you supply will be used by the Education and Skills Funding Agency, an executive agency of the Department of Education (DfE), to issue you with a Unique Learner Number (ULN), and to create your Personal Learning Record. For more information about how your information is processed and shared refer to the Extended Privacy Notice available at: https://goo.gl/iOxSgJ 


Before accepting any place offered on a course, prospective students should be aware that the provision of an education service is subject to written terms and conditions of  contract. Such conditions include limiting the Colleges liability should industrial action or other circumstances prevent or interfere with the provision of services or cause the College to alter or rearrange any of the educational service offered. The College also reserves the right to withdraw any advertised class for which insufficient numbers of full fee paying students enrol and to close any class if low numbers attending make it no longer viable. 
The enrolment of a learner with a criminal record, caution or reprimand will depend upon the nature of the course and the details of any conviction or 
caution. If you are convicted of a criminal offence, after you have enrolled, you let us know immediately. If you are not sure whether to tell us about a previous conviction you can get more advice from Learner Services.
The College is bound by relevant data protection legislation and your data and image will be stored in accordance with these regulations. 

<h4>LEARNING AGREEMENT DECLARATIONS - My signature below indicates that:</h4>
- I confirm that all the information on this form is correct and that I have declared all of my current qualifications. I understand that if I have declared false information the College may take action against me to reclaim the tuition fees and any support costs incurred.
- I intend to follow the programme of study as specified by the qualifications listed. I have discussed the programme with relevant staff and understand the entry requirements and progression routes offered by the course, its suitability to my needs, the workload required of me and any financial or 
       learning support which may be available during my studies.
- I agree to be responsible for the payment of tuition, registration and examination fees (as applicable) by the due date and any additional costs should I make a late entry.  I accept liability for any examination or registration fees should I fail to attend or complete my programme.  
- I will comply with all College Rules and Regulations and any other regulations specific to my chosen programme.
- All Apprentice Learners: I am aware that in addition to the main qualification detailed on this form, my Apprenticeship Programme will incorporate other elements which may include Maths and/or English skills development; and other Qualifications and non-Qualification activities. These will be agreed and recorded in my learning plan. <h5> I understand that I will be required to attend all sessions. </h5>
<h5> I am aware of the College’s fees and charges policy (available on the website or on reception). </h5>

        <!--End of Privacy Notice-->
        <apex:pageBlock >
      <!--End of Save/Cancel-->
    <!--End of Table-->     

From my understanding this is what pulls up the page with the data in <a href="{!$CurrentPage.parameters.id}/returl/?print=1" target="_blank">Printable View</a> but it wont show me a page?

Thanks for any and all help. An explanation as to what I must do would be much appreciated.

Thanks Dan
Raj VakatiRaj Vakati
What is the developer name of your visualforce page  

go to setup --Develope --> Visualforce Pages you can able to find the name of the page and label 

use this URL 

Daniel BleasdaleDaniel Bleasdale
<apex:outputPanel rendered="{!NOT(bolPrintableView)}">
    <a href="/apex/Apprentice?print=1" target="_blank">Printable View</a>
This openes the page in a printable view but it still wont pull the data through like I need it to. Do I need to make another page?

User-added image
User-added image
Also If i was to format how the printable view looked would that mean I would need a different page.