Handler not working
Posted: Thu Mar 22, 2018 4:34 am
Good afternoon, I am having trouble getting a report to run using a parameter in the Handler.php file.
I have set a variable in the report and applied it against the SQL statement using curley brackets but am having no luck getting it to run correctly.
example.
You can see in the above I use the $args->parameter then the variable name and value, but this is simply ignored.
If I hardcode the value into the report builder it works fine, but I really need to call this dynamically from PHP.
I have tried using both versions 2018.1.6 and 2018.1.8 but end up with the same result
Am I doing something wrong? Any help would be appreciated.
I have set a variable in the report and applied it against the SQL statement using curley brackets
Code: Select all
WHERE `ID` = "{Filters}"
example.
Code: Select all
<?php
require_once "stimulsoft/helper.php";
// Please configure the security level as you required.
// By default is to allow any requests from any domains.
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Engaged-Auth-Token");
$handler = new StiHandler();
$handler->registerErrorHandlers();
$handler->onBeginProcessData = function ($args) {
$args->parameters["Filters"] = "SO-100001";
return StiResult::success();
};
$handler->process();
If I hardcode the value into the report builder it works fine, but I really need to call this dynamically from PHP.
I have tried using both versions 2018.1.6 and 2018.1.8 but end up with the same result
Am I doing something wrong? Any help would be appreciated.