Sorting String data otherwise than alphabetically
#2
Posted 18 July 2012 - 01:12 PM
#3
Posted 18 July 2012 - 11:37 PM
The way I would like to do that is without writing any script or expression.
With the computed column, I guess I have no solution than writing an expression to test if the value of my state is "A", "B" or "C" and returning the corresponding value (like "3", "1", "2").
Is there an easy way for end users (who are not developpers) to sort their data like that ?
#4
Posted 19 July 2012 - 06:25 AM
#5
Posted 19 July 2012 - 07:51 AM
So, yes, I am developper and I would be ok with some script but what I want to do it's finding the easiest way for the end user to sort a field with only few value possible.
Here is an example:
This is how the data appear in a table :
Order num -------- Order state
01 -------------------- To be billed
02 -------------------- Billed
03 -------------------- Billed
04 -------------------- To be billed
05 -------------------- Canceled
06 -------------------- Billed
07 -------------------- Canceled
08 -------------------- To be billed
09 -------------------- To be billed
10 -------------------- Billed
And this is how the end user should be able to sort it :
Order num -------- Order state
01 -------------------- To be billed
04 -------------------- To be billed
08 -------------------- To be billed
09 -------------------- To be billed
02 -------------------- Billed
03 -------------------- Billed
06 -------------------- Billed
10 -------------------- Billed
05 -------------------- Canceled
07 -------------------- Canceled
This is not the alphabetical way so that means that it's the end user who choose which one is the first, the second etc ... in any simple way, which is my question : How could they be able to do that ?
BIRT versions are 3.7.2 and 4.2.0.
Thank you for your time.
#6
Posted 19 July 2012 - 12:35 PM
Choose a Sort Order:
1 - Billed, Canceled, To be billed
2 - Billed, To be billed, Canceled
3 - Canceled, Billed, To be billed
4 - Canceled, To be billed, Billed
5 - To be billed, Billed, Canceled
6 - To be billed, Canceled, Billed
And then use their parameter selection in your computed column to assign the correct value for the sort.
Then, all the end user ever has to do is select an order. No coding whatsoever.
#7
Posted 20 July 2012 - 12:10 AM
It might be something like that :
if(row["state"]=="To be billed"){
1}
else if(row["state"] == "Billed"){
2}
else{
3}
In my application, I will generate the report with datasource/dataset, and after, they will have to deal with the sorting in RCP Designer by their own.
My app will generate hundreds of reports, and it is not possible that a developper or a birt expert have to intervene in each case. So my question is : is the computed column expression code above the only way for the end user to sort a String data precising the order he want ?
#8
Posted 20 July 2012 - 06:53 AM
#9
Posted 20 July 2012 - 07:43 AM
- Extracting data from the database in a XML File
- Parsing the XML file to retrieve the data
- Creating an empty rptdesign file
- Building DataSource and DataSet
- Adding a table with non sorted data from the DataSet
- Saving the rptdesign file in the workspace folder of the RCP Designer
Here is what the end user must do :
- Launch RCP Designer
- Open the generated rptdesign from the shared resource folder (workspace)
- Sort the data by the state field and by the order he wants
mwilliams, on 20 July 2012 - 07:53 AM, said:
I cannot handle the computed column programmatically because I don't even know if the end user will want to do this kind of sort and on which field he would be interested to do it.
mwilliams, on 20 July 2012 - 07:53 AM, said:
Yes the reports are completed but not sorted. And I can't create a parameter for every field and every order possible because it would be nonsense.
mwilliams, on 20 July 2012 - 07:53 AM, said:
I completely understand that, and this is exactly what I am asking. What is this work ? How the end user could be able to do that ?
mwilliams, on 20 July 2012 - 07:53 AM, said:
I would like you give me all methods for the end user to be able to enter the order, please
I hope to be more precise in my explanations this time.
#10
Posted 20 July 2012 - 08:22 AM
#11
Posted 22 July 2012 - 11:21 PM
So yes, there will be variance depending on the end user.
EDIT :
(By the way, it is possible to open a rptdesign file directly in BIRT using a command option. Just to avoid going in File>Open File ... Thank you)
#12
Posted 23 July 2012 - 01:45 PM
http://www.birt-exch...tom-sort-order/
Hope this helps.
#13
Posted 23 July 2012 - 11:47 PM
What about my other question :
Is it possible to open a rptdesign file in BIRT using a command option ?
(Just to avoid going in File>Open File ... etc)
I am looking for something like that :
C:\Users\vl\Path\to\Birt\BIRT.exe -report C:\reports\report.rptdesign
Is there a way to do that ?
#14
Posted 24 July 2012 - 07:11 AM






MultiQuote





