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

setting query for subreport at runtime


gest

Recommended Posts

 Hello,

I am facing a problem with setting the query for my subreport at runtime. I have to be able to change the 'order by'-clause for the subreport-query at runtime (in java application).

Doing this for my master-report goes very well.

Does anyone have an idea how to do this?

I know it can be done with parameters, but I have to be able to set the order by clause of the subreport's query like

order by col1 desc, col 2 col3 asc

or 

order by col2 asc, col1 desc, col2 asc

the table will always be the same and the returned colums from the query too...

 

gr Geert

  

 



Post Edited by gest at 08/28/2009 12:48



Post Edited by gest at 08/28/2009 12:49
Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

 After doing some test on Oracle with a sql-statement that has a CASE-statement in the Order-By-clause, I 

haven't yet found a solution.

My problem is that I have to be able to set the order-by as for example column1 asc or column2 desc, ...

 

 

gr geert

Link to comment
Share on other sites

 Hey,

solved my problem by using a case-structure in the order-by of my query

order by case when par=? then ... end desc, 

                         when par=? then ... end asc, col3, col2 

...

 

 

gr gest

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