karlmcauley
08-05-2003, 05:14 AM
Dont know if this is possible, but here goes;
I have a list of reports stored in an oracle table and displayed via an sql query on an asp page. Each report has a report ID e.g. 1, 2, 3, 4, 5 etc etc. beside each report ID is an image which says run report.
If a user selects this image then i first want to test for something before running the report. Depending on if this test returns true or false i want to direct the user to a different screen?? Confused?
Code:
<%
dim theUrl
If rsTemp("repcriteria") = "Y" then
theUrl="sub_menu.asp"
else
theUrl="run_reports.asp"
end if%>
<a href=<%="theUrl"%>></a><img src="../images/darkplus.gif" width = "20" height="20"></a>
The link to the database is fine, but the problem is theUrl link within the image. Am i crazy or overlooking something or can this be done. If the criteria flag in the database is Y i need to open a page called sub_menu.asp else (if it is N) i need to open a page called run_reports.asp.....and this needs to be done on clicking the image!!
Would it be better to try a JScript function called through the onclick event of the image?
I have a list of reports stored in an oracle table and displayed via an sql query on an asp page. Each report has a report ID e.g. 1, 2, 3, 4, 5 etc etc. beside each report ID is an image which says run report.
If a user selects this image then i first want to test for something before running the report. Depending on if this test returns true or false i want to direct the user to a different screen?? Confused?
Code:
<%
dim theUrl
If rsTemp("repcriteria") = "Y" then
theUrl="sub_menu.asp"
else
theUrl="run_reports.asp"
end if%>
<a href=<%="theUrl"%>></a><img src="../images/darkplus.gif" width = "20" height="20"></a>
The link to the database is fine, but the problem is theUrl link within the image. Am i crazy or overlooking something or can this be done. If the criteria flag in the database is Y i need to open a page called sub_menu.asp else (if it is N) i need to open a page called run_reports.asp.....and this needs to be done on clicking the image!!
Would it be better to try a JScript function called through the onclick event of the image?