I'm trying to load XML file as dataset and show it in report viewer:
<?php
require_once 'stimulsoft/helper.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<title>Stimulsoft Reports.PHP - Viewer</title>
<style>html, body { font-family: sans-serif; }</style>
<!-- Stimulsoft Reports.JS -->
<script src="scripts/stimulsoft.reports.js" type="text/javascript"></script>
<!-- Stimulsoft JS Viewer -->
<script src="scripts/stimulsoft.viewer.js" type="text/javascript"></script>
<?php
StiHelper::init('handler.php', 30);
?>
<script type="text/javascript">
var options = new Stimulsoft.Viewer.StiViewerOptions();
options.toolbar.showSendEmailButton = true;
options.toolbar.displayMode = Stimulsoft.Viewer.StiToolbarDisplayMode.Separated;
options.appearance.fullScreenMode = true;
options.appearance.scrollbarsMode = true;
options.height = "600px"; // Height for non-fullscreen mode
var viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);
var report = new Stimulsoft.Report.StiReport();
var dataSet = new Stimulsoft.System.Data.DataSet("DatosFactura");
dataSet.readXmlFile("reports/A-1727.xml");
report.dictionary.databases.clear();
report.regData(dataSet);
report.dictionary.synchronize();
report.loadFile("reports/Factura.mrt");
viewer.report = report;
function onLoad() {
viewer.renderHtml("viewerContent");
}
</script>
</head>
<body onload="onLoad();">
<div id="viewerContent"></div>
</body>
</html>
Loading XML file as dataset, don't show any data in report viewer
Loading XML file as dataset, don't show any data in report viewer
- Attachments
-
- Result
- report.jpg (85.09 KiB) Viewed 557 times
-
- A-1727.xml
- XML File
- (5.53 KiB) Downloaded 84 times
-
- Factura.mrt
- MRt Fomrat
- (103.9 KiB) Downloaded 84 times
-
- Posts: 791
- Joined: Tue Sep 07, 2021 10:11 am
Re: Loading XML file as dataset, don't show any data in report viewer
Hello,
We need some time to investigate the issue, we will let you know about the result.
Thank you.
We need some time to investigate the issue, we will let you know about the result.
Thank you.
-
- Posts: 791
- Joined: Tue Sep 07, 2021 10:11 am
Re: Loading XML file as dataset, don't show any data in report viewer
Hello,
You should load report before calling regData:
Also we find some issue on our side and need time fix it.
We will let you know about the result.
Thank you.
#9830
You should load report before calling regData:
Code: Select all
var report = new Stimulsoft.Report.StiReport();
report.loadFile("reports/Factura.mrt");
var dataSet = new Stimulsoft.System.Data.DataSet("DatosFactura");
dataSet.readXmlFile("reports/A-1727.xml");
report.dictionary.databases.clear();
report.regData(dataSet);
report.dictionary.synchronize();
viewer.report = report;
We will let you know about the result.
Thank you.
#9830