Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Fields 'drop' across page when sub data range used (Read 4463 times)
Tim99
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Oct 13th, 2011
Fields 'drop' across page when sub data range used
Oct 14th, 2011 at 9:59am
Print Post  
I am trying to produce a report which has a number of entries from a related table listed down the page. It should look something like this;

Field1 SubItem1 Field2 Field3
SubItem2
SubItem3

Field1 SubItem1 Field2 Field3
SubItem2

I have used a DataRange within the main data template to list the SubItems. This all works except that the subsequent fields after the sub items start at the same level as the last sub item. The report I get looks like this;

Field1 SubItem1
SubItem2
SubItem3 Field2 Field3

Field1 SubItem1
SubItem2 Field2 Field3

This looks very odd and is not how I would like it layed out. I have experimented with using the UseDesignOrder propertry and this does resolve the problem if there is only one set of Sub Items but it does not work where there are many sets of sub items.

I have created a sample project to demonstrate the issue. Here is an example of the code;
Code
Select All
        <r:Page>
            <r:DataRange DataSource="{Binding Matters}" Size="100%,1" Background="LightBlue">
                <r:DataRange.ItemTemplate>
                    <DataTemplate>
                        <r:ItemContainer VerticalAlignment="Top" UseDesignOrder="False">
                            <r:Label Location="0,0" Size="5%,5" Text="[Ref]" VerticalAlignment="Top"/>
                            <r:DataRange Location="5%,0" Size="20%,1%" DataSource="{Binding Customer}" Background="LightGray">
                                <r:DataRange.ItemTemplate>
                                    <DataTemplate>
                                        <r:ItemContainer>
                                            <r:Label Location="0,0" Size="20%, 5" Text="[Ref]"/>
                                            <r:Label Location="20%,0" Size="80%, 5" Text="[Name]"/>
                                        </r:ItemContainer>
                                    </DataTemplate>
                                </r:DataRange.ItemTemplate>
                            </r:DataRange>
                            <r:Label Text="[Bal3]" Size="5%,5" Location="25%,0"/>
                            <r:DataRange Location="30%,0" Size="25%,1%" DataSource="{Binding Staff}" Background="LightSkyBlue">
                                <r:DataRange.ItemTemplate>
                                    <DataTemplate>
                                        <r:ItemContainer>
                                            <r:Label Location="0,0" Size="20%, 5" Text=" [code]" />
                                            <r:Label Location="20%,0" Size="80%, 5" Text="[Name]"/>
                                        </r:ItemContainer>
                                    </DataTemplate>
                                </r:DataRange.ItemTemplate>
                            </r:DataRange>
                            <r:Label Text="[Bal1]"  Location="55%,0" Size="10%,5" />
                            <r:Label Text="[Bal2]"  Location="65%,0" Size="10%,5" />
                            <r:Label Text="{Binding Bal3}"  Location="75%,0" Size="10%,5" />
                        </r:ItemContainer>
                    </DataTemplate>
                </r:DataRange.ItemTemplate>
            </r:DataRange>
        </r:Page>
 



I can email the entire project over to you if that would help.

Thanks for your help.

Tim.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Fields 'drop' across page when sub data range
Reply #1 - Oct 14th, 2011 at 11:27am
Print Post  
Is it possible to send me your database so that I don't have to recreate it locally in order to investigate this problem?

Regards,
Meppy
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Fields 'drop' across page when sub data range
Reply #2 - Oct 17th, 2011 at 2:24pm
Print Post  
Hi,

The current behavior of the data ranges is by design. The idea is that when a report generation is is run, the actual data range height becomes different from its design-time height. To prevent overlapping all subsequent elements in the report are offset vertically. Imagine the case when you have two data ranges in the report design - one above the other (which was our initial assumption of a natural report flow) - when the first data range is run, the second data range gets offset so that the data ranges do not overlap. This inherent behavior can now be turned on and off through the new CollideOnRun property of the DataRange class. You can set this property to False to make the report layout to no longer automatically adjust the position of items after a data range is run.

The updated version of the Reporting component can be downloaded from here. You can use the new property in XAML:

Code
Select All
<r:DataRange CollideOnRun="False"> 


Kind regards,
Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint