Viewer.php and Stored Procedure parameters
Posted: Sun Dec 09, 2018 9:39 am
Hi,
I am designing my report and it just works fine in the designer with the parameters. Then when I "Publish" my project and all the files are done, it seems to be missing the code to handle my paramaters?
This is the index.php file
And this is the handler.php
Where and how should i provide my parameter @corpid?
Regards, Joakim
I am designing my report and it just works fine in the designer with the parameters. Then when I "Publish" my project and all the files are done, it seems to be missing the code to handle my paramaters?
This is the index.php file
Code: Select all
<?php
require_once "stimulsoft/helper.php";
?>
<!DOCTYPE html>
<html>
<head>
<title>Report.mrt - Viewer</title>
<link rel="stylesheet" type="text/css" href="css/stimulsoft.viewer.office2013.whiteblue.css">
<script type="text/javascript" src="scripts/stimulsoft.reports.js"></script>
<script type="text/javascript" src="scripts/stimulsoft.viewer.js"></script>
<?php
$options = StiHelper::createOptions();
$options->handler = "handler.php";
$options->timeout = 30;
StiHelper::initialize($options);
?>
<script type="text/javascript">
function Start() {
Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile("localization/sv.xml", true);
var str = Stimulsoft.System.IO.File.getFile("reports/Report.mrt");
var report = new Stimulsoft.Report.StiReport();
report.load(str);
var options = new Stimulsoft.Viewer.StiViewerOptions();
var viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);
viewer.onBeginProcessData = function (args, callback) {
<?php StiHelper::createHandler(); ?>
}
viewer.report = report;
viewer.renderHtml("viewerContent");
}
</script>
</head>
<body onload="Start()">
<div id="viewerContent"></div>
</body>
</html>
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) {
return StiResult::success();
};
$handler->process();
Regards, Joakim