Custom report page

You can create and attach custom report pages to reports. A custom report page is a web page that you create using any scripting language, such as ASP or JSP. You must save the custom report page in a web-addressable location before using the Events feature in Reporting Services to link a report to the custom page.

Reporting Services includes a sample custom report page called Sample_Custom_Report_Page.jsp and a sample report called Sample_Custom_Report_Page.rpt, which are located in the web application services location where Reporting Services is installed.

Sample_Custom_Report_Page.jsp

<%@ page import="com.lawson.efs.EFSRepository"%>
<%
    EFSRepository oEFSRepository = new EFSRepository();

    //*********************************************************************
    //DEFINE A Separate one for each Dynamic Value if the come from 
      different Queries.
    //**********************************************************************
    java.sql.ResultSet rs1;
    String SQLQuery1 = "SELECT DISTINCT AUTHOR FROM ERS_DOCS";
    //*************************************************************

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-16"/>
<meta HTTP-EQUIV="Pragma" CONTENT="No-Cache"/>
<meta HTTP-EQUIV="Expires" CONTENT="Mon, 01 Jan 1990 00:00:01 GMT"/>
<title>Report Publishing Wizard</title>
<link rel="stylesheet" type="text/css" href="styles/ersMain.css">
</head>
<script language="javascript">

var remURL = '<%=request.getParameter("remurl")%>'
var id = '<%=request.getParameter("fsuserid")%>'

function SizeWindow()
{
//    alert('<%=request.getQueryString()%>')
    CurrentWindow=1;
    window.dialogWidth='550px';
    window.dialogHeight='400px';
    document.getElementById('efsid').innerHTML = "Hello " + id
}
function SubmitRequest()
{
    window.location.href=remURL + "&selmode=R&selformula={ERS_DOCS.Author}"
 + "%3D" + "'" + document.all.item("FIELD1").value + "'";
}
</script>
<body class="ersWizardBody" onload="javascript:SizeWindow();">

<%
out.println("<span id='efsid' name='efsid' class='ersScreenTitle'>
</span><br><br>");
//fill resultset

rs1 = oEFSRepository.ExecuteToResultSet("SELECT DISTINCT AUTHOR FROM 
ERS_DOCS ORDER BY AUTHOR");

if (rs1 == null) {
%>
<table>
	<tr>
		<td>
			No Records Exist
		</td>
	</tr>
</table>
<%
}
//other wise start building dropdown box
else {
    String strResult="";
    strResult = strResult + "<table><tr><td class='ersFieldLabel'>Author
</td><td><select class='ersFieldInput' id='FIELD1' name='FIELD1'>";
	while(rs1.next())
		{
            strResult = strResult + "<option value='" + rs1.getString
            ("AUTHOR") + "'>" + rs1.getString("AUTHOR") + "</option>";
    }
    strResult = strResult + "</select></td></tr></table>";
    out.println(strResult);
    rs1.close();

}

%>
<hr>
<input type="button" class="ersActionButton" onclick="SubmitRequest()"
 value="Submit Request"></input>
</body>
</html>
<%
    oEFSRepository.closeExistingConnection();
%>