l857713 Posted March 3, 2017 Share Posted March 3, 2017 Hello,my column has the following structure++++++Value++++++A1B2C3 Now i have two Column Headers and two fields in my Detail Band, like this. Header 1 Header 2$F{Value} $F{Value} What i try to achieve ist this output.Header 1 Header 2A 1B 2C 3 Is there a way to accomplish this? I tried several things in SQL and the Expression Editor etc. unfortunately nothing worked.Thank you in Advance. Link to comment Share on other sites More sharing options...
reportdev Posted March 3, 2017 Share Posted March 3, 2017 you can try using this sql. I have used Oracle. let me know if you need it in any other databaseselect header1, header2 from (select decode(mod(rownum/2,1), 0.5, main.id) as header1,lead(main.id, 1, 0) over (order by rownum) as header2from (select 'A' as id from dual union allselect '1' as id from dual union allselect 'B' as id from dual union allselect '2' as id from dual union allselect 'C' as id from dual union allselect '3' as id from dual union allselect 'D' as id from dual union allselect '4' as id from dual) main )where header1 is not null[/code] Link to comment Share on other sites More sharing options...
l857713 Posted March 6, 2017 Author Share Posted March 6, 2017 Thank you for your reply. I tried to transform the code myself fitting for a MySQL database, but i failed.Could you please help me out? However i think its quite unusual JasperStudio doesn't provide a solution itself, because thats a common 1 to many database with many values associated to one key. In my case: ++++++ ++++++Key Value++++++ ++++++1 A1 12 B2 23 C3 3 Well i am glad for every explanation, since i'm new to all this stuff. Thanks in advance Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now