report = new NCReport( QString::null, 0 ); report->setParseMode( NCReport::fromFile ); report->setFileEncoding( "ISO8859-2"); report->setShowPrintDialog( true ); report->setPreviewAsMain( true ); // preview is the main form on preview mode report->setDeleteReportAfterPreview( true ); // delete report object after close preview report->setPreviewIsMaximized( false ); report->setOutput( NCReport::Preview ); report->setReportFile( "test.xml" ); report->addParameter( "value1", "param1" ); report->addParameter( "value2", "param2" ); report->runReport(); bool error = report->wasError(); QString err = report->ErrorMsg(); if ( error ) QMessageBox::information( 0, "Riport error", err );