Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) The empty DataRange can NOT be exported to PDF (Read 16653 times)
luolishuang
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 40
Joined: Feb 22nd, 2013
The empty DataRange can NOT be exported to PDF
May 14th, 2013 at 9:44am
Print Post  
The empty DataRange can NOT be exported to PDF

any solution??
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: The empty DataRange can NOT be exported to PDF
Reply #1 - May 14th, 2013 at 11:09am
Print Post  
Hi,

Currently empty data ranges are not displayed in reports. You can set DataRange.Repeat to 1 for the data range to force it to have one instance.

Let me know if this helps.

Regards,
Meppy
  
Back to top
 
IP Logged
 
luolishuang
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 40
Joined: Feb 22nd, 2013
Re: The empty DataRange can NOT be exported to PDF
Reply #2 - May 15th, 2013 at 3:25am
Print Post  
but I wanna to control the datarange to display or not by condition.

any solution?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: The empty DataRange can NOT be exported to PDF
Reply #3 - May 15th, 2013 at 5:33am
Print Post  
Try setting DataRange.Repeat to 1 for the empty data ranges that you want to be visible. Make sure that DataRange.DataSource is set to null in this case. You can also set Repeat in the QueryDetails event handler for nested data ranges. In this case set QueryDetailsEventArgs.Details to null.

Regards,
Meppy
  
Back to top
 
IP Logged
 
luolishuang
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 40
Joined: Feb 22nd, 2013
Re: The empty DataRange can NOT be exported to PDF
Reply #4 - May 15th, 2013 at 6:43am
Print Post  
Meppy wrote on May 15th, 2013 at 5:33am:
Try setting DataRange.Repeat to 1 for the empty data ranges that you want to be visible. Make sure that DataRange.DataSource is set to null in this case. You can also set Repeat in the QueryDetails event handler for nested data ranges. In this case set QueryDetailsEventArgs.Details to null.

Regards,
Meppy


Hi,

This still display the DataRange, but I wanna to control the DataRange invisible.

any solution?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: The empty DataRange can NOT be exported to PDF
Reply #5 - May 15th, 2013 at 8:12am
Print Post  
Can you provide me with a sample with your report and specify which data ranges in this report you want to show or hide?

Regards,
Meppy
  
Back to top
 
IP Logged
 
luolishuang
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 40
Joined: Feb 22nd, 2013
Re: The empty DataRange can NOT be exported to PDF
Reply #6 - May 15th, 2013 at 9:01am
Print Post  
Meppy wrote on May 15th, 2013 at 8:12am:
Can you provide me with a sample with your report and specify which data ranges in this report you want to show or hide?

Regards,
Meppy


Hi, the xaml sample code below:
Code (HTML)
Select All
            <r:DataRange DataSource="{Binding QuestionTable}" Size="100%,100">
                <r:DataRange.ItemTemplate >
                    <DataTemplate >
                        <r:ItemContainer >
                            <r:DataRange  Name="AnswerList" Location="0%,60" Size="100%,20">
                                <r:DataRange.ItemTemplate>
                                    <DataTemplate>
                                        <r:ItemContainer>
                                            <r:Label Location="0%,0" Size="30%,20"  Background="{Binding QTitle}" BorderBrush="#ACE6EF"  BorderThickness="1,0,1,1" Padding="5,0,0,0" Text="[SID]" />
                                            <r:Label Location="30%,0" Size="30%,20"  Background="{Binding QTitle}" BorderBrush="#ACE6EF" BorderThickness="0,0,1,1" Padding="5,0,0,0" Text="[SName]"/>
                                            <r:Label Location="60%,0" Size="40%,20"  Background="{Binding QTitle}" BorderBrush="#ACE6EF" BorderThickness="0,0,1,1" Padding="5,0,0,0" Text="[SReply]"/>
                                        </r:ItemContainer>
                                    </DataTemplate>
                                </r:DataRange.ItemTemplate>
                            </r:DataRange>

                            <r:DataRange  Name="EliminationList" Location="0%,100" Size="100%,20" >
                                <r:DataRange.HeaderTemplate>
                                    <DataTemplate>
                                        <r:ItemContainer Size="100%,20">
                                            <!--EliminationList-->
                                            <r:Label  Location="0%,0" Size="100%,20" Background="#B8DAE3" BorderBrush="#ACE6EF" BorderThickness="1,0,0,0" Padding="5,0,0,0" Text="Elimination List" FontSize="14" />
                                        </r:ItemContainer>
                                    </DataTemplate>
                                </r:DataRange.HeaderTemplate>
                                <r:DataRange.ItemTemplate>
                                    <DataTemplate>
                                        <r:ItemContainer>
                                            <r:Label Location="0%,0" Size="100%,20" BorderBrush="#ACE6EF"  BorderThickness="1,1,1,0" Padding="5,0,0,0" Text="[SName]"/>
                                        </r:ItemContainer>
                                    </DataTemplate>
                                </r:DataRange.ItemTemplate>
                            </r:DataRange>
                        </r:ItemContainer>
                    </DataTemplate>
                </r:DataRange.ItemTemplate>
            </r:DataRange> 



