{"id":4441,"date":"2025-01-02T17:17:18","date_gmt":"2025-01-02T09:17:18","guid":{"rendered":"https:\/\/five.co\/?p=4441"},"modified":"2025-04-16T09:55:18","modified_gmt":"2025-04-16T01:55:18","slug":"generate-pdf-from-sql-database","status":"publish","type":"post","link":"https:\/\/preview-php85.dzine.org\/five\/blog\/generate-pdf-from-sql-database\/","title":{"rendered":"How to Generate PDF Files from a SQL Database"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"learn-how-to-generate-a-pdf-report-on-a-my-sql-database\">Learn How to Generate PDF Files from a SQL Database<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">PDF reports are an integral part of almost every business process. Typical use cases are, for example, quotations, invoices or KPI reports. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To generate a PDF file from an SQL database, all it takes are three steps: (1) create an SQL database, (2) design a dynamic PDF report, and (3) publish your PDF report to the web.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For this tutorial, we use Five, an application development environment with a built-in SQL database modeler, and an integrated PDF report generator. Make sure to <a href=\"https:\/\/preview-php85.dzine.org\/five\/get-started\/\" target=\"_blank\" rel=\"noreferrer noopener\">sign up for free<\/a> to follow along.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<div class=\"root-eb-toc-61p75sp wp-block-essential-blocks-table-of-contents\"><div class=\"eb-parent-wrapper eb-parent-eb-toc-61p75sp \"><div class=\"eb-toc-container eb-toc-61p75sp  eb-toc-is-not-sticky eb-toc-not-collapsible eb-toc-initially-not-collapsed eb-toc-scrollToTop style-1 list-style-none\" data-scroll-top=\"false\" data-scroll-top-icon=\"fas fa-angle-up\" data-collapsible=\"false\" data-sticky-hide-mobile=\"false\" data-sticky=\"false\" data-scroll-target=\"scroll_to_toc\" data-copy-link=\"false\" data-editor-type=\"\" data-hide-desktop=\"false\" data-hide-tab=\"false\" data-hide-mobile=\"false\" data-itemcollapsed=\"false\" data-highlight-scroll=\"false\"><div class=\"eb-toc-header\"><h2 class=\"eb-toc-title\">Table of Contents<\/h2><\/div><div class=\"eb-toc-wrapper \" data-headers=\"[{&quot;level&quot;:2,&quot;content&quot;:&quot;Learn How to Generate PDF Files from a SQL Database&quot;,&quot;text&quot;:&quot;Learn How to Generate PDF Files from a SQL Database&quot;,&quot;link&quot;:&quot;learn-how-to-generate-pdf-files-from-a-sql-database&quot;},{&quot;level&quot;:2,&quot;content&quot;:&quot;Using Five to Generate PDF Files from a SQL Database&quot;,&quot;text&quot;:&quot;Using Five to Generate PDF Files from a SQL Database&quot;,&quot;link&quot;:&quot;using-five-to-generate-pdf-files-from-a-sql-database&quot;},{&quot;level&quot;:2,&quot;content&quot;:&quot;Example: Generating PDF Files on A SQL Database&quot;,&quot;text&quot;:&quot;Example: Generating PDF Files on A SQL Database&quot;,&quot;link&quot;:&quot;example-generating-pdf-files-on-a-sql-database&quot;},{&quot;level&quot;:2,&quot;content&quot;:&quot;Free Online Quotation Generator&quot;,&quot;text&quot;:&quot;Free Online Quotation Generator&quot;,&quot;link&quot;:&quot;free-online-quotation-generator&quot;},{&quot;level&quot;:3,&quot;content&quot;:&quot;1. Creating the SQL Database&quot;,&quot;text&quot;:&quot;1. Creating the SQL Database&quot;,&quot;link&quot;:&quot;1-creating-the-sql-database&quot;},{&quot;level&quot;:3,&quot;content&quot;:&quot;2. Creating PDF File on a SQL Database&quot;,&quot;text&quot;:&quot;2. Creating PDF File on a SQL Database&quot;,&quot;link&quot;:&quot;2-creating-pdf-file-on-a-sql-database&quot;},{&quot;level&quot;:3,&quot;content&quot;:&quot;3. Preview your PDF File&quot;,&quot;text&quot;:&quot;3. Preview your PDF File&quot;,&quot;link&quot;:&quot;3-preview-your-pdf-file&quot;},{&quot;level&quot;:2,&quot;content&quot;:&quot;Generate PDF from a MySQL Database - Webinar&quot;,&quot;text&quot;:&quot;Generate PDF from a MySQL Database - Webinar&quot;,&quot;link&quot;:&quot;generate-pdf-from-a-mysql-database-webinar&quot;},{&quot;level&quot;:2,&quot;content&quot;:&quot;Get Help&quot;,&quot;text&quot;:&quot;Get Help&quot;,&quot;link&quot;:&quot;get-help&quot;},{&quot;level&quot;:2,&quot;content&quot;:&quot;Generate a PDF File on a SQL Database: Getting Started&quot;,&quot;text&quot;:&quot;Generate a PDF File on a SQL Database: Getting Started&quot;,&quot;link&quot;:&quot;generate-a-pdf-file-on-a-sql-database-getting-started&quot;}]\" data-visible=\"[true,true,true,true,true,true]\" data-delete-headers=\"[{&quot;label&quot;:&quot;Learn How to Generate PDF Files from a SQL Database&quot;,&quot;value&quot;:&quot;learn-how-to-generate-pdf-files-from-a-sql-database&quot;,&quot;isDelete&quot;:true},{&quot;label&quot;:&quot;Using Five to Generate PDF Files from a SQL Database&quot;,&quot;value&quot;:&quot;using-five-to-generate-pdf-files-from-a-sql-database&quot;,&quot;isDelete&quot;:false},{&quot;label&quot;:&quot;Example: Generating PDF Files on A SQL Database&quot;,&quot;value&quot;:&quot;example-generating-pdf-files-on-a-sql-database&quot;,&quot;isDelete&quot;:false},{&quot;label&quot;:&quot;Free Online Quotation Generator&quot;,&quot;value&quot;:&quot;free-online-quotation-generator&quot;,&quot;isDelete&quot;:false},{&quot;label&quot;:&quot;1. Creating the SQL Database&quot;,&quot;value&quot;:&quot;1-creating-the-sql-database&quot;,&quot;isDelete&quot;:false},{&quot;label&quot;:&quot;2. Creating PDF File on a SQL Database&quot;,&quot;value&quot;:&quot;2-creating-pdf-file-on-a-sql-database&quot;,&quot;isDelete&quot;:false},{&quot;label&quot;:&quot;3. Preview your PDF File&quot;,&quot;value&quot;:&quot;3-preview-your-pdf-file&quot;,&quot;isDelete&quot;:false},{&quot;label&quot;:&quot;Generate PDF from a MySQL Database - Webinar&quot;,&quot;value&quot;:&quot;generate-pdf-from-a-mysql-database-webinar&quot;,&quot;isDelete&quot;:false},{&quot;label&quot;:&quot;Get Help&quot;,&quot;value&quot;:&quot;get-help&quot;,&quot;isDelete&quot;:false},{&quot;label&quot;:&quot;Generate a PDF File on a SQL Database: Getting Started&quot;,&quot;value&quot;:&quot;generate-a-pdf-file-on-a-sql-database-getting-started&quot;,&quot;isDelete&quot;:false}]\" data-smooth=\"true\" data-top-offset=\"\"><div class=\"eb-toc__list-wrap\"><ul class=\"eb-toc__list\"><li><a href=\"#using-five-to-generate-pdf-files-from-a-sql-database\">Using Five to Generate PDF Files from a SQL Database<\/a><li><a href=\"#example-generating-pdf-files-on-a-sql-database\">Example: Generating PDF Files on A SQL Database<\/a><li><a href=\"#free-online-quotation-generator\">Free Online Quotation Generator<\/a><ul class=\"eb-toc__list\"><li><a href=\"#1-creating-the-sql-database\">1. Creating the SQL Database<\/a><li><a href=\"#2-creating-pdf-file-on-a-sql-database\">2. Creating PDF File on a SQL Database<\/a><li><a href=\"#3-preview-your-pdf-file\">3. Preview your PDF File<\/a><\/li><\/ul><li><a href=\"#generate-pdf-from-a-mysql-database-webinar\">Generate PDF from a MySQL Database &#8211; Webinar<\/a><li><a href=\"#get-help\">Get Help<\/a><li><a href=\"#generate-a-pdf-file-on-a-sql-database-getting-started\">Generate a PDF File on a SQL Database: Getting Started<\/a><\/ul><\/div><\/div><\/div><\/div><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"using-five-to-generate-pdf-data-reports-on-my-sql\">Using Five to Generate PDF Files from a SQL Database<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Generating a PDF file from data stored in a SQL database is a common development task. Traditional SQL admin tools or GUIs, however, do not support PDF report generation. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Five is a rapid application development environment that supports database creation, SQL queries, and PDF report generation. It also comes with many other useful features to build a web app such as forms, charts, dashboards, etc. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s explore how we can go from a SQL database to a PDF file in a few simple steps. <\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Example: Generating PDF Files on A SQL Database<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Here is an example of an <a href=\"https:\/\/default-quotegenerator-tryfive.5au.co\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">online quotation generator<\/a> developed in Five. This template app is available when you sign up for one of <a href=\"https:\/\/preview-php85.dzine.org\/five\/pricing\" target=\"_blank\" rel=\"noreferrer noopener\">Five&#8217;s subscription plans<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The quotation generator is running on a custom SQL database, created and maintained in Five. It generates a standardized quotation PDF, including bill-to and ship-to addresses, or quotation line items.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To try out the report generator template, click <strong>Quotations <\/strong>in the menu on the left, select an existing quotation or create a new one, and then click the <strong>Generate PDF <\/strong>button. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Five generates the PDF inside the web app, and users can download the PDF. <\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column has-background is-layout-flow wp-block-column-is-layout-flow\" style=\"background-color:#001524\">\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-center has-text-color has-link-color wp-elements-0c07ba43ca245fa891aa6020d1376529\" style=\"color:#f1ebda\">Free Online Quotation Generator<\/h2>\n\n\n\n<div class=\"wp-block-essential-blocks-button  root-eb-button-xzxsg\"><div class=\"eb-parent-wrapper eb-parent-eb-button-xzxsg \"><div class=\"eb-button-wrapper eb-button-alignment eb-button-xzxsg\"><div class=\"eb-button\"><a class=\"eb-button-anchor\" href=\"https:\/\/default-quotegenerator-tryfive.5au.co\/\" target=\"_blank\" rel=\"noopener nofollow\"><strong>Preview the Template App<\/strong><\/a><\/div><\/div><\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img width=\"1024\" height=\"506\" src=\"https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2024\/07\/image-16-1024x506.png\" alt=\"\" class=\"wp-image-3428\" srcset=\"https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2024\/07\/image-16-1024x506.png 1024w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2024\/07\/image-16-300x148.png 300w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2024\/07\/image-16-768x380.png 768w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2024\/07\/image-16-1536x760.png 1536w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2024\/07\/image-16-2048x1013.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<\/div>\n<\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Building a web app that turns form inputs into a PDF file stored inside a database is a straightforward exercise in Five.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s a simple scenario: your business needs a new monthly inventory report (yet again). Let&#8217;s check out how quickly we can build this in Five.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-creating-the-my-sql-database\">1. Creating the SQL Database<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">First up, Five gives developers a <strong>dedicated MySQL database<\/strong>. This built-in MySQL can be created using Five&#8217;s <strong>Table Wizard<\/strong> or its visual <strong>Database Modeler<\/strong>. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We will generate our report on top of this integrated MySQL database. Of course, a report can also be generated on <strong>any external, pre-existing relational database<\/strong>. To use your existing database, connect it to Five, <a href=\"https:\/\/help.five.org\/2.7\/docs\/data\/databases\/add-manage-databases\/#connection-string-details\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">using a connection string.<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s what our database looks like for this example. We have a single table that stores information about Warehouses. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img width=\"1024\" height=\"464\" src=\"https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-6-1024x464.png\" alt=\"Five.Co - Visual MySQL Database Modeler\" class=\"wp-image-1795\" srcset=\"https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-6-1024x464.png 1024w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-6-300x136.png 300w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-6-768x348.png 768w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-6-1536x696.png 1536w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-6.png 1688w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To create this database, follow these steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/preview-php85.dzine.org\/five\/get-started\/\">Sign up for Five.<\/a><\/li>\n\n\n\n<li>Login to Five and create a new application by clicking on <strong>Applications<\/strong>. <\/li>\n\n\n\n<li>Next, click the yellow <strong>Plus button<\/strong>. <\/li>\n\n\n\n<li>Give your application a <strong>Title<\/strong>, and click on the <strong>Tick <\/strong>mark in the top right corner to save your first app.<\/li>\n\n\n\n<li>Now click on the blue <strong>Manage <\/strong>button in the top right corner.<\/li>\n\n\n\n<li>Next, click on <strong>Data &gt; Table Wizard<\/strong>.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">If you are struggling with any of these steps, here is a video tutorial:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Code-Along Training Session | Rapid Application Development | Five.Co\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/48T8DqA6ACw?start=541&#038;feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-creating-the-pdf-report-on-a-sql-database\">2. Creating PDF File on a SQL Database<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Next, click on<strong> Visual &gt; Reports.<\/strong> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can now manage how your PDF file will look. Five lets you create PDF reports on <em>any <\/em>data source, including its built-in MySQL database, any SQL query, or any external database connected to Five.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img width=\"341\" height=\"591\" src=\"https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-7.png\" alt=\"Five.Co - Visual &gt; Reports\" class=\"wp-image-1796\" style=\"width:174px;height:301px\" srcset=\"https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-7.png 341w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-7-173x300.png 173w\" sizes=\"(max-width: 341px) 100vw, 341px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Inside <strong>Reports,<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Click the yellow <strong>Plus <\/strong>icon to generate a new report.<\/li>\n\n\n\n<li>Give your report a <strong>Title, <\/strong>such as a <strong>Warehouse Report.<\/strong><\/li>\n\n\n\n<li>Click on <strong>Data Sources<\/strong>, and select the <strong>Warehouse Table.<\/strong><\/li>\n\n\n\n<li>Go back to <strong>General, <\/strong>and click on <strong>Click to add <\/strong>in the <strong>Template<\/strong> field.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">You are now inside a rich text editor that lets you design PDF files. You can do so in Five&#8217;s text editor, or by using code (HTML and CSS). The report generator also lets you select any data field from your database or data source. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, you can add a table to a report that contains each field stored inside the warehouse database table. To do so, <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Add a table to the rich text editor by clicking the <strong>Table <\/strong>icon. Choose a 3 x 2 table, because the warehouse table only has two data fields: Location and ID. <\/li>\n\n\n\n<li>Next, open up the <strong>Insert Fields<\/strong> functionality shown here:<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img width=\"1024\" height=\"248\" src=\"https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-9-1024x248.png\" alt=\"Five.Co - Inserting Fields from MySQL to the Report\" class=\"wp-image-1798\" srcset=\"https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-9-1024x248.png 1024w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-9-300x73.png 300w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-9-768x186.png 768w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-9-1536x371.png 1536w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-9.png 1688w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">You can use the <strong>Insert Fields<\/strong> functionality to add your database captions and records to the PDF document. Here&#8217;s how to set this up:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img width=\"1024\" height=\"621\" src=\"https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-8-1024x621.png\" alt=\"Five.Co - Inserting Fields from MySQL to the Report Layout\" class=\"wp-image-1797\" srcset=\"https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-8-1024x621.png 1024w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-8-300x182.png 300w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-8-768x465.png 768w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-8-1536x931.png 1536w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-8.png 1688w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s understand what we are doing here:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>We are using one of Five&#8217;s helper functions: the built-in <em>each <\/em>function, which tells Five to get each record stored in the database.<\/li>\n\n\n\n<li>At the bottom, we choose the fields that we would like to include in our report. In our case, we&#8217;re choosing our Warehouse SQL table as the data source, and we pick the records of our location and ID fields.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">If you don&#8217;t enjoy working with the rich text editor, you can design your PDF report in HTML and CSS. To understand how this works, copy this piece of HTML into the code view of the report generator. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the code view by clicking on <strong>&lt;\/&gt;<\/strong> in the top left corner of the report generator. <\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282c34\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"<div&gt;<strong&gt;Warehouse Report<\/strong&gt;<\/div&gt;\n<div&gt;<strong&gt;<br&gt;<\/strong&gt;<\/div&gt;\n<div&gt;<strong&gt;<br&gt;<\/strong&gt;<\/div&gt;\n<table style=&quot;width: 100%;&quot;&gt;\n    <tbody&gt;\n        <tr&gt;\n            <td&gt;Location<\/td&gt;\n            <td&gt;ID<\/td&gt;\n        <\/tr&gt;\n        <tr class=&quot;fiveReportHelper&quot; contenteditable=&quot;false&quot;&gt;\n            <td class=&quot;fiveReportHelper&quot;&gt;{{#each @root.[Warehouse].[Records] as | Warehouse |}}<\/td&gt;\n        <\/tr&gt;\n        <tr&gt;\n            <td&gt;{{Warehouse.[Location]}}<\/td&gt;\n            <td&gt;{{Warehouse.[ID]}}<\/td&gt;\n        <\/tr&gt;\n        <tr&gt;\n            <td&gt;{{\/each}}<\/td&gt;\n            <td&gt;<br&gt;<\/td&gt;\n        <\/tr&gt;\n    <\/tbody&gt;\n<\/table&gt;\n<div&gt;<strong&gt;<br&gt;<\/strong&gt;<\/div&gt;\n<div&gt;<strong&gt;<br&gt;<\/strong&gt;<\/div&gt;\" style=\"color:#abb2bf;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki one-dark-pro\" style=\"background-color: #282c34\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #ABB2BF\">&lt;<\/span><span style=\"color: #E06C75\">div<\/span><span style=\"color: #ABB2BF\">&gt;&lt;<\/span><span style=\"color: #E06C75\">strong<\/span><span style=\"color: #ABB2BF\">&gt;Warehouse Report&lt;\/<\/span><span style=\"color: #E06C75\">strong<\/span><span style=\"color: #ABB2BF\">&gt;&lt;\/<\/span><span style=\"color: #E06C75\">div<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">&lt;<\/span><span style=\"color: #E06C75\">div<\/span><span style=\"color: #ABB2BF\">&gt;&lt;<\/span><span style=\"color: #E06C75\">strong<\/span><span style=\"color: #ABB2BF\">&gt;&lt;<\/span><span style=\"color: #E06C75\">br<\/span><span style=\"color: #ABB2BF\">&gt;&lt;\/<\/span><span style=\"color: #E06C75\">strong<\/span><span style=\"color: #ABB2BF\">&gt;&lt;\/<\/span><span style=\"color: #E06C75\">div<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">&lt;<\/span><span style=\"color: #E06C75\">div<\/span><span style=\"color: #ABB2BF\">&gt;&lt;<\/span><span style=\"color: #E06C75\">strong<\/span><span style=\"color: #ABB2BF\">&gt;&lt;<\/span><span style=\"color: #E06C75\">br<\/span><span style=\"color: #ABB2BF\">&gt;&lt;\/<\/span><span style=\"color: #E06C75\">strong<\/span><span style=\"color: #ABB2BF\">&gt;&lt;\/<\/span><span style=\"color: #E06C75\">div<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">&lt;<\/span><span style=\"color: #E06C75\">table<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #D19A66\">style<\/span><span style=\"color: #ABB2BF\">=<\/span><span style=\"color: #98C379\">&quot;width: 100%;&quot;<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">    &lt;<\/span><span style=\"color: #E06C75\">tbody<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">        &lt;<\/span><span style=\"color: #E06C75\">tr<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">            &lt;<\/span><span style=\"color: #E06C75\">td<\/span><span style=\"color: #ABB2BF\">&gt;Location&lt;\/<\/span><span style=\"color: #E06C75\">td<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">            &lt;<\/span><span style=\"color: #E06C75\">td<\/span><span style=\"color: #ABB2BF\">&gt;ID&lt;\/<\/span><span style=\"color: #E06C75\">td<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">        &lt;\/<\/span><span style=\"color: #E06C75\">tr<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">        &lt;<\/span><span style=\"color: #E06C75\">tr<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #D19A66\">class<\/span><span style=\"color: #ABB2BF\">=<\/span><span style=\"color: #98C379\">&quot;fiveReportHelper&quot;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #D19A66\">contenteditable<\/span><span style=\"color: #ABB2BF\">=<\/span><span style=\"color: #98C379\">&quot;false&quot;<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">            &lt;<\/span><span style=\"color: #E06C75\">td<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #D19A66\">class<\/span><span style=\"color: #ABB2BF\">=<\/span><span style=\"color: #98C379\">&quot;fiveReportHelper&quot;<\/span><span style=\"color: #ABB2BF\">&gt;{{#each @root.[Warehouse].[Records] as | Warehouse |}}&lt;\/<\/span><span style=\"color: #E06C75\">td<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">        &lt;\/<\/span><span style=\"color: #E06C75\">tr<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">        &lt;<\/span><span style=\"color: #E06C75\">tr<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">            &lt;<\/span><span style=\"color: #E06C75\">td<\/span><span style=\"color: #ABB2BF\">&gt;{{Warehouse.[Location]}}&lt;\/<\/span><span style=\"color: #E06C75\">td<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">            &lt;<\/span><span style=\"color: #E06C75\">td<\/span><span style=\"color: #ABB2BF\">&gt;{{Warehouse.[ID]}}&lt;\/<\/span><span style=\"color: #E06C75\">td<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">        &lt;\/<\/span><span style=\"color: #E06C75\">tr<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">        &lt;<\/span><span style=\"color: #E06C75\">tr<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">            &lt;<\/span><span style=\"color: #E06C75\">td<\/span><span style=\"color: #ABB2BF\">&gt;{{\/each}}&lt;\/<\/span><span style=\"color: #E06C75\">td<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">            &lt;<\/span><span style=\"color: #E06C75\">td<\/span><span style=\"color: #ABB2BF\">&gt;&lt;<\/span><span style=\"color: #E06C75\">br<\/span><span style=\"color: #ABB2BF\">&gt;&lt;\/<\/span><span style=\"color: #E06C75\">td<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">        &lt;\/<\/span><span style=\"color: #E06C75\">tr<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">    &lt;\/<\/span><span style=\"color: #E06C75\">tbody<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">&lt;\/<\/span><span style=\"color: #E06C75\">table<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">&lt;<\/span><span style=\"color: #E06C75\">div<\/span><span style=\"color: #ABB2BF\">&gt;&lt;<\/span><span style=\"color: #E06C75\">strong<\/span><span style=\"color: #ABB2BF\">&gt;&lt;<\/span><span style=\"color: #E06C75\">br<\/span><span style=\"color: #ABB2BF\">&gt;&lt;\/<\/span><span style=\"color: #E06C75\">strong<\/span><span style=\"color: #ABB2BF\">&gt;&lt;\/<\/span><span style=\"color: #E06C75\">div<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ABB2BF\">&lt;<\/span><span style=\"color: #E06C75\">div<\/span><span style=\"color: #ABB2BF\">&gt;&lt;<\/span><span style=\"color: #E06C75\">strong<\/span><span style=\"color: #ABB2BF\">&gt;&lt;<\/span><span style=\"color: #E06C75\">br<\/span><span style=\"color: #ABB2BF\">&gt;&lt;\/<\/span><span style=\"color: #E06C75\">strong<\/span><span style=\"color: #ABB2BF\">&gt;&lt;\/<\/span><span style=\"color: #E06C75\">div<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Save everything by clicking the <strong>Tick <\/strong>marks. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>IMPORTANT: <\/strong>Don&#8217;t forget to add your report to the menu of your application. <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Click on <strong>Visual &gt; Menus &gt; Yellow Plus Icon<\/strong><\/li>\n\n\n\n<li>Fill in the <strong>Caption<\/strong> of your menu item with <strong>Warehouse Report<\/strong>.<\/li>\n\n\n\n<li>Select the WarehouseReport (Report) in <strong>the Action drop-down field.<\/strong><\/li>\n\n\n\n<li>Save.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-preview-your-pdf-report\">3. Preview your PDF File<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To preview your PDF report that now turns the data stored in your SQL database into an easy-to-use, printable, and shareable PDF document, launch your application by clicking the \u25b6\ufe0f button in the top right corner of your development environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After a few seconds, the application will launch, and you&#8217;ll see your PDF report right in front of you!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You might be wondering why this report is empty. Well, we didn&#8217;t add any data to our database table. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But of course, we could have done so by importing a CSV, or by creating a form in our application for users to add data. You can quickly add a form to your app using Five&#8217;s Form Wizard, which can be found inside the development environment by clicking on <strong>Visual &gt; Form Wizard.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img width=\"1024\" height=\"647\" src=\"https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-10-1024x647.png\" alt=\"Five.Co - Previewing the MySQL Report\" class=\"wp-image-1799\" srcset=\"https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-10-1024x647.png 1024w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-10-300x190.png 300w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-10-768x485.png 768w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-10-1536x971.png 1536w, https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2023\/10\/image-10.png 1688w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Last, we could have spent more time on the formatting of our SQL report (and the look of the application surrounding it) by using the rich text editor or by customizing Five&#8217;s application themes. <\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"generate-pdf-from-a-my-sql-database-webinar\">Generate PDF from a MySQL Database &#8211; Webinar<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Watch our Developer Advocate Pranoy explain the PDF report generator in more detail in our full product demo here (to jump straight to the SQL report writer start watching from 21m and 40s):<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Five Demo  | Low-Code For Real Developers | Five.Co\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/Ex4o-6yY-fc?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Get Help<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you are struggling with generating your PDF file, <a href=\"https:\/\/preview-php85.dzine.org\/five\/hire-an-expert\/\">connect with us here<\/a>. Our team of in-house experts can help you with:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Your database model;<\/li>\n\n\n\n<li>Your application design; and<\/li>\n\n\n\n<li>Your PDF report design.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-get-started\">Generate a PDF File on a SQL Database: Getting Started<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Sign up for free and get started with Five.<\/p>\n\n\n\n<div style=\"background-color: #001524;\"><hr style=\"height: 5px;\" \/>\n<pre style=\"text-align: center; overflow: hidden; white-space: pre-line;\"><span style=\"color: #f1ebda; background-color: #4588d8; font-size: calc(18px + 0.390625vw);\"><strong>Sign Up Today<\/strong><br \/><span style=\"font-size: 14pt;\">Generate PDF Files on a SQL Database<\/span><\/span><\/pre>\n<p style=\"text-align: center;\"><a href=\"https:\/\/preview-php85.dzine.org\/five\/get-started\/\" target=\"_blank\" rel=\"noopener\"><button style=\"background-color: #f8b92b; border: none; color: black; padding: 20px; text-align: center; text-decoration: none; display: inline-block; font-size: 18px; cursor: pointer; margin: 4px 2px; border-radius: 5px;\"><strong>Free Sign Up<\/strong><\/button><br \/><\/a><\/p>\n<hr style=\"height: 5px;\" \/><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Learn How to Generate PDF Files from a SQL Database PDF reports are an integral part of almost every business process. Typical use cases are, for example, quotations, invoices or KPI reports. To generate a PDF file from an SQL database, all it takes are three steps: (1) create an SQL database, (2) design a [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":4442,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_eb_attr":"","_uag_custom_page_level_css":"","footnotes":""},"categories":[21],"tags":[],"class_list":["post-4441","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"uagb_featured_image_src":{"full":["https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2025\/01\/Five.Co-Generate-a-PDF-File-from-SQL.jpg",1280,720,false],"thumbnail":["https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2025\/01\/Five.Co-Generate-a-PDF-File-from-SQL-150x150.jpg",150,150,true],"medium":["https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2025\/01\/Five.Co-Generate-a-PDF-File-from-SQL-300x169.jpg",300,169,true],"medium_large":["https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2025\/01\/Five.Co-Generate-a-PDF-File-from-SQL-768x432.jpg",768,432,true],"large":["https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2025\/01\/Five.Co-Generate-a-PDF-File-from-SQL-1024x576.jpg",1024,576,true],"1536x1536":["https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2025\/01\/Five.Co-Generate-a-PDF-File-from-SQL.jpg",1280,720,false],"2048x2048":["https:\/\/preview-php85.dzine.org\/five\/wp-content\/uploads\/2025\/01\/Five.Co-Generate-a-PDF-File-from-SQL.jpg",1280,720,false]},"uagb_author_info":{"display_name":"Dominik Keller","author_link":"https:\/\/preview-php85.dzine.org\/five\/author\/f1v5_ed3_my\/"},"uagb_comment_info":0,"uagb_excerpt":"Learn How to Generate PDF Files from a SQL Database PDF reports are an integral part of almost every business process. Typical use cases are, for example, quotations, invoices or KPI reports. To generate a PDF file from an SQL database, all it takes are three steps: (1) create an SQL database, (2) design a&hellip;","_links":{"self":[{"href":"https:\/\/preview-php85.dzine.org\/five\/wp-json\/wp\/v2\/posts\/4441","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/preview-php85.dzine.org\/five\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/preview-php85.dzine.org\/five\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/preview-php85.dzine.org\/five\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/preview-php85.dzine.org\/five\/wp-json\/wp\/v2\/comments?post=4441"}],"version-history":[{"count":0,"href":"https:\/\/preview-php85.dzine.org\/five\/wp-json\/wp\/v2\/posts\/4441\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/preview-php85.dzine.org\/five\/wp-json\/wp\/v2\/media\/4442"}],"wp:attachment":[{"href":"https:\/\/preview-php85.dzine.org\/five\/wp-json\/wp\/v2\/media?parent=4441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/preview-php85.dzine.org\/five\/wp-json\/wp\/v2\/categories?post=4441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/preview-php85.dzine.org\/five\/wp-json\/wp\/v2\/tags?post=4441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}