mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-24 16:44:39 +03:00
Fix #48 the error about "initDatasources"
This commit is contained in:
parent
2cc1cc0d13
commit
7c4d3bf8da
@ -168,6 +168,16 @@ void ReportRender::initDatasources(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReportRender::initDatasource(const QString& name){
|
||||||
|
try{
|
||||||
|
if (datasources()->containsDatasource(name))
|
||||||
|
datasources()->dataSource(name)->first();
|
||||||
|
} catch(ReportError &exception){
|
||||||
|
QMessageBox::critical(0,tr("Error"),exception.what());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ReportRender::renderPage(PageDesignIntf* patternPage)
|
void ReportRender::renderPage(PageDesignIntf* patternPage)
|
||||||
{
|
{
|
||||||
m_curentNameIndex = 0;
|
m_curentNameIndex = 0;
|
||||||
@ -191,7 +201,7 @@ void ReportRender::renderPage(PageDesignIntf* patternPage)
|
|||||||
BandDesignIntf* lastRenderedBand = 0;
|
BandDesignIntf* lastRenderedBand = 0;
|
||||||
for (int i=0;i<m_patternPageItem->dataBandCount() && !m_renderCanceled;i++){
|
for (int i=0;i<m_patternPageItem->dataBandCount() && !m_renderCanceled;i++){
|
||||||
lastRenderedBand = m_patternPageItem->dataBandAt(i);
|
lastRenderedBand = m_patternPageItem->dataBandAt(i);
|
||||||
initDatasources();
|
initDatasource(lastRenderedBand->datasourceName());
|
||||||
renderDataBand(lastRenderedBand);
|
renderDataBand(lastRenderedBand);
|
||||||
if (i<m_patternPageItem->dataBandCount()-1) closeFooterGroup(lastRenderedBand);
|
if (i<m_patternPageItem->dataBandCount()-1) closeFooterGroup(lastRenderedBand);
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,7 @@ public slots:
|
|||||||
private:
|
private:
|
||||||
void renderPage(PageDesignIntf *patternPage);
|
void renderPage(PageDesignIntf *patternPage);
|
||||||
void initDatasources();
|
void initDatasources();
|
||||||
|
void initDatasource(const QString &name);
|
||||||
void initRenderPage();
|
void initRenderPage();
|
||||||
void initVariables();
|
void initVariables();
|
||||||
void clearPageMap();
|
void clearPageMap();
|
||||||
@ -169,6 +170,7 @@ private:
|
|||||||
QList<PagesRange> m_ranges;
|
QList<PagesRange> m_ranges;
|
||||||
QVector<BandDesignIntf*> m_columnedBandItems;
|
QVector<BandDesignIntf*> m_columnedBandItems;
|
||||||
unsigned long long m_curentNameIndex;
|
unsigned long long m_curentNameIndex;
|
||||||
|
|
||||||
};
|
};
|
||||||
} // namespace LimeReport
|
} // namespace LimeReport
|
||||||
#endif // LRREPORTRENDER_H
|
#endif // LRREPORTRENDER_H
|
||||||
|
Loading…
Reference in New Issue
Block a user