I wanna to control "EliminationList" DataRange to show or hide.

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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: The empty DataRange can NOT be exported to PDF
Reply #7 - May 15th, 2013 at 9:44am
Print Post  
You can handle the QueryDetails event of the report, inspect the sender's name and if it is "EliminationList", do one of the following depending on whether you want to show or hide the range:

  • To hide the range, simply assign an empty IEnumerable (for example new object[] {}) to QueryDetailsEventArgs.Details. This will indicate that the range is empty.
  • To show the range, set Details to null and DataRange.Repeat to 1.

Let me know if this helps.

Regards,
Meppy
  
Back to top
 
IP Logged
 
luolishuang
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 40
Joined: Feb 22nd, 2013
Re: The empty DataRange can NOT be exported to PDF
Reply #8 - May 16th, 2013 at 12:58am
Print Post  
Meppy wrote on May 15th, 2013 at 9:44am:
You can handle the QueryDetails event of the report, inspect the sender's name and if it is "EliminationList", do one of the following depending on whether you want to show or hide the range:

  • To hide the range, simply assign an empty IEnumerable (for example new object[] {}) to QueryDetailsEventArgs.Details. This will indicate that the range is empty.
  • To show the range, set Details to null and DataRange.Repeat to 1.

Let me know if this helps.

Regards,
Meppy


Yeah, it will hide the DataRange, but this will throw exception when exporting to PDF
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: The empty DataRange can NOT be exported to PDF
Reply #9 - May 16th, 2013 at 7:38am
Print Post  
Hi,

I have sent you an e-mail with an updated version that should address this problem.

Regards,
Meppy
  
Back to top
 
IP Logged
 
luolishuang
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 40
Joined: Feb 22nd, 2013
Re: The empty DataRange can NOT be exported to PDF
Reply #10 - May 17th, 2013 at 1:11am
Print Post  
Meppy wrote on May 16th, 2013 at 7:38am:
Hi,

I have sent you an e-mail with an updated version that should address this problem.

Regards,
Meppy


Hi,

Thanks for your great help, the problem is solved,
but there is still little problem, when the "EliminationList" DataRange is hidden, the area is still exist, like image below

The blank area can be removed?
  

2013-5-17_9-03-24.png (Attachment deleted)
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: The empty DataRange can NOT be exported to PDF
Reply #11 - May 17th, 2013 at 9:40am
Print Post  
Hi,

You can try setting the height of the DataRange in question to 0 (that is, set Size to "W,0" where W is your current value for width). If the range has any content, it will be resized accordingly so that the content fits; if it is empty, it should take no space. However, the header of the data range (if any) will still be accounted for.

Regards,
Meppy
  
Back to top
 
IP Logged
 
luolishuang
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 40
Joined: Feb 22nd, 2013
Re: The empty DataRange can NOT be exported to PDF
Reply #12 - May 20th, 2013 at 1:56am
Print Post  
Hi,

I set my "AnswerList" and "EliminationList" DataRange size's height to 0, but seem still the same effect.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: The empty DataRange can NOT be exported to PDF
Reply #13 - May 20th, 2013 at 5:41am
Print Post  
Hi,

Can you please attach the full XAML of your report?

Regards,
Meppy
  
Back to top
 
IP Logged
 
luolishuang
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 40
Joined: Feb 22nd, 2013
Re: The empty DataRange can NOT be exported to PDF
Reply #14 - May 20th, 2013 at 6:59am
Print Post  
Meppy wrote on May 20th, 2013 at 5:41am:
Hi,

Can you please attach the full XAML of your report?

Regards,
Meppy


This is my full XAML report below,
thanks.

Code (HTML)
Select All
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:r="http://mindfusion.eu/reporting/wpf">

    <r:Report x:Key="EliminationReport" FontFamily="Arial" FontSize="12">
        <r:Page >
            <!-- Page Content-->
            <r:DataRange DataSource="{Binding QuestionTable}" Size="100%,100">
                <r:DataRange.ItemTemplate >
                    <DataTemplate >
                        <r:ItemContainer >

                            <!--Note Info-->
                            <r:Label Location="0,0" Size="100%,20" Background="#EAA41E" BorderBrush="#ACE6EF" BorderThickness="1,1,1,0" Text="(Note:__ means No Answer,_N means you got the chance to answer but did not answer in Rush Quiz Mode)" FontSize="14" />
                            <r:Label Location="0%,20" Size="100%,20" Background="#B8DAE3" Text="[QTitle]" BorderBrush="#ACE6EF" BorderThickness="1,1,1,0" FontSize="14"/>
                            <r:Label Location="0%,40" Size="30%,20" Background="#F8F488" BorderBrush="#ACE6EF"  BorderThickness="1,0,1,1" Padding="5,0,0,0" Text="Participant ID" FontSize="14" />
                            <r:Label Location="30%,40" Size="30%,20" Background="#F8F488" BorderBrush="#ACE6EF"  BorderThickness="0,0,1,1" Padding="5,0,0,0" Text="Full Name" FontSize="14" />
                            <r:Label Location="60%,40" Size="40%,20" Background="#F8F488" BorderBrush="#ACE6EF"  BorderThickness="0,0,1,1" Padding="5,0,0,0" Text="Response" FontSize="14" />

                            <r:DataRange  Name="AnswerList" Location="0%,60" Size="100%,0">
                                <r:DataRange.ItemTemplate>
                                    <DataTemplate>
                                        <r:ItemContainer>
                                            <r:Label Location="0%,0" Size="30%,20"  Background="{Binding QTitle}" BorderBrush="#ACE6EF"  BorderThickness="1,0,1,1" Padding="5,0,0,0" Text="[SID]" />
                                            <r:Label Location="30%,0" Size="30%,20"  Background="{Binding QTitle}" BorderBrush="#ACE6EF" BorderThickness="0,0,1,1" Padding="5,0,0,0" Text="[SName]"/>
                                            <r:Label Location="60%,0" Size="40%,20"  Background="{Binding QTitle}" BorderBrush="#ACE6EF" BorderThickness="0,0,1,1" Padding="5,0,0,0" Text="[SReply]"/>
                                        </r:ItemContainer>
                                    </DataTemplate>
                                </r:DataRange.ItemTemplate>
                            </r:DataRange>

                            <r:DataRange  Name="EliminationList" Size="100%,0" >
                                <r:DataRange.HeaderTemplate>
                                    <DataTemplate>
                                        <r:ItemContainer Size="100%,20">
                                            <!--EliminationList-->
                                            <r:Label  Location="0%,0" Size="100%,20" Background="#B8DAE3" BorderBrush="#ACE6EF" BorderThickness="1,0,0,0" Padding="5,0,0,0" Text="Elimination List" FontSize="14" />
                                        </r:ItemContainer>
                                    </DataTemplate>
                                </r:DataRange.HeaderTemplate>
                                <r:DataRange.ItemTemplate>
                                    <DataTemplate>
                                        <r:ItemContainer>
                                            <r:Label Location="0%,0" Size="100%,20" BorderBrush="#ACE6EF"  BorderThickness="1,1,1,0" Padding="5,0,0,0" Text="[SName]"/>
                                        </r:ItemContainer>
                                    </DataTemplate>
                                </r:DataRange.ItemTemplate>
                            </r:DataRange>
                        </r:ItemContainer>
                    </DataTemplate>
                </r:DataRange.ItemTemplate>
            </r:DataRange>

            <!-- Page Footer -->
            <r:Page.FooterTemplate>
                <DataTemplate>
                    <r:ItemContainer Size="100%,30">
                        <r:Label Size="100%,30" Text="[PageCurrent()]/[PageCount()]" HorizontalAlignment="Center" VerticalAlignment="Center" />
                    </r:ItemContainer>
                </DataTemplate>
            </r:Page.FooterTemplate>
        </r:Page>
    </r:Report>
</ResourceDictionary> 

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint