Jump to content
We've recently updated our Privacy Statement, available here ×

subreport inside subreport


ondreia

Recommended Posts

Well, I'm struggling in subreports

 

I can call a subreport from my report, and pass arguments, but my question is:

can I call a subreport inside my subreport?

 

Code:

JasperReport jasperReport = (JasperReport) JRLoader.loadObject(arq);
JasperReport jasperReport2 = (JasperReport) JRLoader.loadObject(arq2);

Map parameters = new HashMap();
parameters.put("pathsubrel",arq2.toString());
parameters.put("obra", obra);
parameters.put("versao", versao);

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parametros,con);

JasperViewer jrviewer = new JasperViewer( jasperPrint, true);
jrviewer.setVisible(true);

 

I tried to do that passing the path to my subsubreport, in my parameters, but it didn´t work

 

Can anyone help me?

 

PS: I´m using IReport

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hi teodord!!!Thanks for your reply.

when i run my program, something strnage happens:

if i call my report it only show my report and my subreport but the subsubreport do not appear.

if I call my subreport , it shows my subsubreport correctly.

Am I doing something wrong??

Code:
    
Map parametros = new HashMap();
parametros.put("pathsubrel",jasperReport2);
parametros.put("pathsubrel2",jasperReport3);
parametros.put("obra", s_obra);
parametros.put("versao", versao);

JasperPrint jasperPrint2 = JasperFillManager.fillReport(jasperReport2, parametros,con);
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parametros,con);

JasperViewer jrviewer = new JasperViewer( jasperPrint, true);
jrviewer.setVisible(true);

 

thanks, i don´t know what to do more...:S

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...