Skip to main content



      Home
Home » Archived » BIRT » Sorting
Sorting [message #362886] Thu, 29 May 2008 16:57 Go to next message
Eclipse UserFriend
Hi all,
I've run into a sorting issue I would appreciate some help on.
Say I have a 2x2 grid. The first column has a label I put in and the
second column has two tables deriving the data from the same data set but
using a different parameter.

For example:
SELECT number FROM table WHERE date = ?
"date1" => "222"
"date2" => "111"

The grid would look like this:

Label Table w/ Data
-------------------
| A | 222 |
-------------------
| B | 111 |
-------------------

How can I add a sort where the rows are displayed based on the ascending
value of the second column? It would end up looking like this:

-------------------
| B | 111 |
-------------------
| A | 222 |
-------------------

I've tried multiple things, like selecting both tables at the same time.
I've tried adding a sort parameter by selecting the tables individually,
however that doesn't do anything when I hit "preview".

Any advice or hints?

Thanks!
Ameena
Re: Sorting [message #362888 is a reply to message #362886] Thu, 29 May 2008 17:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.w.geary.saic.com

Ameena.

I dont quite understand your question. In particular you said "both
tables" but I only see one.

Not sure if this answers your question, but in your dataset sql query
you could add ... ORDER BY date1 ASC, date2 DESC .. or something
similiar.
of course you could parameterize either the column(s) to sort on or the
direction.

bg
Re: Sorting [message #362889 is a reply to message #362888] Thu, 29 May 2008 18:16 Go to previous messageGo to next message
Eclipse UserFriend
Hi BG,
Sorry if I did not write it clear enough. Let me try again.

I have a 2x2 GRID (not a table):
-----------
| A1 | A2 |
-----------
| B1 | B2 |
------------

In A1 and B1, I have a label that I've added.
In A2 and B2 however, I've added a 1x1 TABLE to each section. So 2 tables
total. Each table is bounded to the same exact Data Set but with a
different parameter.

For example the data set has the sql query: SELECT number FROM table WHERE
date=?

So when I hit preview, I would get this
-------------
| A1 | 222 |
-------------
| B1 | 111 |
--------------

So I would like to know how to apply a sort where the resultant data in a
whole column is taken into consideration. I'd like to avoid adding an
"order by" column to my sql statement since in reality, I may have
completely different sql statements. So I would hope that BIRT could sort
based on the final numbers (like in A2 and B2) and I would end up with
this:
-------------
| B1 | 111 |
-------------
| A1 | 222 |
--------------


I hope this explanation makes more sense.

Also, could you expound on this statement: "of course you could
parameterize either the column(s) to sort on or the direction".


Thanks,
Ameena



badguy wrote:

> Ameena.

> I dont quite understand your question. In particular you said "both
> tables" but I only see one.

> Not sure if this answers your question, but in your dataset sql query
> you could add ... ORDER BY date1 ASC, date2 DESC .. or something
> similiar.
> of course you could parameterize either the column(s) to sort on or the
> direction.

> bg
Re: Sorting [message #362906 is a reply to message #362889] Fri, 30 May 2008 10:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.w.geary.saic.com

Hi Ameena:

Since I cannot see your data and I am not quite sure what you are trying
to do with this report it is hard to answer. I am not an expert at BIRT
and may be over my head here ;)

(1) I do not think you can have a dependent sort from table to table. You
may be able to if you do some Javascript or access the JAVA api. But I
assume that you do not wish to do it this way.

(2) Maybe if you use a nested table/sub reports versus two seperate tables.
Maybe this may be of use to you..

http://download.eclipse.org/birt/downloads/examples/reports/ 2.1/subreport/subreport.html



BG

<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Hi BG,
Sorry if I did not write it clear enough. Let me try again.

I have a 2x2 GRID (not a table):
-----------
| A1 | A2 |
-----------
| B1 | B2 |
------------

In A1 and B1, I have a label that I've added.
In A2 and B2 however, I've added a 1x1 TABLE to each section. So 2 tables
total. Each table is bounded to the same exact Data Set but with a
different parameter. For example the data set has the sql query: SELECT
number FROM table WHERE date=?

So when I hit preview, I would get this
-------------
| A1 | 222 | -------------
| B1 | 111 |
--------------

So I would like to know how to apply a sort where the resultant data in a
whole column is taken into consideration. I'd like to avoid adding an
"order by" column to my sql statement since in reality, I may have
completely different sql statements. So I would hope that BIRT could sort
based on the final numbers (like in A2 and B2) and I would end up with
this:
-------------
| B1 | 111 | -------------
| A1 | 222 |
--------------


I hope this explanation makes more sense.

Also, could you expound on this statement: "of course you could
parameterize either the column(s) to sort on or the direction".


Thanks,
Ameena
Re: Sorting [message #362911 is a reply to message #362906] Fri, 30 May 2008 10:54 Go to previous message
Eclipse UserFriend
Hi BG,
Thanks for attempting to answer. I'm going to post the question again to
the board and use part of your response in my question, since I think I
made it too complicated by giving an example of what I was trying to do! :)

Ameena
Previous Topic:PDF Digital Signature
Next Topic:totalpage alignment
Goto Forum:
  


Current Time: Thu Aug 21 11:36:13 EDT 2025

Powered by FUDForum. Page generated in 0.26412 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top