Our state of the art Gantt chart


Post by prem kumar »

Hi Team ,

The PDF export functionality works correctly on localhost, but on the server, the styles are missing when exporting to PDF. Eventhough the server response is success but still styles are missing.Attached the server response and pdf screenshots. Below is the code which I used for export pdf

const headerTpl = ({ currentPage, totalPages }) => `
    <div class="demo-export-header">
        <dl>
            <dt>Date: ${DateHelper.format(new Date(), "ll LT")}</dt>
            <dd>${totalPages ? `Page: ${currentPage + 1}/${totalPages}` : ""
  }</dd>	
        </dl>	
    </div>`;
const footerTpl = () => '<div class="demo-export-footer"><h3>Ramco</h3></div>';
 {
                      type: "button",
                      ref: "exportButton",
                      icon: "b-fa-file-export-pdf",
                      text: "PDF",
                      onClick() {
                        let { gantt, scheduler, histogram } =
                          bryntumRefs.current;
                        gantt.features.pdfExport.showExportDialog();
   }
  pdfExport: {
          exportServer: "https://dev.bryntum.com:8082",
          headerTpl,
          footerTpl,
          exportDialog: {
            autoSelectVisibleColumns: false,
            items: {
              columnsField: {
                value: [
                  "jobdetails",
                  "taskdesc",
                  "startdate",
                  "enddate",
                  "duar",
                  "promdate",
                  "tatduar",
                  "remarkscolumn",
                  "userdef1",
                ],
              },
            },
          },
        },

could you pls suggest any workarounds.

Thanks,
Prem Kumar

Attachments
exported pdf.png
exported pdf.png (14.57 KiB) Viewed 88 times
pdf-2.png
pdf-2.png (146.06 KiB) Viewed 88 times
pdf-1.png
pdf-1.png (149.52 KiB) Viewed 88 times

Post by mats »

You should not use our PDF export server, you should set up your own as described here: https://github.com/bryntum/pdf-export-server


Post by prem kumar »

Hi,

When I try to run the command mentioned in the repository steps (npm i pdf-export-server), it shows that it's not registered in npm. When I try to download a PDF, it fails to load the task. Could you please let me know which exact package needs to be downloaded in order to resolve this error?

Error:Failed to export task
at Queue.onJobFailed (C:\Users\Hema424RN15\OneDrive - Ramco Systems Limited\Desktop\pdf-export-server\src\queue.js:282:28)
at Queue.emit (node:events:518:28)
at C:\Users\Hema424RN15\OneDrive - Ramco Systems Limited\Desktop\pdf-export-server\src\queue.js:411:28
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Thanks,
Prem Kumar

Attachments
pdferror.png
pdferror.png (51.68 KiB) Viewed 52 times

Post by alex.l »

Hi Prem Kumar,

Could you please point me in which instructions did you find that step? Not sure I understand what step are you talking about.

All the best,
Alex


Post by prem kumar »

Hi,

Apologies for confusion .After following the setup instructions, including cloning the repository (git clone git@github.com:bryntum/pdf-export-server.git), navigating to the project directory (cd pdf-export-server), and installing dependencies (npm install). I successfully got the server up and running.However, when attempting to download the PDF, I encountered the following error
Error:Failed to export task
at Queue.onJobFailed (C:\Users\Hema424RN15\OneDrive - Ramco Systems Limited\Desktop\pdf-export-server\src\queue.js:282:28)
at Queue.emit (node:events:518:28)
at C:\Users\Hema424RN15\OneDrive - Ramco Systems Limited\Desktop\pdf-export-server\src\queue.js:411:28
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)..please check the attached screenshot in the above mail thread.could u please suggest workarounds to fix it

Thanks


Post by alex.l »

Hi Prem Kumar,

Glad to hear we have a progress!

Please check Troubleshooting section of docs https://github.com/bryntum/pdf-export-server/blob/main/docs/troubleshooting.md
Run server in verbose and check logs to get more context about the problem.

$ node src/server.js --verbose

If no success, please share logs here, we will try to help you.

All the best,
Alex


Post Reply