Monday, November 15, 2021

Call XML/BI Publisher report form OAF Page in Oracle E-Business Suite/ Oracle APPS

 Call XML Publisher report from OAF Page in Oracle E-Business Suite/ Oracle APPS



/*
AM Code
*/
public BlobDomain getData (String strOrg)
{
BlobDomain blobDomain = new BlobDomain();

try
{

/*
XXCOMP = Aplication short name
XX_USER_LIST= Data Template Code
*/

DataTemplate datatemplate = new DataTemplate(((OADBTransactionImpl)getOADBTransaction()).getAppsContext(), "XXCOMP", "XX_USER_LIST");


Hashtable parameters = new Hashtable();
parameters.put("P_ORG",strOrg);
datatemplate.setParameters(parameters);
datatemplate.setOutput(blobDomain.getBinaryOutputStream());
datatemplate.processData();
}

catch(SQLException e)
{
throw new OAException("SQL Error=" + e.getMessage(),OAException.ERROR);
}

catch (OAException e)
{
throw new OAException("OAException" + e.getMessage(),OAException.ERROR);
}

catch(Exception e)
{
throw new OAException("Exception" + e.getMessage(),OAException.ERROR);
}
return blobDomain;
}

//--------------------------

/*
CO Code
*/

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)

{
super.processFormRequest(pageContext, webBean);
OAApplicationModule oaAM = pageContext.getApplicationModule(webBean);

if (pageContext.getParameter("Print") != null) /*On Submit Button press*/

{
String str_P_Org = pageContext.getParameter("item1"); /*Text box for input parameters. */

pageContext.writeDiagnostics(this,"P_Org: " + str_P_Org,3);
Serializable[] oaParams = {str_P_Org};

BlobDomain result = (BlobDomain)oaAM.invokeMethod("getData",oaParams);

try

{
DocumentHelper.exportDocument(pageContext,
"XXCOMP", //= Aplication short name
"XX_USER_LIST", //= Data Template Code
"en",
"US",
result.getInputStream(),
"PDF", /*Output file type*/
null
);
}
catch(OAException e)
{
System.out.println("error");
throw new OAException(" Error= " + e.getMessage(),OAException.ERROR);
}
}
}

Wednesday, May 19, 2021

Oracle Enterprise Repository for Oracle Fusion Applications Link

 https://www.oracle.com/webfolder/technetwork/docs/HTML/oer-redirect.html