How to export Entity data to PDF?

Hi Folks,
Greetings!

I would like to convert or export entity data into PDF and download PDF, so kindly help me how to do this?


Thanks

There are a few options you can consider.

Or try to render the table records on the screen using CSS according to what you like to show on PDF, then use the browser's built-in export to PDF feature, as in print to PDF.

Hope this helps.

Solution

Hi Nuno Miguel Verdasca,

Thanks for your help.

My issue is resolved by using Kendo JS.

1.Paste following link text in expression
"<link rel='stylesheet' href='https://kendo.cdn.telerik.com/2019.2.619/styles/kendo.common-material.min.css' /><link rel='stylesheet' href='https://kendo.cdn.telerik.com/2019.2.619/styles/kendo.material.min.css' /><script src='https://kendo.cdn.telerik.com/2019.2.619/js/kendo.all.min.js'></script>"


2. Added following code in Screen javaScript property

SyntaxEditor Code Snippet

function GeneratePDF(Container,fileName){    
   var style=$("#"+Container).find('.ProductPackTable').attr('style');
    // Convert the DOM element to a drawing using kendo.drawing.drawDOM
    kendo.drawing.drawDOM($("#"+Container))
    .then(function(group) {
         $("#"+Container).find('.ProductPackTable').attr('style',style);
        // Render the result as a PDF file
        return kendo.drawing.exportPDF(group, {
            paperSize: "auto",
            landscape: true,
            margin: { left: "1cm", top: "1cm", right: "1cm", bottom: "1cm" }
        });
    })
    .done(function(data) {
        // Save the PDF file
        kendo.saveAs({
            dataURI: data,
            fileName: fileName+".pdf",
            proxyURL: "https://demos.telerik.com/kendo-ui/service/export"
        });
    });
  
}



3. For download to created pdf, I have taken one button with one click action in Extended Properties and call following Text

SyntaxEditor Code Snippet

 "GeneratePDF('"+PDFCnt.Id+"','"+"Filename"+"');"


Cheers


Solution

Meer Imtiyaz wrote:

Hi Nuno Miguel Verdasca,

Thanks for your help.

My issue is resolved by using Kendo JS.

1.Paste following link text in expression
"<link rel='stylesheet' href='https://kendo.cdn.telerik.com/2019.2.619/styles/kendo.common-material.min.css' /><link rel='stylesheet' href='https://kendo.cdn.telerik.com/2019.2.619/styles/kendo.material.min.css' /><script src='https://kendo.cdn.telerik.com/2019.2.619/js/kendo.all.min.js'></script>"


2. Added following code in Screen javaScript property

SyntaxEditor Code Snippet

function GeneratePDF(Container,fileName){    
   var style=$("#"+Container).find('.ProductPackTable').attr('style');
    // Convert the DOM element to a drawing using kendo.drawing.drawDOM
    kendo.drawing.drawDOM($("#"+Container))
    .then(function(group) {
         $("#"+Container).find('.ProductPackTable').attr('style',style);
        // Render the result as a PDF file
        return kendo.drawing.exportPDF(group, {
            paperSize: "auto",
            landscape: true,
            margin: { left: "1cm", top: "1cm", right: "1cm", bottom: "1cm" }
        });
    })
    .done(function(data) {
        // Save the PDF file
        kendo.saveAs({
            dataURI: data,
            fileName: fileName+".pdf",
            proxyURL: "https://demos.telerik.com/kendo-ui/service/export"
        });
    });
  
}



3. For download to created pdf, I have taken one button with one click action in Extended Properties and call following Text

SyntaxEditor Code Snippet

 "GeneratePDF('"+PDFCnt.Id+"','"+"Filename"+"');"


Cheers


Thank you Sir its Working 



Meer Imtiyaz wrote:

Hi Nuno Miguel Verdasca,

Thanks for your help.

My issue is resolved by using Kendo JS.

1.Paste following link text in expression
"<link rel='stylesheet' href='https://kendo.cdn.telerik.com/2019.2.619/styles/kendo.common-material.min.css' /><link rel='stylesheet' href='https://kendo.cdn.telerik.com/2019.2.619/styles/kendo.material.min.css' /><script src='https://kendo.cdn.telerik.com/2019.2.619/js/kendo.all.min.js'></script>"


2. Added following code in Screen javaScript property

SyntaxEditor Code Snippet

function GeneratePDF(Container,fileName){    
   var style=$("#"+Container).find('.ProductPackTable').attr('style');
    // Convert the DOM element to a drawing using kendo.drawing.drawDOM
    kendo.drawing.drawDOM($("#"+Container))
    .then(function(group) {
         $("#"+Container).find('.ProductPackTable').attr('style',style);
        // Render the result as a PDF file
        return kendo.drawing.exportPDF(group, {
            paperSize: "auto",
            landscape: true,
            margin: { left: "1cm", top: "1cm", right: "1cm", bottom: "1cm" }
        });
    })
    .done(function(data) {
        // Save the PDF file
        kendo.saveAs({
            dataURI: data,
            fileName: fileName+".pdf",
            proxyURL: "https://demos.telerik.com/kendo-ui/service/export"
        });
    });
  
}



3. For download to created pdf, I have taken one button with one click action in Extended Properties and call following Text

SyntaxEditor Code Snippet

 "GeneratePDF('"+PDFCnt.Id+"','"+"Filename"+"');"


Cheers


You don't have to thank me, I'm happy to be able to help. (",)


The code is not working not able to see the data