pattern to open viewer in js
pattern to open viewer in js
hello, would you describe how to show report in viewer in js.
in faq described only flash.
in faq described only flash.
Re: pattern to open viewer in js
Hello.
You could find a sample in c:\Users\Public\Documents\Stimulsoft Samples 2015.3\Stimulsoft Reports.PHP\JS\ folder.
Please, look at the viewer.php file.
Thank you.
You could find a sample in c:\Users\Public\Documents\Stimulsoft Samples 2015.3\Stimulsoft Reports.PHP\JS\ folder.
Please, look at the viewer.php file.
Thank you.
Re: pattern to open viewer in js
thank you.
in flash. to open report in viewer have address :
http://localhost/stimulsoft/index.php?s ... Report.mrt
how to accomplish this way when using js ?
in flash. to open report in viewer have address :
http://localhost/stimulsoft/index.php?s ... Report.mrt
how to accomplish this way when using js ?
Re: pattern to open viewer in js
Hello.
Sorry, maybe we don't understand your question.
Could you describer your issue more detailed?
Thank you.
Sorry, maybe we don't understand your question.
Could you describer your issue more detailed?
Thank you.
Re: pattern to open viewer in js
i mean i want to know how to open report in viewer using js like in flash.
below are attachment that i captured from faq of stimulsoft php.
thank you
below are attachment that i captured from faq of stimulsoft php.
thank you
- Attachments
-
- Screenshot_2015-12-08-04-38-11.png (99.96 KiB) Viewed 9609 times
-
- Screenshot_2015-12-08-04-38-29.png (108.42 KiB) Viewed 9609 times
Re: pattern to open viewer in js
Hello,
JS PHP product is more universal in use than Flash, so the usage scenarios are different. You can use the following code to work with the report using JavaScript object StiReport:
index.php
getreport.php
Thank you.
JS PHP product is more universal in use than Flash, so the usage scenarios are different. You can use the following code to work with the report using JavaScript object StiReport:
index.php
Code: Select all
var report = new Stimulsoft.Report.StiReport();
report.loadFile("getreport.php?id=<?php echo $report_id; ?>");
Code: Select all
<?php
$report_id = $_GET["id"];
$file = "reports/$report_id.mrt";
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/json');
header('Content-Disposition: attachment; filename="'.basename($file).'"');
header('Content-Length: '.filesize($file));
readfile($file);
exit;
}
?>
Re: pattern to open viewer in js
thank you.
yes i got using js. and what about using parameter. what should i do ?
yes i got using js. and what about using parameter. what should i do ?
Re: pattern to open viewer in js
Hello,
You can assign parameters from URL to the report as follows:
Also, you can optionally add code to validate the values of variables in accordance with your requirements.
Thank you.
You can assign parameters from URL to the report as follows:
Code: Select all
function getUrlVars() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,
function (m, key, value) {
vars[key] = value;
});
return vars;
}
var vars = getUrlVars();
report.dictionary.variables.list.forEach(function(item, i, arr) {
if (typeof vars[item.name] != "undefined") item.valueObject = vars[item.name];
});
viewer.report = report;
Thank you.
Re: pattern to open viewer in js
thank you.
would you like to explain to us line by line how to add/insert parameter into your code above ?
and i have try to write sql from js designer but when i addedd parameter, there can not saved.
thank you very much
would you like to explain to us line by line how to add/insert parameter into your code above ?
and i have try to write sql from js designer but when i addedd parameter, there can not saved.
thank you very much
Re: pattern to open viewer in js
Hello.
This code takes all parameters from URL and set values of variables if it exists in the report with the same name.
Could you describe your issue more detailed? Who do you add the parameter?
Thank you.
This code takes all parameters from URL and set values of variables if it exists in the report with the same name.
Could you describe your issue more detailed? Who do you add the parameter?
Thank you.