Giter Site home page Giter Site logo

limereport's Introduction

LimeReport v1.7.5 Build status Codacy Badge Cmake Build Status

Official LimeReport web site http://limereport.ru

Features

  • Multi-platform support
  • Pure Qt4/Qt5 compatible code
  • Embedded report designer
  • Embedded preview
  • Various band types for a report of any complexity
  • Page header and footer
  • Data grouping (GroupHeader, GroupFooter, Subdetail, SubdetailHeader, SubdetailFooter)
  • Aggregation functions (SUM, COUNT, AVG, MIN, MAX)
  • Report elements: Text, Geometric (Line, Ellipsis, Rectangle), Picture
  • Horizontal elements groups
  • HTML to format input fields
  • Scripts to format output data
  • An Automatic band height adjustment
  • A Smart band split moving data to the next page
  • PDF output

How to use it

QMake

  • Build limereport.pro. It will create a limereport shared library
  • In your project connect the limereport library

CMake

To use in your application without installation

There are 2 possible ways:

  • Use cmake subdirectory in your CMakeLists.txt:
add_subdirectory(LimeReport)
target_link_libraries(myapp PRIVATE limereport-qt${QT_VERSION_MAJOR})
  • Use cmake FetchContent in your CMakeLists.txt:
include(FetchContent)
FetchContent_Declare(
  LimeReport
  GIT_REPOSITORY https://github.com/fralx/LimeReport.git
  GIT_TAG        sha-of-the-commit
)
FetchContent_MakeAvailable(LimeReport)
target_link_libraries(myapp PRIVATE limereport-qt${QT_VERSION_MAJOR})
  • Then in source code add:
  #include "lrreportengine.h" to add report engine
  #include "lrcallbackdatasourceintf.h" if you want use callback datasources

  report = new LimeReport::ReportEngine(this); to create reportengine
  report->dataManager()->addModel("string_list",stringListModel,true); to add datasource to report engine
  report->loadFromFile("File name"); to load report template file
  report->previewReport(); to generate report and preview
  report->printReport(); to print report

For more samples see a demo

Change log

1.5.0

  1. Added the ability to use QJSEngine instead of deprecated QtScript.
  2. Report designer has been improved.
  3. Inches support has been added.
  4. Embedded dialog designer has been added.
  5. The script editor has been improved.
  6. Added the ability to build only report generator without embedded visual report designer.
  7. Report translation ability has been added.
  8. Added report generation time events with the ability to process them in the report script.
  9. Added the ability to build a report table of contents.
  10. The vertical layout has been added.
  11. Added the ability to transfer an image to the report via a variable.
  12. Endless height has been added.
  13. Added the ability to print a report page on multiple pages of paper.
  14. Added the ability to print on multiple printers.
  15. ChartItem has been added.
  16. Added the ability to use aggregate functions in headers.
  17. Subtotals.
  18. Dark and Light themes have been added to report designer.
  19. Generation result editing mode has been improved.
  20. And many other minor fixes and improvements.

1.4.7

  1. Multipage.
  2. Dialogs.
  3. Render events.
  4. Initscript.
  5. Memory usage has been reduced.
  6. Data source manager has been refactored.
  7. Report items context menus have been added.
  8. Editable report.
  9. And many other minor fixes and improvements.

1.3.11

  1. The LimeReport project structure has been changed.
  2. Preview widget has been added.
  3. A new demo has been added.
  4. Landscape page orientation has been fixed.
  5. Other minor bugs have been fixed.

1.3.10

  1. A memory leak has been fixed.
  2. Grid & Settings have been added.
  3. Recent files menu has been added.
  4. Magnet feature has been added.
  5. Added ability to use variables in the connection settings.

1.3.9

New functions:

  QString::saveToString(),
  loadFromString(const QString& report, const QString& name=""),
  QByteArray::saveToByteArray(),
  setCurrentReportsDir(const QString& dirName),

added to LimeReport::ReportEngine

  1. printOnEach page and columns have been added to DataHeader band
  2. startNewPage added to DataBand

Performance has been improved

WARNING From this version, the item "Text" by default does not use HTML. To enable HTML support you need to use the property allowHTML

