Page 1 of 1

how to send input value to index.php in php

Posted: Wed Jan 02, 2019 5:59 am
by drshail23
Hi , i want pass input field value to index.php of report viewer , so how i can send , like this
Image
And how i set Margin of page like in images from form .

Re: how to send input value to index.php in php

Posted: Wed Jan 02, 2019 12:55 pm
by HighAley
Hello.

Such settings could be set for a page of a report.
You could create a report instance and set the page margins as you need.

Code: Select all

report.pages.getByIndex(0).margins = new Stimulsoft.Report.Components.StiMargins(0, 0, 0, 0);
Thank you.

Re: how to send input value to index.php in php

Posted: Wed Jan 02, 2019 1:32 pm
by drshail23
Thank , I Set it like this in Index.php

Code: Select all

<?php
	    $report = "Report.mrt";
	    $topmargin = "10";
		$options = StiHelper::createOptions();
		$options->handler = "handler.php";
		$options->timeout = 30;
		StiHelper::initialize($options);
	?>
	<script type="text/javascript">
		function Start() {
			Stimulsoft.Base.StiLicense.loadFromFile("license.key");
            var rname = "<?php echo $report ; ?>";
            var tmargin = "<?php echo $topmargin ; ?>";

			var report = new Stimulsoft.Report.StiReport();
			report.loadFile('reports/'+rname);
			report.pages.getByIndex(0).margins = new Stimulsoft.Report.Components.StiMargins(1,1,+tmargin,0);

			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>
And its Work but problem is that i have to set this in index.php And Parameter in Hander.php And i am getting both Value , parameter and margin from same form ,
So is it possible that i get all value in hander.php and fetch in index.php

Re: how to send input value to index.php in php

Posted: Thu Jan 03, 2019 2:10 pm
by Lech Kulikowski
Hello,

Unfortunately, no, this is not implemented, because the report is rendered on the client side using JavaScript, in this case in the index.php file, and handler.php processes only some events, such as receiving data, loading and saving the report file.

Thank you.