I'am beginner using your report for Php. I'am using JS version. Thank you.
How to pass record Id using GET into sql query
-
Rangga Stephen
- Posts: 5
- Joined: Sat May 19, 2018 7:02 am
How to pass record Id using GET into sql query
Hello sir, how to pass record Id using php GET into sql query in Report Viewer, please see picture attachment.
I'am beginner using your report for Php. I'am using JS version. Thank you.

I'am beginner using your report for Php. I'am using JS version. Thank you.
-
Rangga Stephen
- Posts: 5
- Joined: Sat May 19, 2018 7:02 am
-
Lech Kulikowski
- Posts: 7506
- Joined: Tue Mar 20, 2018 5:34 am
Re: How to pass record Id using GET into sql query
Hello,
You can use the following query:
SELECT * FROM table WHERE Id={papar}
And on the server side in handler.php use:
In this case, parameters will be filled on the server side before data request.
Thank you.
You can use the following query:
SELECT * FROM table WHERE Id={papar}
And on the server side in handler.php use:
Code: Select all
$handler->onBeginProcessData = function ($event) {
$event->parameters["papar"] = $_GET["papar"];
return StiResult::success();
};Thank you.
-
Rangga Stephen
- Posts: 5
- Joined: Sat May 19, 2018 7:02 am
Re: How to pass record Id using GET into sql query
hello sir, thank you for your reply. I try your solution but still not working. I got "Index Not define Error"..please see picture attachment..
Last edited by Rangga Stephen on Mon May 28, 2018 12:42 am, edited 1 time in total.
-
Rangga Stephen
- Posts: 5
- Joined: Sat May 19, 2018 7:02 am
Re: How to pass record Id using GET into sql query
Here is my Handler.php...please see picture attactment
Am I missing something.. Btw can you give me a sample small project. Thank You..Sorry for my English. I am from Malaysia.
-
Lech Kulikowski
- Posts: 7506
- Joined: Tue Mar 20, 2018 5:34 am
Re: How to pass record Id using GET into sql query
Hello,
You should correct viewer.php, that send paramters in handler.php:
$options->handler = "handler.php?papar=".$_GET["papar"];
Please check the sample project in the attachment.
Thank you.
You should correct viewer.php, that send paramters in handler.php:
$options->handler = "handler.php?papar=".$_GET["papar"];
Please check the sample project in the attachment.
Thank you.
- Attachments
-
- viewer.zip
- (989 Bytes) Downloaded 767 times
-
Rangga Stephen
- Posts: 5
- Joined: Sat May 19, 2018 7:02 am
Re: How to pass record Id using GET into sql query
Thank you sir . You save my day. Now its working as expected.. Thanks for great support..
Re: How to pass record Id using GET into sql query
Hi Rangga Stephen,
No problem, please let us know if you need any help.
Thank you,
Edward
No problem, please let us know if you need any help.
Thank you,
Edward