Page 1 of 1

Different filters for one data source

Posted: Fri Oct 19, 2012 11:46 am
by kro
Hello.

I have a problem with filters. I have a business object that contains a list of other object. Those other objects have some IDs. I want to render the list twice, each time with a different filter for the IDs, and in some cases it fails.

Here's the situation in more detail: I have a databand (with the data source set to the root object) and on this databand I have two panels with a databand each. So, two databands in one databand. The nested databands both have the same source: the list of objects with IDs. Apart from that, I have more databands on the page, and all of them have the root business object as the data source.

The filtering works fine, if in both cases the result of filtering is a non-empty list. If one or both of the lists is empty (if there are no objects that satisfy the filter condition), the whole page breaks apart: the bands with filters are rendered correctly, but every other band that has the root business object as data source disappears.

One solution to this problem would probably be placing those databands on separate pages, but I have reasons not to do this. I don't have any idea how else to fix it and I don't quite understand why this problem occurs. If you can help me in any way, I will really appreciate it.

I upload two attachments: one is a sample application that reproduces my problem. It creates the business objects and launches the Desinger. The second attachment is the report: on page 1 everything is ok, on page 2 the problem occurs and some databands are not rendered.

Re: Different filters for one data source

Posted: Fri Oct 19, 2012 1:10 pm
by kro
Update: it seems that I have found the solution to my problem. The databands that have the root business object as the data source all must have the property 'PrintIfDetailEmpty' set to true.

I'm not sure whether or not to delete my post, but I think I'll leave it here. Maybe someone else with a similar problem will find this helpful.

Re: Different filters for one data source

Posted: Fri Oct 19, 2012 1:14 pm
by Alex K.
Hello,

Thank you for the information about the solution.

Re: Different filters for one data source

Posted: Mon Oct 22, 2012 7:38 am
by kro
Hello again.
I still have some questions. It seems that the report engine assumes that there is a master-detail relation between the bands on my page, even though I did not assign a master component to any of the bands. This happens whenever I have a business object (let's call it RootBO) with a child object (let's call it ChildBO) used as data source for several bands on one page.

For example, if I have something like this:

DataBand1; Business Object: RootBO
DataBand2; Business Object: RootBO
DataBand3; Business Object: RootBO.ChildBO

The output will be:

[content of RootBO]
[content of ChildBO]
[content of RootBO]
[content of ChildBO]

Apparently, the band with RootBO becomes the master component and the last band is output every time the master component is rendered.

So my question is: is this how it's supposed to work? Should I get a master-detail relation even if I did not assign a master component?

Re: Different filters for one data source

Posted: Mon Oct 22, 2012 1:10 pm
by HighAley
Hello.
kro wrote:So my question is: is this how it's supposed to work? Should I get a master-detail relation even if I did not assign a master component?
The master-detail report depends on the business objects structure. So you don't need to set the relation. It is already in the BO.

Thank you.

Re: Different filters for one data source

Posted: Mon Oct 22, 2012 1:13 pm
by kro
Well, that makes sense. Thank you for your help.

Re: Different filters for one data source

Posted: Tue Oct 23, 2012 9:05 am
by Alex K.
Hello,

Let us know if you need any additional help.

Thank you.