Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Using NCReports in Qt
Forum Updated to NodeBB v4.3 + New Features

Using NCReports in Qt

Scheduled Pinned Locked Moved 3rd Party Software
4 Posts 4 Posters 4.2k Views 1 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.
  • T Offline
    T Offline
    tertel
    wrote on last edited by
    #1

    I've read the guide that came with the NCReports installer, looked at the demos inside it too but I just cannot understand on how to make it work...

    What I did was:

    Design a report in NCReport Designer

    Tried to integrate it into my .pro file

    but when I try to run it, the preview shows nothing..

    This is the part of the code when I use NcReport. I used the same test data and the same report file as in the demo but it still shows nothing...
    @void ChairMenu::on_generateFacListReport_clicked()
    {

    NCReport *report = new NCReport();
    
    //-------------------------------------------
    // TEST STRINGLIST DATASOURCE
    //-------------------------------------------
    QStringList list;
    list << "24\tRenate Moulding\tDesert Hot Springs,CA\t1\t2008-01-01";
    list << "78\tAlfred Muller\tMiami Beach, FL\t1\t2008-01-03";
    list << "140\tAngela Merkel\tMunchen, Germany\t1\t2008-01-07";
    list << "139\tBob Larson\tDallas, TX\t0\t2008-01-20";
    
    report->addStringList( list, "sl0" );
    
    report->setReportFile&#40; "C:\Program Files\NCReport\2.8.7.MinGW.eval\reports\stringlist_demo.xml"&#41;;
    report->runReport();
    
    NCReportOutput *output = new NCReportPreviewOutput();
    output->setAutoDelete( FALSE );
    report->setOutput( output );
    report->runReportToPreview();
    
    NCReportPreviewWindow *pv = new NCReportPreviewWindow();
    pv->setReport( report );
    pv->setOutput( (NCReportPreviewOutput*)output );
    pv->setWindowModality(Qt::ApplicationModal );
    pv->setAttribute( Qt::WA_DeleteOnClose );
    pv->show();
    

    }@

    1 Reply Last reply
    0
    • H Offline
      H Offline
      haga
      wrote on last edited by
      #2

      Hi tertel!
      try this:

      NCReport *report = new NCReport();
      QStringList list;
      list << "24\tRenate Moulding\tDesert Hot Springs,CA\t1\t2008-01-01";
      list << "78\tAlfred Muller\tMiami Beach, FL\t1\t2008-01-03";
      list << "140\tAngela Merkel\tMunchen, Germany\t1\t2008-01-07";
      list << "139\tBob Larson\tDallas, TX\t0\t2008-01-20";
      report->addStringList( list, "sl0" );
      report->setReportFile( "C:\Program Files\NCReport\2.8.7.MinGW.eval\reports\stringlist_demo.xml");
      report->runReportToPreview();
      NCReportPreviewWindow pv = new NCReportPreviewWindow();
      pv->setOutput( (NCReportPreviewOutput
      ) report->output() );
      pv->setWindowModality(Qt::ApplicationModal );
      pv->setAttribute( Qt::WA_DeleteOnClose );
      pv->show();

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

        Guys, NCReports is commercial product is it? Are you using the open source edition from sourceforge.net?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mehdibob
          wrote on last edited by
          #4

          Please I have a probleme with cross-table, I have attributed a datasource based on item-Model , but no thing is appeared .
          Thanks

          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