1.3.1

Added:

  1. Columns Some bands can be divided into columns
  2. Items align Report items now may be aligned to the left, right or center of the container also it can be stretched to the whole width of the container
  3. Group can start a new page
  4. Group can reset page number;
  5. Table mode added to the horizontal layout This mode allows you to distribute the internal layout's space among grouped items

Fixed:

  1. Postgresql connection
  2. The error that prevented the normal run of more than one instance of LimeReport::ReportEngine

1.2.1

  1. Added buttons to open / hide sidebars;
  2. Improved look-and-feel of report elements to clarify the designing process;
  3. Printing to PDF added.
  4. Fixed bug in SQL-editor when it used variables in SQL expression;
  5. Fixed bug of variable's initialization if it exists more than once in SQL expression;
  6. .. and other minor bugs fixed.

limereport's People

Contributors

andrzejworonko avatar arnephotonics avatar asmaloney avatar beardeddragon5 avatar codacy-badger avatar compozitor avatar cuteivist avatar darktorres avatar dmitryzagorodnev avatar f3nix avatar fralx avatar frostasm avatar hatem-u avatar jihadist avatar lifof avatar liufeijin avatar makarenkov2 avatar maks1ms avatar mlavik1 avatar multimote avatar newsages avatar rangemastersystems avatar sg-james avatar silverhawk89 avatar spiek avatar tizbac avatar turbin avatar vanger13 avatar wartime avatar yanis60 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

limereport's Issues

Direct Print from PreWidget

Function for use default Printer and no QPrintDialog for batch procesing?:

connect(ui->tbPrint, SIGNAL(clicked(bool)), m_preview, SLOT(print()));

connect(ui->tbPrint, SIGNAL(clicked(bool)), m_preview, SLOT(printDirect()));
 or
m_preview, SLOT(printTo(printer)));

Translation?

I've been looking at the available report tools and this one looks very promising!

How would I handle translation of reports? Making a separate copy of each report for each language seems impractical (though of course some would have to be done by hand - right-to-left scripts for example). Populating all text through variables and relying on QObject::tr() seems a bit painful, but I guess that might work.

Any suggestions? Am I missing something?

Would be cool if I could do it directly in the designer - select the language, populate the text for that language, then on the Qt side request a specific language when I load the report.

LimeReport not really a reusable library

LimeReport is great, but the LimeReport::ReportEngine is a bit too monolithic to be reused efficiently.

In fact the PrintPreview and Designer windows are not really useful because we can not instantiate them ourselves as it's tied to the ReportEnginePrivate thing.

Please allow those dialogs to be instantiated taking a simple ReportEngine in constructor, this way we can control where and how to instantiate those to suit our needs (modal, non modal, size , screen...).

Allow to customize the Preview dialog

Actually we do not have any programmatically way of changing the UI Preview window like:

  • Hide the top toolbar
  • Hide the bottom status bar etc

We maintain a local patch for that and I don't like it.
Please add some sort of option hint to the previewReport() functions so we can customize appearance.

Утечка памяти, если метод модели data возвращает дефолтный QVariant для всех ячеек таблицы

Большая таблица 10000х5 съедает много памяти, которую не возвращает при удалении ReportEngine

QVariant ReportModel::data(const QModelIndex &index, int role) const
{
    return QVariant();
}

Баг нашёлся случайно, когда метод rowCount возвращал значение 10000, а в ReportModel::data проверялось 1000, иначе отдавался дефолтный QVariant.

Signal/slot interface help

So I've read the docs, watched the video, and read issue #21 .

I'm assuming that the version in the docs is out of date since the comments in #2 suggest we only need one signal/slot.

But I seem to be missing a piece of the puzzle... What do I need to put in the form using the front end in order to connect my columns in the slot with the actual form?

Here's what I'm doing:

