Jump to content

CROSSTAB: AVOID ORDER COLUMNS BY LETTER


chomikcampeon

Recommended Posts

Good Morning  People,

Another Issue, I put into different threads because It is different but I have the problem on the same report.

I am a dummy with JReports, with ireports, I have a SQL which returns a title for Crosstab column equals, that is :

 

COLUMN2            COLUMN3              COLUMN1

A                                 B                                C

 

And I see on PDF  report this result:

 

COLUMN1    COLUMN2                   COLUMN3

    C                         A                                     B       

 

Technical Enviroment:

OO. SSS : Windows XP

DDBB : Oracle 9.i

JR : 3.7.1

Could be this an issue of 7.1 ????

Thanks in advance

Ruben

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

ops. I got it not that you are talking about a crosstab, do you?

I think JasperReports orders the columns when printing a crosstab. In 99% of the cases this is a good thing, especially when you have a lot of data inside the crosstab. Why should it set the order of the columns based on the values in the first row of data?

Am I missing something?

Giulio

Link to comment
Share on other sites

 Good Morning Guilio ,

First , thanks for your answer and your time.

Well, this is the Workflow  :

- First we show every result in html and then we have to show into the same results on PDF. What is the problem? , the columns are order by a query, so, as far as I understand you we should change the query and if it is possible order alphabetically , shouldn´t  you?

 

Yours Faithfully,

 

Ruben

 

 

Link to comment
Share on other sites

No, sorry, what I mean is that I don't think there is a way to control the columns order. Whatever is the data order, JasperReports will sort the data. The sorting is based on the column value (which may be a string link in your case, but even a date, an year or a number).

The only possible solution I see is to alias your column, i.e.:

001_COLUMN_2, 002_COLUMN_3, 003_COLUMN_1

If you are then saying that columns are ordered differently when the report is exported in different formats... well I would be surprised.

 

Giulio

 

Link to comment
Share on other sites

Good Morning Guilio,

Sorry I did not explain it correctly:

 

I have a Web Page with some results form Database which are presented in HTML , nothing with JReports and its tool for report in HTML.

Then I use JReports for writting the report in PDF. My problem is I want to present the results on the same way as they are presented in HTML , the problem is JR change the order of columns.

As far as I understand I could change the name of the alias of the columns for mainteing the same order.

 

Thank you very much for your time and pacience

Best Regards

 

Ruben

 

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