Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. WebAssembly create and download pdf and xlsx files
Forum Updated to NodeBB v4.3 + New Features

WebAssembly create and download pdf and xlsx files

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
thanks
3 Posts 2 Posters 595 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Weimars
    wrote on last edited by
    #1

    Hello, I want to export the content of a tablewidget to PDF or Excel and if it is possible to open it or download it.

    I clarify that it is an application that will run in the web browser

    805e3bf4-6086-4062-8f9f-aa151689e17c-image.png

    1 Reply Last reply
    0
    • W Offline
      W Offline
      Weimars
      wrote on last edited by
      #2

      I was able to download the file in the following way, the backend that I have made in nestjs
      generates the pdf file, I consume it from the front with qnetworkaccesmanager
      and finally QFileDialog::saveFileContent(reply->readAll(), "peport.pdf" )Captura de pantalla 2024-04-30 a la(s) 9.01.17 p. m..png

      1 Reply Last reply
      1
      • M Offline
        M Offline
        monica345
        wrote on last edited by
        #3

        Exporting directly to PDF or Excel in a web browser is tricky due to security concerns. Here are some workarounds:
        Client-side libraries (limited):
        These libraries create a file-like representation of your table, but it might not be a perfect PDF or Excel. Users would need to save it manually.

        Server-side generation (better):
        Send your table data to your server. The server creates a real PDF/Excel file and sends it back for download. This offers more control and lets users directly download the file.

        Third-party services (alternative):
        These services convert your data to PDF/Excel in the cloud. You might need extra setup and potentially pay fees depending on the service.

        The best option depends on your needs (security, complexity, file format). Let me know if you want to explore a specific solution further!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved