NCReport *report = new NCReport(); report->reset(true); report->setReportSource(NCReportSource::File); report->setReportFile("c:/report1.xml"); if (!report->hasError()){ NCReportPreviewWindow *pv = new NCReportPreviewWindow(); pv->setReport(report); pv->setOutput((NCReportPreviewOutput*)report->output()); pv->setAttribute(Qt::WA_DeleteOnClose); pv->show(); }