Hello ADF Developers,
In my previous post http://sameh-nassar.blogspot.com/2010/07/call-oracle-reports-from-your-adf.html I explain a way to call oracle report but this way has a problem. The problem is the report parameters appear in the URL. In this post I will explain another way to call oracle report without displaying report parameters in URL.
to call oracle report follow this steps:
1- Make a new .jsp page (for example the page name is report.jsp).
2- In faces-config.xml make a navigation rule to report.jsp with outcome "report".
3- Write this code inside the report.jsp page
4- Create ADF page (.jspx or .jsf page) then add button (this button will call the report) and in the button action write this code:
In my previous post http://sameh-nassar.blogspot.com/2010/07/call-oracle-reports-from-your-adf.html I explain a way to call oracle report but this way has a problem. The problem is the report parameters appear in the URL. In this post I will explain another way to call oracle report without displaying report parameters in URL.
to call oracle report follow this steps:
1- Make a new .jsp page (for example the page name is report.jsp).
2- In faces-config.xml make a navigation rule to report.jsp with outcome "report".
3- Write this code inside the report.jsp page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ page contentType="text/html;charset=utf-8"%> | |
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta> | |
</head> | |
<body onload="document.getElementById('form1').submit();"> | |
<form action="http://serverIp:port/reports/rwservlet" method="post" id="form1"> | |
<c:forEach var="entry" items="${sessionScope.reportMap}"> | |
<input type="hidden" name="${entry.key}" value="${entry.value}" size="100"><br> | |
</c:forEach> | |
<input type="hidden" value="username/password@orcl" name="userid" size="100"><br> | |
</form> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Map map = new HashMap(); | |
map.put("parameter1", "value"); | |
map.put("parameter2", "value"); | |
map.put("report", "reportName.rdf");// name of the report | |
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("reportMap", map); | |
return "report";// report outcome |