Export report has been fixed

This commit is contained in:
Arin Alexander 2018-10-14 00:06:27 +03:00
parent c657136a1e
commit 92788d100b

View File

@ -491,19 +491,19 @@ bool ReportEnginePrivate::exportReport(QString exporterName, const QString &file
if (fn.isEmpty()){ if (fn.isEmpty()){
QString filter = QString("%1 (*.%2)").arg(e->exporterName()).arg(e->exporterFileExt()); QString filter = QString("%1 (*.%2)").arg(e->exporterName()).arg(e->exporterFileExt());
QString fn = QFileDialog::getSaveFileName(0,tr("%1 file name").arg(e->exporterName()),"",filter); QString fn = QFileDialog::getSaveFileName(0,tr("%1 file name").arg(e->exporterName()),"",filter);
if (!fn.isEmpty()){ }
QFileInfo fi(fn); if (!fn.isEmpty()){
if (fi.suffix().isEmpty()) QFileInfo fi(fn);
fn += QString(".%1").arg(e->exporterFileExt()); if (fi.suffix().isEmpty())
fn += QString(".%1").arg(e->exporterFileExt());
bool designTime = dataManager()->designTime(); bool designTime = dataManager()->designTime();
dataManager()->setDesignTime(false); dataManager()->setDesignTime(false);
ReportPages pages = renderToPages(); ReportPages pages = renderToPages();
dataManager()->setDesignTime(designTime); dataManager()->setDesignTime(designTime);
bool result = e->exportPages(pages, fn, params); bool result = e->exportPages(pages, fn, params);
delete e; delete e;
return result; return result;
}
} }
} }
return false; return false;