Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to generate report in PDF/CSV format
Forum Updated to NodeBB v4.3 + New Features

How to generate report in PDF/CSV format

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 867 Views 2 Watching
  • 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.
  • R Offline
    R Offline
    Rajesh Panati
    wrote on last edited by
    #1

    Hi, i am trying to generate a report using test results to a table. How can i generate a table and push the test results to the table using QT. Can a table be drawn as shown in the sample reference image below and fill data in blank spaces from code. Kindly help me

    sample.jpg

    JonBJ 1 Reply Last reply
    0
    • R Rajesh Panati

      Hi, i am trying to generate a report using test results to a table. How can i generate a table and push the test results to the table using QT. Can a table be drawn as shown in the sample reference image below and fill data in blank spaces from code. Kindly help me

      sample.jpg

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Rajesh-Panati
      In a word, you're going to have write whatever code yourself. You can probably achieve the output above with a dedicated form layout hand-designed, though it will take some work. The literal text will be QLabels and the "blanks" will be QWidgets like QLineEdit. You could have a custom data model behind it, possibly with a QDataWidgetMapper if you want to tie the widgets input/output to the model. It will not be a "click in blanks to type" in the way it can be in, say a PDF form editor, though you could make it such if you really wanted, but not straightforward.

      You can write code to read/write a CSV file mapped to the model, or directly to the widgets. Once you have your form filled in, you can send it as the visual page to a PDF printer/exporter.

      R 1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        There are third party packages like QtRPT that you might find interesting.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        R 1 Reply Last reply
        1
        • JonBJ JonB

          @Rajesh-Panati
          In a word, you're going to have write whatever code yourself. You can probably achieve the output above with a dedicated form layout hand-designed, though it will take some work. The literal text will be QLabels and the "blanks" will be QWidgets like QLineEdit. You could have a custom data model behind it, possibly with a QDataWidgetMapper if you want to tie the widgets input/output to the model. It will not be a "click in blanks to type" in the way it can be in, say a PDF form editor, though you could make it such if you really wanted, but not straightforward.

          You can write code to read/write a CSV file mapped to the model, or directly to the widgets. Once you have your form filled in, you can send it as the visual page to a PDF printer/exporter.

          R Offline
          R Offline
          Rajesh Panati
          wrote on last edited by
          #4

          @JonB Thanks for your suggestion, will try it out.

          1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            There are third party packages like QtRPT that you might find interesting.

            R Offline
            R Offline
            Rajesh Panati
            wrote on last edited by
            #5

            @SGaist Thank you for the response. I will try that.

            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