how to send input value to index.php in php

Stimulsoft Reports.PHP discussion
Post Reply
drshail23
Posts: 15
Joined: Wed Jan 02, 2019 5:50 am

how to send input value to index.php in php

Post 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 .
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

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

Post 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.
drshail23
Posts: 15
Joined: Wed Jan 02, 2019 5:50 am

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

Post 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
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

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

Post 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.
Post Reply