i have a problem for showing report using 2 tables.
here is my designer and here is the preview. it works good as expected on preview mode. and here is the index.php code
Code: Select all
<?php
require_once "stimulsoft/helper.php";
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>payrolltransferbank.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.reports.maps.js"></script>
<script type="text/javascript" src="scripts/stimulsoft.viewer.js"></script>
<?php
$options = StiHelper::createOptions();
//harus dimodif gini biar bisa terima parameter
$options->handler = "handler.php?kodepr=".$_GET["kodepr"];
$options->timeout = 300;
StiHelper::initialize($options);
?>
<script type="text/javascript">
function Start() {
Stimulsoft.Base.StiLicense.loadFromFile("license.key");
var report = Stimulsoft.Report.StiReport.createNewReport();
report.loadFile("reports/payrolltransferbank.mrt");
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) {
if ($args->connection == "MyDB")
$args->connectionString = "Server=localhost;Database=glory2a;Uid=root;";
//$args->parameters["kodepr"] = "IND-GRY2-HRD111201117103";
//di bawah ini tambahan manual. biar bisa terima GET dan HARUS DICOPY SQL QUERY di sini biar bisa populate
$args->parameters["kodepr"] = $_GET["kodepr"];
$args->queryString="select*from rekapgajiview where kodepr='{kodepr}'
and (statusstaf='F' or statusstaf='B')
and (tglkeluar is null or tglkeluar>tglakhir)
and not (norek is null)";
return StiResult::success();
$args->queryString="select*from profilepabrik";
};
$handler->process();
thanks