connect(callbackDatasource, &LimeReport::ICallbackDatasource::getCallbackData, [=] ( const LimeReport::CallbackInfo &inInfo, QVariant &outVariant ) {
   qDebug() << " getCallbackData" << outVariant << inInfo.columnName << inInfo.dataType;

   const QStringList cColumns{ "Name", "Value" };

   const int   cColumnCount = cColumns.size();
   const int   cNumRows = 4;

   switch (inInfo.dataType)
   {
      case LimeReport::CallbackInfo::IsEmpty:
         outVariant = false;
         break;

      case LimeReport::CallbackInfo::HasNext:
         outVariant = (inInfo.index != (cNumRows - 1));
         break;

      case LimeReport::CallbackInfo::ColumnHeaderData:
         outVariant = cColumns.at( inInfo.index );
         break;

      case LimeReport::CallbackInfo::ColumnData:
         outVariant = QString( inInfo.columnName + QStringLiteral( " " ) + QString::number( inInfo.index ) );
         break;

      case LimeReport::CallbackInfo::ColumnCount:
         outVariant = cColumnCount;
         break;

      case LimeReport::CallbackInfo::RowCount:
         outVariant = cNumRows;
         break;
   }

   qDebug() << "  ...returning" << outVariant;
});

...and it's never asking for data:

Debug:  getCallbackData QVariant(Invalid) "" 4
Debug:   ...returning QVariant(int, 2)	
Debug:  getCallbackData QVariant(Invalid) "" 2
Debug:   ...returning QVariant(QString, "Name")	
Debug:  getCallbackData QVariant(Invalid) "" 2	
Debug:   ...returning QVariant(QString, "Value")	
Debug:  getCallbackData QVariant(int, 0) "" 5	
Debug:   ...returning QVariant(int, 4)	
Debug:  getCallbackData QVariant(Invalid) "" 5
Debug:   ...returning QVariant(int, 4)	
Debug:  getCallbackData QVariant(int, 0) "" 5
Debug:   ...returning QVariant(int, 4)	
Debug:  getCallbackData QVariant(Invalid) "" 5	
Debug:   ...returning QVariant(int, 4)

Presumably because I need to add fields to the form. I tried adding variables with the column names, but that didn't work.

How do I add the fields to my "DataBand"?

Thanks!

Can not show again the print preview toolbar

I right clicked the toolbar of the print preview dialog and unchecked the visible action.
Now I can no longer make it visible again.
Right clicking does not provide the previous popup menu and no menu action allow that.

Mistake in code?

In the file "lrdatadesignintf.cpp" the function "MasterDetailProxyModel::fieldIndexByName" doesn't use the parameter it receives, instead it seems to compare the local "fieldName" variable to itself.

Here's the code:

int MasterDetailProxyModel::fieldIndexByName(QString fieldName) const {
  for (int i = 0; i < sourceModel()->columnCount(); ++i) {
    QString fieldName = sourceModel()->headerData(i, Qt::Horizontal, Qt::UserRole).isValid()
                            ? sourceModel()->headerData(i, Qt::Horizontal, Qt::UserRole).toString()
                            : sourceModel()->headerData(i, Qt::Horizontal).toString();
    if (fieldName.compare(fieldName, Qt::CaseInsensitive) == 0) {
      return i;
    }
  }
  return -1;
}

Copy/Paste from within a band

Designer:

  1. In Data Band I do select some existing Text Item and press Copy.
  2. This Text Item is still selected in the Report Structure tree.
  3. I do press Paste. Nothing happens.
  4. Pasting only works when the band is selected in the Report Structure tree.

Падение превью при удалении активного окна приложения

В аттаче пример. Библиотека собиралась под 4.8.6.
Ничего нажимать не нужно, после запуска вызывается превью отчёта и через 5 секунд закрывается главное окно.
PreviewReportWindow::closeEvent отрабатывает, из цикла сообщений выйти не успевает, падает.

void PreviewReportWindow::exec()
{
    bool deleteOnClose = testAttribute(Qt::WA_DeleteOnClose);
    setAttribute(Qt::WA_DeleteOnClose,false);
    setAttribute(Qt::WA_ShowModal,true);
    show();
    m_eventLoop.exec(); // <- вот тут оно падает
    if (deleteOnClose) delete this;
}

