5 @SuppressWarnings public class ReportEngine : QObject{
6 enum DataType{IsEmpty, HasNext, ColumnHeaderData, ColumnData, ColumnCount, RowCount};
7 enum ChangePosType{Invalid = -1,
First, Next};
8 enum PreviewHint{ShowAllPreviewBars = 0,
9 HidePreviewToolBar = 1,
10 HidePreviewMenuBar = 2,
11 HidePreviewStatusBar = 4,
12 HideAllPreviewBar = 7,
13 PreviewBarsUserSetting = 8};
15 static class ICallbackDatasource : QCore {
20 interface RenderListener{
26 RenderListener listener = nilptr;
37 dataSource.nativehandle = QtXnl.long_object_string(nativehandle, Constant.REGDATASOURCE, dataSource, name);
38 if (dataSource.nativehandle == 0){
45 nativehandle = QtXnl.createQObject(QType.qtReportEngine,
this, 0);
46 if (nativehandle == 0){
52 bool create(@NotNilptr QWidget parent){
53 nativehandle = QtXnl.createQObject(QType.qtReportEngine,
this, parent.nativehandle);
54 if (nativehandle == 0){
61 if (listener != nilptr){
62 listener.renderStarted(
this);
67 if (listener != nilptr){
68 listener.renderPageFinished(
this, renderedPageCount);
73 if (listener != nilptr){
74 listener.renderFinished(
this);
79 return QtXnl.widget_set_intstring_value(nativehandle, Constant.LOADREPORTFROMFILE, 0, reportTemplate) != 0;
83 return QtXnl.widget_set_intstring_value(nativehandle, Constant.LOADREPORTFROMTEXT, 0, reportTemplateText) != 0;
87 QtXnl.widget_set_vint_value(nativehandle, Constant.SHOWREPORT, hint);
Object getCallbackData(DataType dataType,int index, String columnName)
bool changePos(ChangePosType type)
bool create(@NotNilptr QWidget parent)
void previewReport(PreviewHint hint)
bool loadFromFile(String reportTemplate)
ReportEngine(long handle)
bool registryDataSource(String name,@NotNilptr ICallbackDatasource dataSource)
bool loadFromString(String reportTemplateText)
void renderPageFinished(int renderedPageCount)
void renderPageFinished(ReportEngine engine, int renderedPageCount)
void renderFinished(ReportEngine engine)
void renderStarted(ReportEngine engine)