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 821 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 27 Apr 2020, 04:31 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

    J 1 Reply Last reply 27 Apr 2020, 06:40
    0
    • R Rajesh Panati
      27 Apr 2020, 04:31

      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

      J Offline
      J Offline
      JonB
      wrote on 27 Apr 2020, 06:40 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 28 Apr 2020, 08:31
      1
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 27 Apr 2020, 18:54 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 28 Apr 2020, 08:31
        1
        • J JonB
          27 Apr 2020, 06:40

          @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 28 Apr 2020, 08:31 last edited by
          #4

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

          1 Reply Last reply
          0
          • S SGaist
            27 Apr 2020, 18:54

            Hi,

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

            R Offline
            R Offline
            Rajesh Panati
            wrote on 28 Apr 2020, 08:31 last edited by
            #5

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

            1 Reply Last reply
            0

            1/5

            27 Apr 2020, 04:31

            • Login

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