mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-24 08:34:38 +03:00
TOC generation has been fixed
This commit is contained in:
parent
2b5a79e79c
commit
f73055e347
@ -127,7 +127,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc
|
|||||||
|
|
||||||
LIMEREPORT_VERSION_MAJOR = 1
|
LIMEREPORT_VERSION_MAJOR = 1
|
||||||
LIMEREPORT_VERSION_MINOR = 5
|
LIMEREPORT_VERSION_MINOR = 5
|
||||||
LIMEREPORT_VERSION_RELEASE = 31
|
LIMEREPORT_VERSION_RELEASE = 32
|
||||||
|
|
||||||
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
|
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
|
||||||
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"
|
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"
|
||||||
|
@ -468,7 +468,7 @@ public:
|
|||||||
QVariant getBookMark(const QString& key);
|
QVariant getBookMark(const QString& key);
|
||||||
void copyBookmarks(BookmarkContainerDesignIntf* source);
|
void copyBookmarks(BookmarkContainerDesignIntf* source);
|
||||||
private:
|
private:
|
||||||
QMap<QString,QVariant> m_bookmarks;
|
QHash<QString,QVariant> m_bookmarks;
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace LimeReport
|
} //namespace LimeReport
|
||||||
|
@ -719,24 +719,35 @@ QVariant CallbackDatasource::dataByKeyField(const QString& columnName, const QSt
|
|||||||
{
|
{
|
||||||
int backupCurrentRow = m_currentRow;
|
int backupCurrentRow = m_currentRow;
|
||||||
QVariant result = QVariant();
|
QVariant result = QVariant();
|
||||||
first();
|
|
||||||
if (!checkIfEmpty()){
|
m_currentRow = m_lastKeyRow;
|
||||||
int currentRow = 0;
|
if (next()){
|
||||||
do {
|
for (int i = 0; i < 10; ++i){
|
||||||
QVariant key = callbackData(keyColumnName, currentRow);
|
QVariant key = callbackData(keyColumnName, m_currentRow);
|
||||||
if (key == keyData){
|
if (key == keyData){
|
||||||
result = callbackData(columnName, currentRow);
|
result = callbackData(columnName, m_currentRow);
|
||||||
break;
|
m_lastKeyRow = m_currentRow;
|
||||||
|
m_currentRow = backupCurrentRow;
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
currentRow++;
|
if (!next()) break;
|
||||||
} while (next());
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
first();
|
first();
|
||||||
if (backupCurrentRow != -1){
|
if (!checkIfEmpty()){
|
||||||
for (int i = 0; i < backupCurrentRow; ++i)
|
do {
|
||||||
next();
|
QVariant key = callbackData(keyColumnName, m_currentRow);
|
||||||
|
if (key == keyData){
|
||||||
|
result = callbackData(columnName, m_currentRow);
|
||||||
|
m_lastKeyRow = m_currentRow;
|
||||||
|
m_currentRow = backupCurrentRow;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
} while (next());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_currentRow = backupCurrentRow;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,8 +410,8 @@ private:
|
|||||||
class CallbackDatasource :public ICallbackDatasource, public IDataSource {
|
class CallbackDatasource :public ICallbackDatasource, public IDataSource {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
CallbackDatasource(): m_currentRow(-1), m_eof(false), m_columnCount(-1),
|
CallbackDatasource(): m_currentRow(-1), m_eof(false), m_columnCount(-1),
|
||||||
m_rowCount(-1), m_getDataFromCache(false){}
|
m_rowCount(-1), m_getDataFromCache(false), m_lastKeyRow(0){}
|
||||||
bool next();
|
bool next();
|
||||||
bool hasNext(){ if (!m_eof) return checkNextRecord(m_currentRow); else return false;}
|
bool hasNext(){ if (!m_eof) return checkNextRecord(m_currentRow); else return false;}
|
||||||
bool prior();
|
bool prior();
|
||||||
@ -431,6 +431,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
bool checkNextRecord(int recordNum);
|
bool checkNextRecord(int recordNum);
|
||||||
bool checkIfEmpty();
|
bool checkIfEmpty();
|
||||||
|
QVariant callbackData(const QString& columnName, int row);
|
||||||
private:
|
private:
|
||||||
QVector<QString> m_headers;
|
QVector<QString> m_headers;
|
||||||
int m_currentRow;
|
int m_currentRow;
|
||||||
@ -439,7 +440,7 @@ private:
|
|||||||
int m_rowCount;
|
int m_rowCount;
|
||||||
QHash<QString, QVariant> m_valuesCache;
|
QHash<QString, QVariant> m_valuesCache;
|
||||||
bool m_getDataFromCache;
|
bool m_getDataFromCache;
|
||||||
QVariant callbackData(const QString& columnName, int row);
|
int m_lastKeyRow;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CallbackDatasourceHolder :public QObject, public IDataSourceHolder{
|
class CallbackDatasourceHolder :public QObject, public IDataSourceHolder{
|
||||||
|
@ -722,6 +722,7 @@ void ReportDesignWidget::initThemeIfExist(const QString &themeName, const QStrin
|
|||||||
|
|
||||||
void ReportDesignWidget::previewReport()
|
void ReportDesignWidget::previewReport()
|
||||||
{
|
{
|
||||||
|
if (report()->isBusy()) return;
|
||||||
prepareReport();
|
prepareReport();
|
||||||
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
||||||
updateDialogs();
|
updateDialogs();
|
||||||
@ -734,6 +735,7 @@ void ReportDesignWidget::previewReport()
|
|||||||
|
|
||||||
void ReportDesignWidget::printReport()
|
void ReportDesignWidget::printReport()
|
||||||
{
|
{
|
||||||
|
if (report()->isBusy()) return;
|
||||||
prepareReport();
|
prepareReport();
|
||||||
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
||||||
updateDialogs();
|
updateDialogs();
|
||||||
|
@ -1264,7 +1264,9 @@ void ReportDesignWindow::slotPrintReport()
|
|||||||
|
|
||||||
void ReportDesignWindow::slotPreviewReport()
|
void ReportDesignWindow::slotPreviewReport()
|
||||||
{
|
{
|
||||||
|
m_previewReportAction->setDisabled(true);
|
||||||
m_reportDesignWidget->previewReport();
|
m_reportDesignWidget->previewReport();
|
||||||
|
m_previewReportAction->setDisabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportDesignWindow::slotItemActionCliked()
|
void ReportDesignWindow::slotItemActionCliked()
|
||||||
|
@ -113,6 +113,7 @@ public:
|
|||||||
virtual void cancelRender() = 0;
|
virtual void cancelRender() = 0;
|
||||||
virtual void setShowProgressDialog(bool value) = 0;
|
virtual void setShowProgressDialog(bool value) = 0;
|
||||||
virtual bool isShowProgressDialog() const = 0;
|
virtual bool isShowProgressDialog() const = 0;
|
||||||
|
virtual bool isBusy() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class PrintProcessor{
|
class PrintProcessor{
|
||||||
|
@ -261,11 +261,11 @@ void ReportRender::renderPage(PageItemDesignIntf* patternPage, bool isTOC, bool
|
|||||||
renderReportHeader(m_patternPageItem, AfterPageHeader);
|
renderReportHeader(m_patternPageItem, AfterPageHeader);
|
||||||
|
|
||||||
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);
|
||||||
initDatasource(lastRenderedBand->datasourceName());
|
initDatasource(lastRenderedBand->datasourceName());
|
||||||
renderDataBand(lastRenderedBand);
|
renderDataBand(lastRenderedBand);
|
||||||
if (i<m_patternPageItem->dataBandCount()-1) closeFooterGroup(lastRenderedBand);
|
if (i < m_patternPageItem->dataBandCount()-1) closeFooterGroup(lastRenderedBand);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reportFooter)
|
if (reportFooter)
|
||||||
@ -475,7 +475,7 @@ BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesign
|
|||||||
if (bandData){
|
if (bandData){
|
||||||
bandClone = bandData;
|
bandClone = bandData;
|
||||||
} else {
|
} else {
|
||||||
bandClone=renderData(patternBand);
|
bandClone = renderData(patternBand);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLast) bandClone->setBootomSpace(1);
|
if (isLast) bandClone->setBootomSpace(1);
|
||||||
@ -543,8 +543,10 @@ BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesign
|
|||||||
savePage();
|
savePage();
|
||||||
startNewPage();
|
startNewPage();
|
||||||
if (!bandIsSliced){
|
if (!bandIsSliced){
|
||||||
|
BandDesignIntf* t = renderData(patternBand);
|
||||||
|
t->copyBookmarks(bandClone);
|
||||||
delete bandClone;
|
delete bandClone;
|
||||||
bandClone = renderData(patternBand);
|
bandClone = t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!registerBand(bandClone)) {
|
if (!registerBand(bandClone)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user