Я понимаю, что пример экзотический, но у нас это случилось в реальном приложении, поэтому решил зарепортить. Конечно, можно убить ReportEngine до того, как закроется главное окно, но не уверен, что эта проблема не вылезет где-то ещё.

deleteLime.zip

the error about "initDatasources"

for (int i=0;i<m_patternPageItem->dataBandCount() && !m_renderCanceled;i++){
lastRenderedBand = m_patternPageItem->dataBandAt(i);
initDatasources();
renderDataBand(lastRenderedBand);
if (i<m_patternPageItem->dataBandCount()-1) closeFooterGroup(lastRenderedBand);
}
When rendering new dataBand, it will reset all the datasources and that will cause my program broken. I wrote 3 datasources, the second datasource is the subdatasource of the first datasource. when the program runs to render the third datasource, it will init all the datasources, and it init the second datasource first, and my program should init the detailIterator to the begin of mainIterator's child list, which cause the error, because the mainIterator was not initial and it point to the end of the main list.
I think it maybe better for only initializing the current datasource of the data band.
Sorry for my poor english.

QT signal/slot interface

We can make slot interface same like to: ??

void setValue(int &recNo, QString &paramName, QVariant &paramValue, int reportPage)
{

if (paramName == "Name")
{
if (ui->tableWidget->item(recNo,0) == 0) return;
paramValue = ui->tableWidget->item(recNo,0)->text();
}
if (paramName == "Category") {..... blablabla

And connect:
QObject::connect(report, SIGNAL(setValue(int&, QString&, QVariant&, int)), this, SLOT(setValue(int&, QString&, QVariant&, int)));

QObject::connect(report, SIGNAL(setValueImage(int&, QString&, QImage&, int)), this, SLOT(setValueImage(int&, QString&, QImage&, int)));

For simple implementing lib?
Contruct report engi.
Load template.
conect values for template.
exec report embeded or preview or direct print.

Interest?

Ambiguous abs

file: lrimageitem.cpp

need to use std::abs

        if (shiftWidth > 0){
            point.setX(point.x()+shiftWidth/2);
        } else {
            cutX = std::abs(shiftWidth/2);  // << here
            cutWidth += shiftWidth;
        }

        if (shiftHeight > 0){
            point.setY(point.x()+shiftHeight/2);
        } else {
            cutY = std::abs(shiftHeight/2); //<< here
            cutHeigth += shiftHeight;
        }

Heavy memory consumption/usage

LimeReport can easily go over a couple of Gb of memory intake when we do have many hundred of pages to generate. For 200 pages i was around 1.5Gb of memory and it often leads to a crash with Mingw 32 bits on Windows.

After a couple of days of investigations i noticed the QTextDocument component into the TextItem class was the responsible of the memory usage. I tried a workaround with the QStaticText and i was able to reduce the memory consumption by 5 ( 300Mb for 200 pages ) but the problems is it does not support all QTextDocument features and it does break "cloneUpperPart", "cloneBottomPart" and the " canBeSplitted ", the rest seems to work fine. Maybe the solution does reside into the implementation of a "SimpleTextItem" with more basics features ...

Callback DataSource initialized before signals/slots are connected

I ran into an issue when creating a callbackDataSource with createCallbackDataSource.

LimeReport::ICallbackDatasource* callbackDatasource = _report->dataManager()->createCallbackDatasouce( "standardData" );
connect(callbackDatasource, SIGNAL(getCallbackData(LimeReport::CallbackInfo,QVariant&)),this, SLOT(getDataStandardData(LimeReport::CallbackInfo,QVariant&)));
connect(callbackDatasource, SIGNAL(changePos(const LimeReport::CallbackInfo::ChangePosType&,bool&)),this, SLOT(changePosStandardData(const LimeReport::CallbackInfo::ChangePosType&,bool&)));

During this call, the columnCount function is called. Since the signals and slots haven't been connected yet, the columnCount remains -1. When rendering a report, the datasource doesn't get refreshed at any point, so the data fields are never filled.

In my local copy of LimeReport, I added back the addCallbackDatasource function and removed the lines for DataSource holder creation. With this, I was able to get the report to be generated properly, but I doubt that this is the best way to approach this problem. Is there a way to emit the datasourcesChanged event that I'm missing?

Non-void function should return a value. lrreportengine.cpp line 523

Я понимаю, что до этого идёт if else, и оба они возвращают значение, но тогда возможно есть потенциальная проблема с тем, что никогда не вызывается m_reportRender.clear()

ReportPages ReportEnginePrivate::renderToPages()
{
    m_reportRender = ReportRender::Ptr(new ReportRender);
    dataManager()->clearErrorsList();
    dataManager()->connectAllDatabases();
    dataManager()->setDesignTime(false);
    connect(m_reportRender.data(),SIGNAL(pageRendered(int)),
            this, SIGNAL(renderPageFinished(int)));
    if (m_pages.count()){
        emit renderStarted();
        m_reportRender->setDatasources(dataManager());
        ReportPages result = m_reportRender->renderPageToPages(m_pages.at(0));
        emit renderFinished();
        return result;
    }else return ReportPages();
    m_reportRender.clear();
}

New function Currency Format

Hi, every body, I am using Limereport and find it very usefull but was lacking of some useful functions so I created and added the following function:

In file: lrscriptenginemanager.cpp
QScriptValue currencyFormat(QScriptContext* pcontext, QScriptEngine* pengine){
QVariant value = pcontext->argument(0).toVariant();
QString CurrencySymbol = (pcontext->argumentCount()>1)?pcontext->argument(1).toString():"";

// Format it using USA locale
QString vTempStr=QLocale(QLocale::English, QLocale::UnitedStates).toCurrencyString(value.toDouble());

// Replace currency symbol if necesarry
if (CurrencySymbol!="") vTempStr.replace("$", CurrencySymbol);

QScriptValue res = pengine->newVariant(vTempStr);
return res;

}

And inside: ScriptEngineManager::ScriptEngineManager():m_model(0), m_dataManager(0)
addFunction("currencyFormat",currencyFormat,"NUMBER","currencyFormat(""+tr("Value")+"",""+tr("CurrencySymbol")+"")");

With this code you can easily convert plain numbers into nice formatted currency by using:
$S { currencyFormat(1000.25,"£") }

Beside allowing you to use SUM() with passed data fields!

I pass on the code so you can include it on the next release!

Serializer is not 'stable'

When editing a report, even for small change (by example, just a width change) the saved file is then TOO MUCH different than the previous one while only a width changed.
The xml tags order is not 'stable' ie - it change place from save to save.
This could be easily fixed using a map instead of a hash for the names (if it's what is used), else consider grabbing the keys then sort them (qStableSort) before writing them.
This will a lot help users making diff against edited reports, it's actually a nightmare :)

Thanks,

Export data

Hi,
I want to export data to a .txt file, I only need data in the report ,How can I do that?

abnormal demo termination

Windows 7, Qt 4.8.7 on MinGw32 4.8.2. Application "demo_r2" terminates after double click on DemoReport1_report_header_group_subdetail report. Just before fail, it writes to console "libpng warning: iCCP: known incorrect sRGB profile".
When launching report from report designer it works normally.

'File > Save As' does not emit saveFinished

Here is the fix:

diff --git a/3rdparty/LimeReport/limereport/lrreportdesignwidget.cpp b/3rdparty/LimeReport/limereport/lrreportdesignwidget.cpp
index 1b590c3..6fe94c7 100644
--- a/3rdparty/LimeReport/limereport/lrreportdesignwidget.cpp
+++ b/3rdparty/LimeReport/limereport/lrreportdesignwidget.cpp
@@ -227,7 +227,9 @@ void ReportDesignWidget::slotItemSelected(BaseDesignIntf *item){
 }

 void ReportDesignWidget::saveToFile(const QString &fileName){
-    m_report->saveToFile(fileName);
+    if (m_report->saveToFile(fileName)) {
+        m_report->emitSaveFinished();
+    }
 }

 bool ReportDesignWidget::save()

Subreport or moveable band

I wanted to have two databands, one on the left and the other at the right of the report (kind of two columns but databands with different datasources).

To do it, I'd need a subreport or flexibles databand.

Is it possible with LimeReport?

Performance issues

We are hit by big performance issues when generating the report.
It took us ~8 seconds which is a lot.
Is there any special attention given to performance in lime report ?

Build without zint

Is there supposed to be a way to build without zint?

At the top of common.pri: CONFIG += zint which means there's really no way to leave it out without editing LimeReport's qmake files.

No way to override destination for lib, include, and bin

Because DEST_LIBS, DEST_INCLUDE_DIR, and DEST_BINS are defined in common.pri and it is included everywhere, there's no way to override the destination for the build.

Ideally I should be able to specify an INSTALL_DIR and it should create:

  • ${INSTALL_DIR}/bin/LRDesigner.app
  • ${INSTALL_DIR}/lib/liblimereport.dylib
  • ${INSTALL_DIR}/include/limereport/*.h

'Undo' after applying of Horizontal Layout breaks the movement logic

Report Designer:

  1. Add Data Band
  2. Add several Text Items into this Data Band
  3. Select Text Items and apply Horizontal Layout
  4. Press Undo and after that I can't move the items around, though can change their sizes. The only workaround is to delete Data Band and then press Undo again.
    NOTE: If don't press Undo after 3), but instead delete the Horizontal Layout in the report structure, then all the items can be moved around freely as they should be.

ReportEngine крашится, если попытаться его удалить на открытом preview

Создаём ReportEngine, передаём в него модель, вызываем previewReport. Если попытаться удалить ReportEngine, то приложение крашится. Проявляется в 1.2.1 и 1.3.9 (1.3.1 не пробовал), Qt 4.8.6.
На designReport не проявляется.

Возможно предполагается, что ReportEngine должен использоваться исключительно как синглтон. Но тогда нужен какой-либо признак, что сейчас есть открытый отчёт и функция "закрыть отчёт".

Destroying a report engine does not destroy all it's windows and lead to crash.

If we call designReport() and destroy the report engine, then the designer window empty up (normal, report destroyed) but the window itself is not destroyed and still reference destroyed object (like QSettings).
This lead to crash.
Better destroy all windows created by the engine when it's deleted.
Also, it seems we can call many time designReport() on the same engine which each time instanciate a new designer.
I don't see any valuable reason for that, it should at most allowed one designer per engine.
Please use a QPointer for the designer window and reuse it.

My actual internal patches are:

diff --git a/3rdparty/LimeReport/limereport/lrreportdesignwidget.cpp b/3rdparty/LimeReport/limereport/lrreportdesignwidget.cpp
--- a/3rdparty/LimeReport/limereport/lrreportdesignwidget.cpp
+++ b/3rdparty/LimeReport/limereport/lrreportdesignwidget.cpp
@@ -234,9 +234,15 @@ bool ReportDesignWidget::save()
         return m_report->saveToFile();
     }
     else {
-        m_report->emitSaveReport();
-        if (m_report->isSaved()) return true;
-        return m_report->saveToFile(QFileDialog::getSaveFileName(this,tr("Report file name"),"","Report files (*.lrxml);; All files (*)"));
+        if (m_report->isSaved()) {
+            m_report->emitSaveReport();
+            return true;
+        }
+        if (m_report->saveToFile(QFileDialog::getSaveFileName(this,tr("Report file name"),"","Report files (*.lrxml);; All files (*)"))) {
+            m_report->emitSaveReport();
+            return true;
+        }
+        return false;
     }
 }

diff --git a/3rdparty/LimeReport/limereport/lrreportengine.cpp b/3rdparty/LimeReport/limereport/lrreportengine.cpp
--- a/3rdparty/LimeReport/limereport/lrreportengine.cpp
+++ b/3rdparty/LimeReport/limereport/lrreportengine.cpp
@@ -67,6 +67,9 @@ ReportEnginePrivate::ReportEnginePrivate(QObject *parent) :

 ReportEnginePrivate::~ReportEnginePrivate()
 {
+    if (m_designerWindow) {
+        m_designerWindow->close();
+    }
     if (m_activePreview){
         m_activePreview->close();
     }
@@ -384,24 +387,27 @@ void ReportEnginePrivate::cancelRender()

 void ReportEnginePrivate::designReport()
 {
-    LimeReport::ReportDesignWindow* w = new LimeReport::ReportDesignWindow(this,QApplication::activeWindow(),settings());
-    w->setAttribute(Qt::WA_DeleteOnClose,true);
-    w->setWindowIcon(QIcon(":report/images/logo32"));
-    w->setShowProgressDialog(m_showProgressDialog);
+    if (!m_designerWindow) {
+        m_designerWindow = new LimeReport::ReportDesignWindow(this,QApplication::activeWindow(),settings());
+        m_designerWindow->setAttribute(Qt::WA_DeleteOnClose,true);
+        m_designerWindow->setWindowIcon(QIcon(":report/images/logo32"));
+        m_designerWindow->setShowProgressDialog(m_showProgressDialog);
+    }
+
 #if defined(Q_OS_MAC)
-    //w->showModal();
+    //m_designerWindow->showModal();
 #elif defined(Q_OS_UNIX)
-    //w->showModal();
+    //m_designerWindow->showModal();
 #endif
 #ifdef Q_OS_WIN
-    //w->setWindowFlags(Qt::Window|Qt::WindowMaximizeButtonHint|Qt::WindowCloseButtonHint|Qt::WindowMinimizeButtonHint);
-    w->setWindowModality(Qt::ApplicationModal);
-    //w->showModal();
+    //m_designerWindow->setWindowFlags(Qt::Window|Qt::WindowMaximizeButtonHint|Qt::WindowCloseButtonHint|Qt::WindowMinimizeButtonHint);
+    m_designerWindow->setWindowModality(Qt::ApplicationModal);
+    //m_designerWindow->showModal();
 #endif
     if (QApplication::activeWindow()==0){
-        w->show();
+        m_designerWindow->show();
     } else {
-        w->showModal();
+        m_designerWindow->showModal();
     }
 }

diff --git a/3rdparty/LimeReport/limereport/lrreportengine_p.h b/3rdparty/LimeReport/limereport/lrreportengine_p.h
--- a/3rdparty/LimeReport/limereport/lrreportengine_p.h
+++ b/3rdparty/LimeReport/limereport/lrreportengine_p.h
@@ -46,6 +46,7 @@ namespace LimeReport{

 class PageDesignIntf;
 class PrintRange;
+class ReportDesignWindow;

 //TODO: Add on render callback

@@ -153,6 +154,7 @@ private:
     QMainWindow* m_activePreview;
     QIcon m_previewWindowIcon;
     QString m_previewWindowTitle;
+    QPointer<ReportDesignWindow> m_designerWindow;
 };

 }

Fix for correct emit of onSave() when the report does not own a file name yet

bool ReportDesignWidget::save()
{
    if (!m_report->reportFileName().isEmpty()){
        return m_report->saveToFile();
    }
    else {
        if (m_report->isSaved()) {
            m_report->emitSaveReport();
            return true;
        }
        if (m_report->saveToFile(QFileDialog::getSaveFileName(this,tr("Report file name"),"","Report files (*.lrxml);; All files (*)"))) {
            m_report->emitSaveReport();
            return true;
        }
        return false;
    }
}

Not possible to set a file path when loading from bytearray

Sometimes you do want to load/create a new report.
So you load it from byte array, but you can not give a pre defined file path for the future save of this report.
Please expose a ReportEngine::setReportFileName() as we already have a reportFileName().
This would allow to create a new report for a given file name already known in advance.

Build error on Windows (CI)

Our windows slave do have issues building LimeReport on Windows/MinGW 4.8
The issues seems to comes from a file name in the qrc file: Control-Edit Box.png.
Not sure why it appear, the output only say: Error: not such file 'x/y/z/Control-Edit'.
We renamed the file here to replace space by _.
Could you make this change upstream please ?

thanks!

build error on 4.6

Continuing issue #51 - when building now I get error

http://pastebin.com/T7PyJpaG

I couldn't find which permissions are absent. All files in "translations" folder has rwx permissions for owner, "translations" folder self also has rwx permissions. What permissions should I add ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.