Skip to main content
added 160 characters in body
Source Link
glls
  • 20.3k
  • 19
  • 49
  • 83

<aura:component implements="force:lightningQuickAction" >

<aura:attribute name="TTDLetter" type="object"/>

<lightning:button label="PDF" onclick="{!c.PDF}" /> </aura:component>

<aura:component implements="force:lightningQuickAction" >

   <!-- attribute to accept Visualforce page's javascript method -->
   <aura:attribute name="TTDLetter" type="object"/>

   <!-- Button component to invoke PDF download -->
   <lightning:button label="PDF" 
        onclick="{!c.PDF}" />
</aura:component>
<apex:page controller="MyController" renderAs="pdf" applyBodyTag="false">
<head>
<style>
body { font-family: 'Arial Unicode MS'; }

@page{
    size: letter;
    margin:10%;
    @top-left{
        content: "Dear,";
        font-family: Helvetica, Arial, sans-serif;
        font-size: 12px;
    }
    @bottom-right{
        content: "Yours Sincerely,";
        font-family: Helvetica, Arial, sans-serif;
        font-size: 10px;
    }
}

body {
        font-family: Helvetica, Arial, sans-serif;
        font-size: 11px;
}
    </style>
</head>
    <div align="right"><strong>Date</strong>: {!DAY(Today())} {!CASE(MONTH(Today()), 1, 'January', 2, 'February', 3, 'March', 4, 'April', 5, 'May', 6, 'June', 7, 'July', 8, 'August', 9, 'September', 10, 'October', 11, 'November', 12, 'December', 'Unknown')} {!YEAR(Today())}</div>
<center>
    <h1> Letter</h1>
    </center>
    <p>{!custom_object__C.Name__C}</p>    
</apex:page>
body{ font-family: 'Arial Unicode MS';}

@page{ size: letter; margin:10%; @top-left{ content: "Dear,"; font-family: Helvetica, Arial, sans-serif; font-size: 12px; } @bottom-right{ content: "Yours Sincerely,"; font-family: Helvetica, Arial, sans-serif; font-size: 10px; } }

body { font-family: Helvetica, Arial, sans-serif; font-size: 11px; }

Date:{!DAY(Today())}{!CASE(MONTH(Today()), 1, 'January', 2, 'February', 3, 'March', 4, 'April', 5, 'May', 6, 'June', 7, 'July', 8, 'August', 9, 'September', 10, 'October', 11, 'November', 12, 'December', 'Unknown')}{!YEAR(Today())}

Letter

{!custom_object__C.Name__C}

For the Lightning component If have created a quick action called "PDF", when I have clicked on PDF button from my object , I got a error stating : A Component Error has occurred!.

A Component Error has occurred!.

<aura:component implements="force:lightningQuickAction" >

<aura:attribute name="TTDLetter" type="object"/>

<lightning:button label="PDF" onclick="{!c.PDF}" /> </aura:component>

<apex:page controller="MyController" renderAs="pdf" applyBodyTag="false">
body{ font-family: 'Arial Unicode MS';}

@page{ size: letter; margin:10%; @top-left{ content: "Dear,"; font-family: Helvetica, Arial, sans-serif; font-size: 12px; } @bottom-right{ content: "Yours Sincerely,"; font-family: Helvetica, Arial, sans-serif; font-size: 10px; } }

body { font-family: Helvetica, Arial, sans-serif; font-size: 11px; }

Date:{!DAY(Today())}{!CASE(MONTH(Today()), 1, 'January', 2, 'February', 3, 'March', 4, 'April', 5, 'May', 6, 'June', 7, 'July', 8, 'August', 9, 'September', 10, 'October', 11, 'November', 12, 'December', 'Unknown')}{!YEAR(Today())}

Letter

{!custom_object__C.Name__C}

For the Lightning component If have created a quick action called "PDF", when I have clicked on PDF button from my object , I got a error stating : A Component Error has occurred!.

<aura:component implements="force:lightningQuickAction" >

   <!-- attribute to accept Visualforce page's javascript method -->
   <aura:attribute name="TTDLetter" type="object"/>

   <!-- Button component to invoke PDF download -->
   <lightning:button label="PDF" 
        onclick="{!c.PDF}" />
</aura:component>
<apex:page controller="MyController" renderAs="pdf" applyBodyTag="false">
<head>
<style>
body { font-family: 'Arial Unicode MS'; }

@page{
    size: letter;
    margin:10%;
    @top-left{
        content: "Dear,";
        font-family: Helvetica, Arial, sans-serif;
        font-size: 12px;
    }
    @bottom-right{
        content: "Yours Sincerely,";
        font-family: Helvetica, Arial, sans-serif;
        font-size: 10px;
    }
}

body {
        font-family: Helvetica, Arial, sans-serif;
        font-size: 11px;
}
    </style>
</head>
    <div align="right"><strong>Date</strong>: {!DAY(Today())} {!CASE(MONTH(Today()), 1, 'January', 2, 'February', 3, 'March', 4, 'April', 5, 'May', 6, 'June', 7, 'July', 8, 'August', 9, 'September', 10, 'October', 11, 'November', 12, 'December', 'Unknown')} {!YEAR(Today())}</div>
<center>
    <h1> Letter</h1>
    </center>
    <p>{!custom_object__C.Name__C}</p>    
</apex:page>

For the Lightning component If have created a quick action called "PDF", when I have clicked on PDF button from my object , I got a error stating :

A Component Error has occurred!.

Source Link
sf123
  • 37
  • 1
  • 11

Lightning component button not working

Below is my lightning component which calls a VF Page

<aura:component implements="force:lightningQuickAction" >

<aura:attribute name="TTDLetter" type="object"/>

<lightning:button label="PDF" onclick="{!c.PDF}" /> </aura:component>

My VF page

<apex:page controller="MyController" renderAs="pdf" applyBodyTag="false">
body { font-family: 'Arial Unicode MS'; }

@page{ size: letter; margin:10%; @top-left{ content: "Dear,"; font-family: Helvetica, Arial, sans-serif; font-size: 12px; } @bottom-right{ content: "Yours Sincerely,"; font-family: Helvetica, Arial, sans-serif; font-size: 10px; } }

body { font-family: Helvetica, Arial, sans-serif; font-size: 11px; }

Date: {!DAY(Today())} {!CASE(MONTH(Today()), 1, 'January', 2, 'February', 3, 'March', 4, 'April', 5, 'May', 6, 'June', 7, 'July', 8, 'August', 9, 'September', 10, 'October', 11, 'November', 12, 'December', 'Unknown')} {!YEAR(Today())}

Letter

{!custom_object__C.Name__C}

For the Lightning component If have created a quick action called "PDF", when I have clicked on PDF button from my object , I got a error stating : A Component Error has occurred!.

Can anyone just state me where I got my error as i got stuck here