Export tickets to pdf - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
VBH service engineersVBH service engineers 

Export tickets to pdf

Hi all,

We want to export tickets to PDF. The reason is that we dont have internet everywhere. I cant find ant setting or soloution online for this. Does somebody know an easy way?
Amit TrivediAmit Trivedi
Hi,

There are many options like
1)Create vf page and render as pdf and then export.
2)Use conga composer an app exchange app.see below link
http://www.congamerge.com/use-cases/examples/pdf-forms

Thanks,
Amit Trivedi
 
Karthikeyan ChandranKarthikeyan Chandran
Hi VBH service engineers,

Here the Knowledge Article - How to export data in Excel or PDF format using Visualforce

Description
- Almost all Salesforce objects can be retrieved in Excel format via the standard reporting interface
- The same report could be printed as a PDF using PDF-generating software on the client's PC
- If you cannot export data using the standard reporting interface, contact your Salesforce administrator

- There may be a requirement to generate lists of Salesforce data outside of the standard reporting interface
- This is possible using simple Visualforce code
- The Visualforce page can use the <apex:column> tag to repeat over SObject or custom wrapper class rows
- The <apex:page> tag should use showHeader="false" renderAs="pdf" orcontentType="application/vnd.ms-excel#SalesForceExport.xls", depending on whether you want a PDF or Excel file

- Below is some sample code that loops over Contact ID and Name fields
- This code is not considered production quality and should be subjected to your full development life-cycle, including UAT 

Resolution
 
=========================================================
To Download PDF VISUALFORCE Page
=========================================================

<apex:page controller="contactquery" showHeader="false" renderAs="pdf">
    <apex:pageBlock title="Export Results" >
        <apex:pageBlockTable value="{!cs}" var="contact">
            <apex:column value="{!contact.ID}"/>
            <apex:column value="{!contact.Name}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

=========================================================
Download Excel VISUALFORCE Page
=========================================================

<apex:page controller="contactquery" contentType="application/vnd.ms-excel#SalesForceExport.xls" cache="true">
    <apex:pageBlock title="Export Results" >
        <apex:pageBlockTable value="{!cs}" var="contact">
            <apex:column value="{!contact.ID}"/>
            <apex:column value="{!contact.Name}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

=========================================================
Query Controller (Query the data you need)
=========================================================

public class contactquery{
    public List<Contact> cs{get; set;}
    public contactquery()
    {
    cs = new List<Contact>();
       for (Contact c : [Select id, Name from Contact])
       {       
           cs.add(c);
       }
    }
}
Thanks & Regards,
Karthikeyan Chandran
+91-9944676540
VBH service engineersVBH service engineers
We use salesforce as a ticket system : Are the steps the same ? Can you maybe explain it in more detail how this works ? Thnx
Karthikeyan ChandranKarthikeyan Chandran
What tickecting system you are using here?
Karthikeyan ChandranKarthikeyan Chandran
Teckets are created using "Case" or some other Applications like "Remedyforce"
VBH service engineersVBH service engineers
Correct we have an option  to create tickets with the Tikcets (Cases) button
Karthikeyan ChandranKarthikeyan Chandran
From where you want to print as pdf, each record detail page or under the case report.

If you want to do each record go for the above VF page. from case report there is no standard funtionality in salesforce it's under product team review -  Ability to Print Reports to PDF (https://success.salesforce.com/ideaView?id=08730000000BqCDAA0) .

After run the report, you can print reports using the option "Ctrl + P" from your keyboard and save the file as pdf in the computer.