0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-09-23 08:29:07 +03:00

Multicolumn bands rendering has been fixed

# Conflicts:
#	limereport/lrreportrender.cpp
#	limereport/lrreportrender.h
This commit is contained in:
Arin Alexander
2018-06-07 21:03:55 +03:00
46 changed files with 37539 additions and 49 deletions

Binary file not shown.

33
console/console.pro Normal file
View File

@@ -0,0 +1,33 @@
QT += core widgets
QT -= gui
CONFIG += c++11
TARGET = console
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
include(../common.pri)
INCLUDEPATH += $$PWD/../include
DEPENDPATH += $$PWD/../include
LIBS += -L$${DEST_LIBS} -llimereport
!contains(CONFIG, static_build){
contains(CONFIG,zint){
LIBS += -L$${DEST_LIBS} -lQtZint
}
}
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

BIN
console/limereport.pdf Normal file

Binary file not shown.

65
console/main.cpp Normal file
View File

@@ -0,0 +1,65 @@
#include <QApplication>
#include <QUuid>
#include <LimeReport>
#include <iostream>
#include <QDebug>
#include <QDir>
#include <QFile>
#ifdef _WIN32
#include <io.h>
#include <fcntl.h>
#endif
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QStringList vars;
LimeReport::ReportEngine report;
if (a.arguments().count() < 2 ){
std::cerr<<"Error! Report file is not specified !!";
return 1;
}
if (a.arguments().count()>2){
vars = a.arguments().at(2).split(";");
qDebug()<<vars;
foreach(QString var, vars){
QStringList varItem = var.split("=");
report.dataManager()->setReportVariable(varItem.at(0),varItem.at(1));
}
}
QString reportFile = a.arguments().at(1);
if (!report.loadFromFile(reportFile)){
qDebug()<<QDir::currentPath();
QFile::exists(reportFile);
std::cerr<<"Error! Report file \""+reportFile.toStdString()+"\" not found";
return 1;
}
QUuid uid = QUuid::createUuid();
QString uidStr = uid.toString()+".pdf";
report.printToPDF(uidStr);
QFile in(uidStr);
QFile out;
out.open(stdout, QFile::WriteOnly);
in.open(QIODevice::ReadOnly);
#ifdef _WIN32
_setmode(fileno(stdout),O_BINARY);
//qDebug()<<result;
#endif
QByteArray buffer = in.readAll();
fwrite(buffer,1,buffer.size(),stdout);
// out.write(in.readAll());
in.close();
in.remove();
// std::cout << uidStr.toStdString();
// std::cout << in.readAll().data();
// in.close();
// in.remove();
return 0;
//return a.exec();
}