Skip to content

Unable to Export SQLPage .sql Page Content to PDF Using Playwright #216

@jafar007jsm-bit

Description

@jafar007jsm-bit

Issue: Unable to Export SQLPage .sql Page Content to PDF Using Playwright

Description

I am trying to export a SQLPage .sql page as a PDF using a button link in SQLPage. The PDF file is being generated successfully using the Playwright package, but the contents rendered by the .sql file are not appearing in the generated PDF.

Instead of exporting the rendered SQLPage content, the generated PDF is either blank or missing the expected page content.

Environment

  • SQLPage
  • Playwright (Node.js)
  • SQLite database
  • Local server: http://localhost:9228

Current Implementation

I am triggering the Playwright command from a SQLPage button using the following query:

SELECT sqlpage.exec('npx', 'playwright','test');

However, this command does not execute correctly within SQLPage. The PDF file still gets generated, but the content from the .sql page is not captured.

Expected Behavior

When clicking the SQLPage button:

  1. Playwright should open the SQLPage route.
  2. The .sql page should fully render.
  3. Playwright should generate a PDF containing the rendered SQLPage content.
  4. The user should be able to download the generated PDF.

Actual Behavior

  • The PDF file is generated.
  • The rendered content from the SQLPage .sql file is not included.
  • The command SELECT sqlpage.exec('npx', 'playwright','test'); does not work correctly.

Goal

I need to download a rendered SQLPage .sql page as a PDF using the Playwright package triggered from a SQLPage button.

Questions

  • What is the correct way to execute Playwright from SQLPage using sqlpage.exec()?
  • How can I ensure the SQLPage .sql page content is fully rendered before Playwright generates the PDF?
  • Is there a recommended method for exporting SQLPage pages as PDFs using Playwright?

Any guidance or working example would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions