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

"evaluating" a subreport's expression


stcyr1

Recommended Posts

Hi,

Can someone explain me how I can "evaluate" a subreport's expression?

I mean, I'm getting a subreport's expression using the getExpression() method:

    JRExpression expression = subreport.getExpression();

If I cast this expression into a String, I can find back my subreportexpression parameter's value ('$P{SUBREPORT_DIR} +"subreport_1.jasper"'):

    String s = expression.toString();

Now, what I would like is to find the actual filename this expression refers to. That's, translating '$P{SUBREPORT_DIR} +"subreport_1.jasper"' into "/usr/lib/reports/subreports/subreport_1.jasper"). Hopefully, without going through the JRExpression->String cast.

Is there a nice way to do that? Or am I stuck with the solution explained at http://stackoverflow.com/questions/10004800/jasper-reports-how-to-compile-subreports ?

Best regards,

Cyrille

Link to comment
Share on other sites

  • 1 month later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

This question needs some attention from someone, maybe Jasper team. I tried to find how the expressions are parsed in JasperReports source code without success. A little help would be greatly appreciated here.

 

Or maybe @stcyr1 found the response himself and didn't share it with the community ? ;)

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...