2025-06-23 18:01:09 +08:00
|
|
|
|
#ifndef CCSREPORTCORE_H
|
2025-06-23 10:41:33 +08:00
|
|
|
|
#define CCSREPORTCORE_H
|
|
|
|
|
#include <QObject>
|
|
|
|
|
#include <QFile>
|
|
|
|
|
//#include "ccsbanddetail.h"
|
|
|
|
|
#include "common_types.h"
|
|
|
|
|
#include "ccsreport_global.h"
|
|
|
|
|
//#include "ccsreport.h"
|
|
|
|
|
//#include "ccstablefix.h"
|
|
|
|
|
//#include "ccscell.h"
|
|
|
|
|
//#include "ccsparagraph.h"
|
|
|
|
|
//#include "ccstext.h"
|
|
|
|
|
//#include "ccsimage.h"
|
|
|
|
|
//#include "ccscolumn.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace CCS_Report {
|
|
|
|
|
class CCSReport;
|
|
|
|
|
class CCSTableFix;
|
|
|
|
|
class CCSTableDynamic;
|
|
|
|
|
class CCSTableGroup;
|
|
|
|
|
class CCSSubTable;
|
|
|
|
|
class CCSCell;
|
|
|
|
|
class CCSParagraph;
|
|
|
|
|
class CCSText;
|
|
|
|
|
class CCSImage;
|
|
|
|
|
class CCSColumnHeader;
|
|
|
|
|
class CCSColumnContent;
|
|
|
|
|
class CCSColumnBottom;
|
|
|
|
|
class CCSBandContent;
|
|
|
|
|
class CCSBandDirectory;
|
|
|
|
|
class CCSBandAppendix;
|
|
|
|
|
class CCSBandCover;
|
|
|
|
|
class CCSBandHeader;
|
|
|
|
|
class CCSBandFooter;
|
|
|
|
|
class CCSTemplate;
|
|
|
|
|
class CCSBandWater;
|
|
|
|
|
|
|
|
|
|
class CCS_COMPASSREPORT_EXPORT CCSReportCore:public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
CCSReportCore(QObject *parent = 0);
|
|
|
|
|
~CCSReportCore();
|
|
|
|
|
void Init();
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 报告模板文件加载
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="reportURL"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
bool loadReport(const QString& reportURL);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 多个报告Band模板加载,同时进行合并;
|
|
|
|
|
/// 1、报告各个Band可单独定义;
|
|
|
|
|
/// 2、正文中的内容也可以单独定义
|
|
|
|
|
/// 3、加载时给出一组文件,实现模板的合并,生成一个Report模板文件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="listURLs"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
bool loadReportFromFiles(const QList<QString> listURLs);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载数据对象;【本期数据对象必须是CCSModelDataSet类型对象】
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="datasets"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
bool LoadData(QHash<QString, QList<QObject*>> datasets);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 输出报告
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="url">要输出的路径+文件名</param>
|
|
|
|
|
/// <param name="exporttype">输出报告文件类型:缺省是PDF</param>
|
|
|
|
|
void Export(QString url, CCSExportType::ExportTypeFlag exporttype = CCSExportType::PDF);
|
|
|
|
|
|
|
|
|
|
CCS_Report::CCSBandContent * createContentObject(const QString & moduleName, QObject *report = 0);
|
|
|
|
|
CCS_Report::CCSBandDirectory * createDirectoryObject(const QString & moduleName, QObject *report = 0);
|
|
|
|
|
CCS_Report::CCSBandAppendix * createAppendixObject(const QString & moduleName, QObject *report = 0);
|
|
|
|
|
CCS_Report::CCSBandCover * createCoverObject(const QString & moduleName, QObject *report = 0);
|
|
|
|
|
CCS_Report::CCSBandHeader * createHeaderObject(const QString & moduleName, QObject *report = 0);
|
|
|
|
|
CCS_Report::CCSBandFooter * createFooterObject(const QString & moduleName, QObject *report = 0);
|
|
|
|
|
CCS_Report::CCSBandWater * createWaterObject(const QString & moduleName, QObject *report = 0);
|
|
|
|
|
CCS_Report::CCSTemplate * createTemplateObject(const QString & moduleName, QObject *report=0);
|
|
|
|
|
|
|
|
|
|
CCS_Report::CCSParagraph * createParaObject(const QString & moduleName, QObject * parent = 0);
|
|
|
|
|
CCS_Report::CCSText * createTextObject(const QString & moduleName, QObject * parent = 0);
|
|
|
|
|
CCS_Report::CCSCell * createCellObject(const QString & moduleName, QObject * parent = 0);
|
|
|
|
|
CCS_Report::CCSColumnHeader * createColumnHeaderObject(const QString & moduleName, QObject * parent = 0);
|
|
|
|
|
//CCS_Report::CCSColunmBottom * createColumnBottomObject(const QString & moduleName, CCS_Report::CCSReport *report = 0, QObject * parent = 0);
|
|
|
|
|
CCS_Report::CCSTableFix * createTableObject(const QString & moduleName, QObject * parent = 0);
|
|
|
|
|
CCS_Report::CCSTableDynamic * createDynamicTableObject(const QString & moduleName, QObject * parent = 0);
|
|
|
|
|
CCS_Report::CCSSubTable * createSubTableObject(const QString & moduleName, QObject * parent = 0);
|
|
|
|
|
CCS_Report::CCSColumnContent * createColContentObject(const QString & moduleName, QObject * parent = 0);
|
|
|
|
|
CCS_Report::CCSColumnBottom * createBottomObject(const QString & moduleName, QObject * parent = 0);
|
|
|
|
|
CCS_Report::CCSImage * createImageObject(const QString & moduleName, QObject * parent = 0);
|
|
|
|
|
CCS_Report::CCSTableGroup * createTablegroupObject(const QString & moduleName, QObject * parent = 0);
|
|
|
|
|
|
|
|
|
|
bool saveReport(const QString & urlString, CCSReport * report, QString * errorText = 0);
|
|
|
|
|
QByteArray serialize(CCSReport * object, bool *ok = 0, QString * error = 0, const QString & moduleName = QString());
|
|
|
|
|
|
|
|
|
|
QObject * deserialize(const QByteArray &data);
|
|
|
|
|
private:
|
|
|
|
|
CCSReport* m_pReport;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // CCSREPORTCORE_H
|