How to generate a custom pdf for a report in Servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi All,
I have a report for the project table and now I want to extract a pdf from that report. The oob pdf is fine but client needs some changes on the field width and colors. I believe we cannot do those modifications on the oob template, so is there a way to generate a PDF for a report using Document Template?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
yes you can use your custom document template and generate and attach the PDF to the project record
you can check the PDF Generation API for this
Generating Custom PDFs - using the new PDFGenerationAPI
Also you can configure the document template and refer my blog on script to generate and attach the PDF
Generating and Attaching Document Templates in ServiceNow to Record - Server Side
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi @Debolina,
The recommended best practice for creating customized PDF with specific styling (colors, field widths, logos) is to create a UI Page or a Service Portal widget. This approach allows you to:
Use a script to fetch the same data that your report uses.
Render the data using standard HTML and CSS, giving you complete control over the layout and styling.
Include a button or link that uses a PDF generation library (either client-side like jsPDF or server-side APIs) to convert the styled HTML page into a downloadable PDF.
This method provides the flexibility you need while keeping the solution within the ServiceNow platform.
Hope this helps!
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution and helpful so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
See if you can edit the OOTB Document template configured on project table.
if you can then map it with the fields you want
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader