1

i have a problem when i tried to export data from table in my page to PDF using ShieldUI. In my page it's shows 200 row data, but when i export to pdf, it's just show 16 row data and just one page, it's hidden another data that should be in the next page.

here my code

 dataSource.read().then(function (data) {
        var pdf = new shield.exp.PDFDocument({
            author: "PrepBootstrap",
            created: new Date()
        });

        pdf.addPage("a4", "portrait");

        pdf.table(
            10,
            20,
            data,
            [
                { field: "No", title: "No.", width: 30 },
                { field: "Nama", title: "Nama", width: 100 },
                { field: "Prodi", title: "Prodi", width: 70 },
                { field: "HP", title: "Nomor HP", width: 100 },
                { field: "Alamat", title: "Alamat", width: 100 },
                { field: "Gugus", title: "Gugus", width: 80 },
                { field: "Kepribadian", title: "Kepribadian", width: 100 }
            ],
            {
                margins: {
                    top: 50,
                    left: 50
                }
            }
        );

        pdf.saveAs({
            fileName: "Data Seluruh Peserta PETA FT UHAMKA 2018"
        });
    });
});

what should i do ?

moonPride
  • 141
  • 3
  • 13

2 Answers2

0

If you use a Grid, you can check this example configuration for how to export the whole data set.

If you use a standalone Data Source, you will have to reset any paging (possibly make a clone of the DS without any paging options set) before passing it to the PDF utility.

Vladimir Georgiev
  • 1,949
  • 23
  • 26
0

In the margin add this:

margins: {
          top: 50,
          left: 50,
          bottom: 50
     }
David Buck
  • 3,752
  • 35
  • 31
  • 35