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
Sapana WSapana W 

Display radio button on a visualforce page to be rendered as pdf

Hi,

 

I want to create a VF page would be generated as pdf with "renderAs" attribute. Generated pdf should be the visual match of the source VF page(i.e it should display even radio button watsoever value is selected.) In my case the pdf page shows only the labels of radio button and not the actual circles  ( o ).  Basically I am displaying data from an object in dataTable with radio buttons adjacent to each row showing yes/no value. And in VF pdf  I want to show the value selected.Please guide me. 

 

(Note:Following code is just for source VF page out of which VF pdf would be generated with renderAs attribute)

 

<=============VF Page===========>

<apex:page controller="GreenCertificate" id="thePage">


<apex:dataTable value="{!items}" var="item" id="theTable" rowClasses="odd,even"

styleClass="tableClass" border="2">

<apex:facet name="caption">Online Criteria </apex:facet>

<apex:facet name="header">&nbsp;table header</apex:facet>

<apex:facet name="footer">table footer</apex:facet>

<apex:column >

<apex:facet name="header">Certfication Template Item</apex:facet>

<apex:facet name="footer">column footer</apex:facet>

<apex:outputText value="{!item.name}"/>

</apex:column>

<apex:column >

<apex:facet name="header">Certfication Template</apex:facet>

<apex:facet name="footer">column footer</apex:facet>

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

</apex:column>

<apex:column >

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

<apex:facet name="footer">column footer</apex:facet>

<apex:outputText value="{!item.Required__c}"/>

</apex:column>

</apex:dataTable>

</apex:page>

 

 

<=============Apex Controller===========>

 

public class GreenCertificate
{
String yesno = null;
public String getCreatePDF()
{
return null;
}
public PageReference CreatePDF()
{
return Page.GreenCertificatePDF;
}



public List<SelectOption> getYesOrNo() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('YES','Yes'));
options.add(new SelectOption('NO','No'));
return options;
}

public String getyesno()
{
return yesno;
}

public void setyesno(String yesno)
{
this.yesno = yesno;
}

 

List<Certfication_Template_Item__c> items;

 

public List<Certfication_Template_Item__c> getItems() {

if(items == null) items = [select name, Certfication_Template__r.Name, Required__c from Certfication_Template_Item__c where Required__c=true ];

return items;

}

}

 

Neha LundNeha Lund

Hi,

 

You need to pass the radio button's value to the new page

Sapana WSapana W

Hi,

 

I had passed radio button's value to the new page. But since its a dataTable it takes just the last saved value for all the rows of the table. I am not getting what I actually want.

Neha LundNeha Lund

Do you have any java script in your visual forvce page ? or are you taking input from the User?

Sapana WSapana W

No am not using javasript in my page. I am taking inputs from user and I want the selected radio button to be dispalyed in the PDF