JDev11g Export Table To Excel

Posted by Steve Racanovic | Posted in | Posted on 9:11 AM

0

JDev 11g offers a simple way to export an ADF table to excel in a couple simple steps.

1. Create af:panelCollection on the jspx page.
2. Drag a data control onto af:panelCollection and drop it as table.
3. Set af:table id to table.
4. Expand Panel Collection facets, and drop af:toolbar on toolbar facet.
5. Drop af:commandButton on af:toolbar. Set the text to "Export To Excel"
6. Drop af:exportCollectionActionListener on af:commandButton. And set the following:

ExportId: table
Type: excelHTML
Filename: Emp.xls
Title: Employees.

The exportId needs to bind to the af:table id. Which we set as 'table' in step 3

7. Run the jspx page and test the export button.


This is how the my final code looks like:


<panelCollection>
<facet name="menus"/>
<facet name="toolbar">
<toolbar>
<commandButton text="Export To Excel">
<exportCollectionActionListener exportedId="table" type="excelHTML"
filename="Emp.xls" title="Employees"/>
</commandButton>
</toolbar>
</facet>
<facet name="statusbar"/>
<table value="#{bindings.EmpView1.collectionModel}" var="row"
rows="#{bindings.EmpView1.rangeSize}"
emptyText="#{bindings.EmpView1.viewable ? 'No rows yet.' : 'Access Denied.'}"
fetchSize="#{bindings.EmpView1.rangeSize}" filterVisible="false"
id="table">
<column sortProperty="Empno" sortable="false"
headerText="#{bindings.EmpView1.hints.Empno.label}"
filterable="false">
<outputText value="#{row.Empno}">
<convertNumber groupingUsed="false"
pattern="#{bindings.EmpView1.hints.Empno.format}"/>
</outputText>
</column>
...
...
...
</table>
</panelCollection>

Jdev 11g Web Service WSDL Parameter Name

Posted by Steve Racanovic | Posted in , | Posted on 11:01 AM

2


With Jdev 11g, after generating a Web Service from a java class, the WSDL contains the following
parameter names:

...
<xsd:complexType name="sayHello">
<xsd:sequence>
<xsd:element name="arg0" type="xsd:string"/>
<xsd:element name="arg1" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
...

My java code function looks like:
...
public String sayHello(String firstname, String lastname) {
return "Hello " + firstname + " " + lastname;
}
...

With Jdev 10g , the same code generates the appropriate values:
...
<xsd:complexType name="sayHello">
<xsd:sequence>
<xsd:element name="firstname" type="xsd:string"/>
<xsd:element name="lastname" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
...

To workaround this in 11g, I need to create my java class as follows:

package project1;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

@WebService
public class Class1 {
@WebMethod
public String sayHello(@WebParam(name = "fname") String firstname,
@WebParam(name = "lname") String lastname) {
return "Hello " + firstname + " " + lastname;
}
}

And now my generated WSDL looks like:
...
<xsd:complexType name="sayHello">
<xsd:sequence>
<xsd:element name="fname" type="xsd:string"/>
<xsd:element name="lname" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
...

http://java.sun.com/javaee/5/docs/api/javax/jws/WebParam.html