Results 1 to 2 of 2

Thread: Qt App and NCReport

  1. #1
    Join Date
    Dec 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt App and NCReport

    I tried using NCReport in my application as a component for reporting services. I am using Visual Studio 2008 and Qt 4.5.3 for development and I have also installed a specially build version of NCReport compatible to Qt 4.5.3. Since I have VS solution, so my projects are not .pro and are .vcproj.

    Instead of editing my .vcproj I have added the necessary dlls (ncreport2.dll, ncreportd2.dll), included the include folder, added the necessary library and also copied some of the dlls available in the (NCREPORT INSTALL FOLDER)/bin directory to my projetc's debug directory.

    Now my code is
    Qt Code:
    1. report = new NCReport();
    2. report->reset(true);
    3. report->setReportFile(QString(QApplication::applicationDirPath() +
    4. QDir::separator() + "reports" + QDir::separator()
    5. + "MitigationAnalysis.xml"));
    6. output = 0;
    7. output = new NCReportPreviewOutput();
    8. output->setAutoDelete( false );
    9. report->setOutput(output);
    10. report->runReport();
    11. if(!report->hasError())
    12. {
    13. pv = new NCReportPreviewWindow();
    14. pv->setReport( report );
    15. pv->setOutput((NCReportPreviewOutput *) output);
    16. pv->setWindowModality(Qt::ApplicationModal);
    17. pv->setAttribute(Qt::WA_DeleteOnClose);
    18. pv->show();
    19. }
    20. else if( report->hasError())
    21. {
    22. bool error = report->hasError();
    23. QMessageBox::about(this,"Error in Report", report->lastErrorMsg());
    24. }
    To copy to clipboard, switch view to plain text mode 

    When I try to run this code the program throws and Access Violation Exception reading location........ and breaks at the line report->runReport(). No other information and I get confused about what to do.

    Now, accidentally I tried to change the Filename of report and gave some wrong input string to it , and what I see is that the program doesn't break and shows me the last error message occurred in the report.

    I am unable to understand this behavior. I am developing my application on WINDOWS XP (service pack 3). Please guide me if any one has faced the same problem or do me this favor.

    Thanks

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt App and NCReport

    Be sure that You use correct NCReport DLL's (debug or release mode). We have this same problem after linking release DLL's to debug code.

Similar Threads

  1. NCReport on Linux
    By pucara_faa in forum Qt Programming
    Replies: 1
    Last Post: 1st February 2010, 16:05
  2. NCReport and Windows
    By wirasto in forum Newbie
    Replies: 7
    Last Post: 21st October 2009, 14:30
  3. How to run NCreport in Ubuntu
    By zikril in forum Newbie
    Replies: 0
    Last Post: 21st October 2009, 08:08
  4. Qt and NCReport
    By alphajoseph in forum Qt Programming
    Replies: 1
    Last Post: 20th February 2009, 10:29
  5. Installing NCReport
    By alphajoseph in forum Installation and Deployment
    Replies: 0
    Last Post: 19th February 2009, 04:10

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.