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 i can use Report Functionality in Qt As Like Microsoft Report Viewer

How i can use Report Functionality in Qt As Like Microsoft Report Viewer

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 359 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.
  • Ketan__Patel__0011K Offline
    Ketan__Patel__0011K Offline
    Ketan__Patel__0011
    wrote on last edited by
    #1

    i am using Qt 5.12.3 Version
    And Kit Name Is : MSVC 2015 x64 Bit

    Description :
    i have data in MySQL and i want to generate Report based that Data
    also I want to display Report in Qt Control

    So please
    Help Me To Slove this Problem

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

      Hi,

      You might want to be more explicit about the kind of help you would like.

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

      1 Reply Last reply
      1
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        Qt does not come with any dedicated reporting tools but you can use
        https://sourceforge.net/projects/qtrpt/
        or
        https://sourceforge.net/projects/qreport/
        or
        https://sourceforge.net/projects/limereport/

        1 Reply Last reply
        2
        • Ketan__Patel__0011K Offline
          Ketan__Patel__0011K Offline
          Ketan__Patel__0011
          wrote on last edited by
          #4

          hello Friends

          i am try to generate report using QTRPT
          i am finished allmost work
          but Data dosen't display in report my code is :

          void Report_Time::on_btn_generate_clicked()
          {
          QSqlQuery query(db);
          query.prepare("SELECT * FROM test");
          if(!query.exec())
          {
          qDebug()<<"Error in Query"<<endl;
          }
          else
          {
          QtRPT *report = new QtRPT(this);
          while(query.next())
          {
          qDebug()<<query.value(0).toString()<<endl;
          qDebug()<<query.value(1).toString()<<endl;
          qDebug()<<query.value(2).toString()<<endl;

                  report->loadReport(":/new/TestReport.xml");
                  connect(report,&QtRPT::setValue,[&](const int recNo,
                  const QString paramName, QVariant &paramValue, const int reportPage)
                  {
                      (void) reportPage;
                      if(paramName == "id")
                      {
                          paramValue=(((recNo)),query.value(0).toString());
                          qDebug()<<paramValue<<endl;
                      }
                      if(paramName == "name")
                      {
                          paramValue=(((recNo)),query.value(1).toString());
                          qDebug()<<paramValue<<endl;
                      }
                      if(paramName == "city")
                      {
                          paramValue=(((recNo)),query.value(2).toString());
                          qDebug()<<paramValue<<endl;
                      }
                  });
              }
              report->printExec();
          }
          

          }

          My Output Is :
          Screenshot (12).png

          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