Closed yanis60 closed 3 years ago
Hi, sorry for the long waiting! Yes, you can add the custom functions. To do this you can simply register some class inherited from QObject that contains Q_INVOKABLE methods in the report script engine.
class DemoFunctions : public QObject{
Q_OBJECT
public:
Q_INVOKABLE QString hello_message(QString msg){
return QString("Hello %1").arg(msg);
}
};
......
report->scriptManager()->moveQObjectToScript(new DemoFunctions(), "DemoFunctions");
and use it as $S{DemoFunctions.hello_message("Test")}
thank you so much, very useful feature
Hi, Is it possible de add custom functions? If yes how?