0

Proble seeting a jasperreport component DataSource

asked 2008-12-10 16:32:47 +0800

YamilBracho gravatar image YamilBracho
1722 2

Hi I have this code in my zul page:

...

report.setSrc("/WEB-INF/reportes/CalculoInteresOtraTasa.jasper");
report.setParameters(parameters);
report.setDataSource(new org.bcv.sace.FechaExclusionDataSource(resultado.getFechaExclusionList()));
report.setType("pdf");

And got this error:

GRAVE: >>org.zkoss.zk.ui.UiException: Sourced file: inline evaluation of: ``showPDF();'' :
Error in method invocation: Method setDataSource( org.bcv.sace.FechaExclusionDataSource ) not found in class'org.zkoss.zkex.zul.Jasperreport' :
at Line: 32 :
in file: inline evaluation of: ``import org.bcv.sace.FechaExclusionDataSource; . . . '' : report .setDataSource ( new org .bcv .sace .FechaExclusionDataSource ( resultado .getFechaExclusionList ( ) ) )

Called from method: showPDF : at Line: 1 : in file: inline evaluation of: ``showPDF();'' : showPDF ( )
>>Sourced file: inline evaluation of: ``showPDF();'' :
Error in method invocation: Method setDataSource( org.bcv.sace.FechaExclusionDataSource ) not found in class'org.zkoss.zkex.zul.Jasperreport' :
at Line: 32 : in file: inline evaluation of: ``import org.bcv.sace.FechaExclusionDataSource; . . . '' :
report .setDataSource ( new org .bcv .sace .FechaExclusionDataSource ( resultado .getFechaExclusionList ( ) ) )
>>
>>Called from method: showPDF : at Line: 1 : in file: inline evaluation of: ``showPDF();'' : showPDF ( )
>> at bsh.BSHMethodInvocation.eval(Unknown Source)
>> at bsh.BSHPrimaryExpression.eval(Unknown Source)
>> at bsh.BSHPrimaryExpression.eval(Unknown Source)
>>...


However when I try this code in java works well,

java.util.Map parameters = new java.util.HashMap();
parameters.put("tituloCalculoSerie", resultado.getTituloCalculoSerie());
parameters.put("tituloConceptoIndicador", resultado.getTituloConceptoIndicador());
parameters.put("tituloCalculoConcepto", resultado.getTituloCalculoConcepto());

parameters.put("FechaInicial", resultado.getFechaInicial());
parameters.put("FechaFinal", resultado.getFechaFinal());
parameters.put("Monto", resultado.getMonto());

org.zkoss.zkex.zul.Jasperreport report = (org.zkoss.zkex.zul.Jasperreport) this.resultadoWin.getFellow("report");

report.setSrc(!chkExclusiones.isChecked() ?
"/WEB-INF/reportes/CalculoInteresOtraTasa.jasper" :
"/WEB-INF/reportes/CalculoInteresOtraTasaExclusiones.jasper");
report.setParameters(parameters);
//dataSource = new FechaExclusionDataSource(resultado.getFechaExclusionList());
report.setDatasource(new org.bcv.sace.FechaExclusionDataSource(resultado.getFechaExclusionList()));
report.setType("pdf");


Any help ?

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2008-12-10 20:33:17 +0800

YamilBracho gravatar image YamilBracho
1722 2

Man, you can believe what is the problem....
A typo...!

It is "setDatasource" instead of "setDataSource"

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2008-12-10 16:32:47 +0800

Seen: 388 times

Last updated: Dec 10 '08

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More