Oh, Peter. Thank you so much - I have spent the whole evening trying to get this to work! I downloaded the new release.6.0.16 and have tried that out. The parameter still doesn't work.
I don't know what I am doing wrong! I am going to explain it step by step, to see if you can do it (as it is 3am and I need to get to sleep!)
I have a button on my webpage that encodes variables into the URL and opens a Reportico Report. So it opens the Reportico criteria entry page, with the following URL:
http://MYWEBSITEADDRESS/PurchOrder.php?jobid=18159&clear_session=1
The SQL in my Report is:
SELECT Suppliers.supplierid, Suppliers.supplier, address, address2, address3, address4, postcode, Job_Items.jobid, Suppliers.accref, Job_Items.quantity, Products.prodcode, Products.item, unitcost
FROM Products RIGHT OUTER JOIN Job_Items ON Products.productid = Job_Items.item, Suppliers
WHERE Suppliers.supplierid = Job_Items.supplier
AND Job_Items.jobid = "{USER_PARAM,jobid}"
[AND Suppliers.supplier = {Supplier}]
If I enter a static jobid like the following:
SELECT Suppliers.supplierid, Suppliers.supplier, address, address2, address3, address4, postcode, Job_Items.jobid, Suppliers.accref, Job_Items.quantity, Products.prodcode, Products.item, unitcost
FROM Products RIGHT OUTER JOIN Job_Items ON Products.productid = Job_Items.item, Suppliers
WHERE Suppliers.supplierid = Job_Items.supplier
AND Job_Items.jobid = 18159
[AND Suppliers.supplier = {Supplier}]
The Report works perfectly!!
But, I need it to be dynamic and called based on whatever record the user is viewing. My button passes the correct parameter to the URL, but Reportico does not seem to pick it up.
I have the clear session in the URL. I also have it in my calling script. My calling script is
all the reportico initial project and bootstrap stuff comes first
// Initialize session
Reportico\Engine\ReporticoSession::setUpReporticoSession($q->session_namespace);
// pass criteria from original webpage
$q->user_parameters = array();
$q->user_parameters["jobid"] = $_POST['jobid'];
$q->clear_reportico_session = true; // IMPORTANT - initialises session for initial parameters above to take effect
$q->reportico_ajax_mode = true; // If set to true will run all reportico requests from buttons and links through AJAX, meaning reportico will refresh in its own window and not refresh the whole page
$q->force_reportico_mini_maintains = true; // Often required
$q->show_refresh_button = true; // Indicates whether report output should include a refresh button
$q->execute();
As I mentioned, if I put a static number into the SQL, the report works perfectly. But it just won't pull the jobid parameter from the URL. I have tried
$q->user_parameters["jobid"] = $GET['jobid'];
$q->user_parameters["jobid"] = ["jobid"];
$q->user_parameters["jobid"] = ['jobid'];
$q->user_parameters["jobid"] = $SESSION['jobid'];
And now I am tearing my hair out trying to get this to work!! Please can you point me in the right direction?
PS - I am very grateful for all your hard work, which has made my life as a non-coder (using copious amounts of Google) much easier. Does your donation link still work? I donated a couple of years ago, but I notice the donation link has disappeared from the homepage (although I found it again after much googling!) Is it ok if I use that link to thank you for the work you have put in?