Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Why I'm getting the jxls Error : Can't parse an expression rm.exec

600649Sep 30 2007 — edited Oct 1 2007
Hi,

I used the RowSet in JXLS and it's working perfectly, but I'm getting Error when I use the SQL Reporting in JXLS

Error : java.lang.RuntimeException: Can't parse an expression rm.exec('select name from Designer' )


My Java File :

package net.sf.jxls.report;

import net.sf.jxls.exception.ParsePropertyException;
import net.sf.jxls.transformer.XLSTransformer;
import net.sf.jxls.report.ReportManager;
import net.sf.jxls.report.ReportManagerImpl;


import java.sql.*;
import java.util.Map;
import java.util.HashMap;

public class QReport {
private static String templateFileName = "examples/Report/QReport.xls";
private static String destFileName = "examples/Report/QReport_Out.xls";

public static void main(String[] args) throws Exception, ClassNotFoundException, SQLException {
if (args.length >= 2) {
templateFileName = args[0];
destFileName = args[1];
}
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
Connection con = DriverManager.getConnection("jdbc:odbc:NewDB");

Map beans = new HashMap();
ReportManager reportmanager = new ReportManagerImpl(con, beans);

beans.put("rm", reportmanager);

XLSTransformer transformer = new XLSTransformer();
transformer.transformXLS(templateFileName, beans, destFileName);

}catch(Exception e){
System.out.println("Error : "+e);
}
}
}


The Excel file as follows

<jx:forEach items="${rm.exec('select name from Designer' )}" var="design">
${design.name}
</jx:forEach>



Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 29 2007
Added on Sep 30 2007
1 comment
2,611 views