mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-25 13:04:38 +03:00
1.4.10
This commit is contained in:
commit
c7a5b638e8
@ -73,7 +73,7 @@ public:
|
||||
explicit ReportEngine(QObject *parent = 0);
|
||||
~ReportEngine();
|
||||
bool printReport(QPrinter *printer=0);
|
||||
bool printPages(ReportPages pages, QPrinter *printer, PrintRange printRange = PrintRange());
|
||||
bool printPages(ReportPages pages, QPrinter *printer);
|
||||
void printToFile(const QString& fileName);
|
||||
PageDesignIntf *createPreviewScene(QObject *parent = 0);
|
||||
bool printToPDF(const QString& fileName);
|
||||
|
@ -163,8 +163,7 @@ void PreviewReportWidget::print()
|
||||
if (!d_ptr->m_reportPages.isEmpty())
|
||||
ReportEnginePrivate::printReport(
|
||||
d_ptr->m_reportPages,
|
||||
printer,
|
||||
PrintRange(dialog.printRange(),dialog.fromPage(),dialog.toPage())
|
||||
printer
|
||||
);
|
||||
foreach(PageItemDesignIntf::Ptr pageItem, d_ptr->m_reportPages){
|
||||
d_ptr->m_previewPage->reactivatePageItem(pageItem);
|
||||
@ -184,7 +183,7 @@ void PreviewReportWidget::printToPDF()
|
||||
printer.setOutputFileName(fileName);
|
||||
printer.setOutputFormat(QPrinter::PdfFormat);
|
||||
if (!d_ptr->m_reportPages.isEmpty()){
|
||||
ReportEnginePrivate::printReport(d_ptr->m_reportPages,printer,PrintRange());
|
||||
ReportEnginePrivate::printReport(d_ptr->m_reportPages,printer);
|
||||
}
|
||||
foreach(PageItemDesignIntf::Ptr pageItem, d_ptr->m_reportPages){
|
||||
d_ptr->m_previewPage->reactivatePageItem(pageItem);
|
||||
|
@ -208,7 +208,7 @@ void ReportEnginePrivate::printReport(ItemsReaderIntf::Ptr reader, QPrinter& pri
|
||||
}
|
||||
}
|
||||
|
||||
void ReportEnginePrivate::printReport(ReportPages pages, QPrinter &printer, const PrintRange& printRange)
|
||||
void ReportEnginePrivate::printReport(ReportPages pages, QPrinter &printer)
|
||||
{
|
||||
LimeReport::PageDesignIntf renderPage;
|
||||
renderPage.setItemMode(PrintMode);
|
||||
@ -216,13 +216,13 @@ void ReportEnginePrivate::printReport(ReportPages pages, QPrinter &printer, cons
|
||||
|
||||
bool isFirst = true;
|
||||
int currenPage = 1;
|
||||
foreach(PageItemDesignIntf::Ptr page,pages){
|
||||
foreach(PageItemDesignIntf::Ptr page, pages){
|
||||
|
||||
if (
|
||||
(printRange.rangeType()==QPrintDialog::AllPages) ||
|
||||
( (printRange.rangeType()==QPrintDialog::PageRange) &&
|
||||
(currenPage>=printRange.fromPage()) &&
|
||||
(currenPage<=printRange.toPage())
|
||||
(printer.printRange() == QPrinter::AllPages) ||
|
||||
( (printer.printRange()==QPrinter::PageRange) &&
|
||||
(currenPage>=printer.fromPage()) &&
|
||||
(currenPage<=printer.toPage())
|
||||
)
|
||||
)
|
||||
{
|
||||
@ -286,7 +286,7 @@ bool ReportEnginePrivate::printReport(QPrinter* printer)
|
||||
ReportPages pages = renderToPages();
|
||||
dataManager()->setDesignTime(true);
|
||||
if (pages.count()>0){
|
||||
printReport(pages,*printer,PrintRange());
|
||||
printReport(pages,*printer);
|
||||
}
|
||||
} catch(ReportError &exception){
|
||||
saveError(exception.what());
|
||||
@ -295,18 +295,12 @@ bool ReportEnginePrivate::printReport(QPrinter* printer)
|
||||
} else return false;
|
||||
}
|
||||
|
||||
bool ReportEnginePrivate::printPages(ReportPages pages, QPrinter *printer, PrintRange printRange)
|
||||
bool ReportEnginePrivate::printPages(ReportPages pages, QPrinter *printer)
|
||||
{
|
||||
|
||||
if (!printer&&!m_printerSelected){
|
||||
QPrintDialog dialog(m_printer.data(),QApplication::activeWindow());
|
||||
m_printerSelected = dialog.exec()!=QDialog::Rejected;
|
||||
if (m_printerSelected){
|
||||
printRange.setRangeType(dialog.printRange());
|
||||
printRange.setFromPage(dialog.fromPage());
|
||||
printRange.setToPage(dialog.toPage());
|
||||
}
|
||||
|
||||
}
|
||||
if (!printer&&!m_printerSelected) return false;
|
||||
|
||||
@ -316,8 +310,7 @@ bool ReportEnginePrivate::printPages(ReportPages pages, QPrinter *printer, Print
|
||||
if (pages.count()>0){
|
||||
printReport(
|
||||
pages,
|
||||
*printer,
|
||||
printRange
|
||||
*printer
|
||||
);
|
||||
}
|
||||
} catch(ReportError &exception){
|
||||
@ -828,9 +821,9 @@ bool ReportEngine::printReport(QPrinter *printer)
|
||||
return d->printReport(printer);
|
||||
}
|
||||
|
||||
bool ReportEngine::printPages(ReportPages pages, QPrinter *printer, PrintRange printRange){
|
||||
bool ReportEngine::printPages(ReportPages pages, QPrinter *printer){
|
||||
Q_D(ReportEngine);
|
||||
return d->printPages(pages,printer, printRange);
|
||||
return d->printPages(pages,printer);
|
||||
}
|
||||
|
||||
void ReportEngine::printToFile(const QString &fileName)
|
||||
|
@ -73,7 +73,7 @@ public:
|
||||
explicit ReportEngine(QObject *parent = 0);
|
||||
~ReportEngine();
|
||||
bool printReport(QPrinter *printer=0);
|
||||
bool printPages(ReportPages pages, QPrinter *printer, PrintRange printRange = PrintRange());
|
||||
bool printPages(ReportPages pages, QPrinter *printer);
|
||||
void printToFile(const QString& fileName);
|
||||
PageDesignIntf *createPreviewScene(QObject *parent = 0);
|
||||
bool printToPDF(const QString& fileName);
|
||||
|
@ -63,7 +63,7 @@ class ReportEnginePrivate : public QObject, public ICollectionContainer
|
||||
friend class PreviewReportWidget;
|
||||
public:
|
||||
static void printReport(ItemsReaderIntf::Ptr reader, QPrinter &printer);
|
||||
static void printReport(ReportPages pages, QPrinter &printer, const PrintRange &printRange);
|
||||
static void printReport(ReportPages pages, QPrinter &printer);
|
||||
public:
|
||||
explicit ReportEnginePrivate(QObject *parent = 0);
|
||||
virtual ~ReportEnginePrivate();
|
||||
@ -85,7 +85,7 @@ public:
|
||||
|
||||
void clearReport();
|
||||
bool printReport(QPrinter *printer=0);
|
||||
bool printPages(ReportPages pages, QPrinter *printer, PrintRange printRange = PrintRange());
|
||||
bool printPages(ReportPages pages, QPrinter *printer);
|
||||
void printToFile(const QString& fileName);
|
||||
bool printToPDF(const QString& fileName);
|
||||
void previewReport(PreviewHints hints = PreviewBarsUserSetting);
|
||||
|
Loading…
Reference in New Issue
Block a user