Home » Archived » BIRT » Several table filters : "or" condition
Several table filters : "or" condition [message #368618] |
Tue, 16 June 2009 05:59  |
Eclipse User |
|
|
|
Hi all,
When adding several items to a Table Filters, an "and" condition is
applied between each of them (ie the result is the intersection of each
filter).
Is there a way to indicate that an "or" condition should be applied (ie
the result is the addition of each filter) ?
Thanks,
Loïc
|
|
| | | | | | | | | | | | | | | | | |
Re: Several table filters : "or" condition [message #892593 is a reply to message #892434] |
Thu, 28 June 2012 12:12   |
Eclipse User |
|
|
|
Stephane,
Can you try one more thing. Modify your filter expression to something
like:
importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/temp/filterevents.txt", true ) );
out.println( "--"+row["PRODUCTCODE"]);
out.println( "---"+BirtComp.like(row["PRODUCTCODE"], "%S18%"));
out.close();
BirtComp.like(row["PRODUCTCODE"], "%S18%");
Kind of a bad way to debug, but while birt has javascript event handler
debugging, filtering does not.
Jason
On 6/28/2012 4:32 AM, Stephane Turpin wrote:
> Hi,
>
> sorry for the delay.
> I tried your report design and indeed the filter applied on the table
> works.
>
> The only difference I see between you report and mine is the data
> source, but I do not see how it could interfere in the result set.
>
> So, I am still stuck.
> Even if it works in an "AND" clause, we cannot reasonably explain to our
> clients that they can use it in an "AND" but not in an "OR" clause.
>
> So in the mean time, I took off the option of "Like" and "Between" in
> the filter choices of our product.
>
> My last resort is to download BIRT sources and in debugging mode try to
> see why it does not work.
|
|
|
Re: Several table filters : "or" condition [message #892978 is a reply to message #892593] |
Mon, 02 July 2012 04:21   |
Eclipse User |
|
|
|
Hi Jason,
ok, I tried your debugging code on a simple report design with a column "routingMode" with values in ("Electronique", "Sans routage", "Trade blotter").
If I put this code in the filter expression (Operator still at "Equal to" and value1 at "true):
importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/Temp/filterevents.txt", true ) );
out.println( "---" + row["routingMode"] + "---");
out.close();
true
In the filterevents.txt I have:
---Electronique---
---Trade blotter---
---Electronique---
---Electronique---
---Sans routage---
etc...
and my report is complete (normal, I put "true" in the last line of the filter expression)
But if I had to the filter expression a dummy BirtComp.like like this:
importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/Temp/filterevents.txt", true ) );
out.println( "---" + row["routingMode"] + "---");
out.println( "---" + BirtComp.like("Electronique", "%ctro%") + "---");
out.close();
true
then the filterevents.txt is created but empty, so is the report.
It seems that something in my environment does not recognize the BirtComp and stop processing the report.
Stephane
|
|
|
Re: Several table filters : "or" condition [message #893151 is a reply to message #892978] |
Mon, 02 July 2012 18:25   |
Eclipse User |
|
|
|
Are you running 3.7.0? Can you try the attached?
Jason
On 7/2/2012 4:21 AM, Stephane Turpin wrote:
> Hi Jason,
>
> ok, I tried your debugging code on a simple report design with a column
> "routingMode" with values in ("Electronique", "Sans routage", "Trade
> blotter").
>
> If I put this code in the filter expression (Operator still at "Equal
> to" and value1 at "true):
>
> importPackage( Packages.java.io );
> out = new PrintWriter( new FileWriter( "c:/Temp/filterevents.txt", true
> ) );
> out.println( "---" + row["routingMode"] + "---");
> out.close();
> true
>
> In the filterevents.txt I have:
>
> ---Electronique---
> ---Trade blotter---
> ---Electronique---
> ---Electronique---
> ---Sans routage---
> etc...
>
> and my report is complete (normal, I put "true" in the last line of the
> filter expression)
>
> But if I had to the filter expression a dummy BirtComp.like like this:
>
> importPackage( Packages.java.io );
> out = new PrintWriter( new FileWriter( "c:/Temp/filterevents.txt", true
> ) );
> out.println( "---" + row["routingMode"] + "---");
> out.println( "---" + BirtComp.like("Electronique", "%ctro%") + "---");
> out.close();
> true
>
> then the filterevents.txt is created but empty, so is the report.
>
> It seems that something in my environment does not recognize the
> BirtComp and stop processing the report.
>
> Stephane
|
|
|
Re: Several table filters : "or" condition [message #893152 is a reply to message #892978] |
Mon, 02 July 2012 18:25   |
Eclipse User |
|
|
|
Are you running 3.7.0? Can you try the attached?
Jason
On 7/2/2012 4:21 AM, Stephane Turpin wrote:
> Hi Jason,
>
> ok, I tried your debugging code on a simple report design with a column
> "routingMode" with values in ("Electronique", "Sans routage", "Trade
> blotter").
>
> If I put this code in the filter expression (Operator still at "Equal
> to" and value1 at "true):
>
> importPackage( Packages.java.io );
> out = new PrintWriter( new FileWriter( "c:/Temp/filterevents.txt", true
> ) );
> out.println( "---" + row["routingMode"] + "---");
> out.close();
> true
>
> In the filterevents.txt I have:
>
> ---Electronique---
> ---Trade blotter---
> ---Electronique---
> ---Electronique---
> ---Sans routage---
> etc...
>
> and my report is complete (normal, I put "true" in the last line of the
> filter expression)
>
> But if I had to the filter expression a dummy BirtComp.like like this:
>
> importPackage( Packages.java.io );
> out = new PrintWriter( new FileWriter( "c:/Temp/filterevents.txt", true
> ) );
> out.println( "---" + row["routingMode"] + "---");
> out.println( "---" + BirtComp.like("Electronique", "%ctro%") + "---");
> out.close();
> true
>
> then the filterevents.txt is created but empty, so is the report.
>
> It seems that something in my environment does not recognize the
> BirtComp and stop processing the report.
>
> Stephane
|
|
|
Re: Several table filters : "or" condition [message #893153 is a reply to message #892978] |
Mon, 02 July 2012 18:25   |
Eclipse User |
|
|
|
Are you running 3.7.0? Can you try the attached?
Jason
On 7/2/2012 4:21 AM, Stephane Turpin wrote:
> Hi Jason,
>
> ok, I tried your debugging code on a simple report design with a column
> "routingMode" with values in ("Electronique", "Sans routage", "Trade
> blotter").
>
> If I put this code in the filter expression (Operator still at "Equal
> to" and value1 at "true):
>
> importPackage( Packages.java.io );
> out = new PrintWriter( new FileWriter( "c:/Temp/filterevents.txt", true
> ) );
> out.println( "---" + row["routingMode"] + "---");
> out.close();
> true
>
> In the filterevents.txt I have:
>
> ---Electronique---
> ---Trade blotter---
> ---Electronique---
> ---Electronique---
> ---Sans routage---
> etc...
>
> and my report is complete (normal, I put "true" in the last line of the
> filter expression)
>
> But if I had to the filter expression a dummy BirtComp.like like this:
>
> importPackage( Packages.java.io );
> out = new PrintWriter( new FileWriter( "c:/Temp/filterevents.txt", true
> ) );
> out.println( "---" + row["routingMode"] + "---");
> out.println( "---" + BirtComp.like("Electronique", "%ctro%") + "---");
> out.close();
> true
>
> then the filterevents.txt is created but empty, so is the report.
>
> It seems that something in my environment does not recognize the
> BirtComp and stop processing the report.
>
> Stephane
|
|
|
Re: Several table filters : "or" condition [message #893155 is a reply to message #892978] |
Mon, 02 July 2012 18:25   |
Eclipse User |
|
|
|
Are you running 3.7.0? Can you try the attached?
Jason
On 7/2/2012 4:21 AM, Stephane Turpin wrote:
> Hi Jason,
>
> ok, I tried your debugging code on a simple report design with a column
> "routingMode" with values in ("Electronique", "Sans routage", "Trade
> blotter").
>
> If I put this code in the filter expression (Operator still at "Equal
> to" and value1 at "true):
>
> importPackage( Packages.java.io );
> out = new PrintWriter( new FileWriter( "c:/Temp/filterevents.txt", true
> ) );
> out.println( "---" + row["routingMode"] + "---");
> out.close();
> true
>
> In the filterevents.txt I have:
>
> ---Electronique---
> ---Trade blotter---
> ---Electronique---
> ---Electronique---
> ---Sans routage---
> etc...
>
> and my report is complete (normal, I put "true" in the last line of the
> filter expression)
>
> But if I had to the filter expression a dummy BirtComp.like like this:
>
> importPackage( Packages.java.io );
> out = new PrintWriter( new FileWriter( "c:/Temp/filterevents.txt", true
> ) );
> out.println( "---" + row["routingMode"] + "---");
> out.println( "---" + BirtComp.like("Electronique", "%ctro%") + "---");
> out.close();
> true
>
> then the filterevents.txt is created but empty, so is the report.
>
> It seems that something in my environment does not recognize the
> BirtComp and stop processing the report.
>
> Stephane
|
|
| |
Goto Forum:
Current Time: Tue Jul 22 18:37:42 EDT 2025
Powered by FUDForum. Page generated in 0.10424 seconds
|