....
....
NCReport *lap=new NCReport();
lap->reset();
lap->setReportSource( NCReportSource::File );
lap->reportSource()->setFileName("C:/report1.xml");
lap->runReportToPreview();
if (lap->hasError())
{
QMessageBox::information( 0,
"Report error", lap
->lastErrorMsg
());
return FALSE;
}
else
{
NCReportPreviewWindow *pv = new NCReportPreviewWindow();
pv->setOutput( (NCReportPreviewOutput*)lap->output() );
pv->setWindowModality(Qt::ApplicationModal );
pv->setAttribute( Qt::WA_DeleteOnClose );
pv->show();
}
....
....
NCReport *lap=new NCReport();
lap->reset();
lap->setReportSource( NCReportSource::File );
lap->reportSource()->setFileName("C:/report1.xml");
lap->runReportToPreview();
if (lap->hasError())
{
QMessageBox::information( 0, "Report error", lap->lastErrorMsg());
return FALSE;
}
else
{
NCReportPreviewWindow *pv = new NCReportPreviewWindow();
pv->setOutput( (NCReportPreviewOutput*)lap->output() );
pv->setWindowModality(Qt::ApplicationModal );
pv->setAttribute( Qt::WA_DeleteOnClose );
pv->show();
}
To copy to clipboard, switch view to plain text mode
That code run well in Linux. But, not in Windows.
I Think my application crash because this line...
lap->runReportToPreview();
lap->runReportToPreview();
To copy to clipboard, switch view to plain text mode
Bookmarks