This topic is locked
[SOLVED]

 Printer Friendly Report from View

8/20/2014 3:49:09 PM
ASPRunnerPro General questions
M
Mike Nagel author

I'm trying to add a button to either the View form or List Form that would directly open the printer-friendly version of a report for the current or selected record (respectively). Per the following link, this is doable in PHPRunner:
http://www.asprunner.com/forums/topic/22465-accessing-printer-friendly-page-from-button-event-on-list-page/
I'm using ASPRunner Pro 8. How would I format the url so that the report for the current or selected record would display?
Thanks!

G
gonzalosb 8/21/2014

ok, this is trowing some ideas out, i didn't test it yet
add to view page and list page if is on the grid(next to each record)
OnServer event:



DoAssignment record, button.getCurrentRecord()

result("ID")=record("ID")



ClientAfter event:



location.href='http://xlinesoft.com/livedemo/phprunner/livedemo1/employees_print.asp?selection[]='+result["ID"]+'&a=print';;


or can be the same all on the "OnServer" event"



DoAssignment record, button.getCurrentRecord()

result("ID")=record("ID")

Response.Redirect "http://xlinesoft.com/livedemo/phprunner/livedemo1/employees_print.asp?selection[]="; & result["ID"] & "&a=print"


if on the list page will be on top and record selected over the check marks replace

button.getCurrentRecord

with

button.getNextSelectedRecord
try it and see what happen...
here is a guide to do redirection base on a button:
http://xlinesoft.com/asprunnerpro/docs/inserting_button.htm

M
Mike Nagel author 8/26/2014

It took a little fiddling, and your suggestions helped a lot. I got it to work with the following code:
OnServer:
DoAssignment record, button.getCurrentRecord()

result("EmpID")=record("EmpID")
ClientAfter:
var strEmpID = result['EmpID']

var strLogPage = "http://server/Log_print.asp?q=(EmpID~equals~" + strEmpID + ")";

location.href=strLogPage
This code redirects to the print-friendly page while assigning a filter to show only the the records whose unique record id matches the unique record id of the active record (the one being viewed).
Thanks!