NCReport RunReportToQtPreview is empty



  • Hello! I'm trying to generate a report from my qt application. I created the report in a NCReportDesigner. It works perfect in the designer. But when I try to run it from my own appliction the preview shows nothing. My project file
    @QT += core gui
    QT += printsupport

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = testProj
    TEMPLATE = app

    SOURCES += main.cpp
    mainwindow.cpp
    LIBS += C:\NCReport\2.11.2.MinGW.Qt5.2.1.eval\lib\libNCReport2.a
    INCLUDEPATH += C:\NCReport\2.11.2.MinGW.Qt5.2.1.eval\include\

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui@

    And my slot

    @void MainWindow::on_pushButton_clicked()
    {
    QCoreApplication::setOrganizationName("OrganizationName");
    QCoreApplication::setApplicationName("ApplicationName");
    NCReport *report = new NCReport();
    report->setReportSource( NCReportSource::File );
    QString str=QStandardPaths::standardLocations(QStandardPaths::DataLocation)[0] + "/TestReport.ncr";
    report->setReportFile(QStandardPaths::standardLocations(QStandardPaths::DataLocation)[0] +"/TestReport.ncr");
    report->addParameter("transitidparam", 48);
    report->runReportToQtPreview();
    }@

    Thanx a lot for any help!


  • Lifetime Qt Champion

    Hi,

    You should rather contact the developers of NCReport directly. You'll have more chance to get an answer there


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.