- Welcome, Guest. Please Login or Register
MindFusion  
  We are soon releasing MindFusion.JavaScript pack. Initial version includes chart, diagram, calendar, map, virtual keyboard, gauge and UI components. Here are the beta version and live demo for anyone interested.  
  HomeHelpSearchLoginRegister   
     
     
   
 
Page Index Toggle Pages: 1 Send Topic Print  
How to add container(like Grid) in r:datarange
Read 3661 times

luolishuang   Offline
YaBB Newbies
*
Posts: 40
I Love MindFusion!


   
     
 
How to add container(like Grid) in r:datarange
Feb 22nd, 2013 at 9:13am
 
How to add container(like Grid) in r:datarange
 
 
 
IP Logged    
 
     

Meppy   Offline
YaBB Moderator
*****
Posts: 1783
Gender: male
MindFusion support


   
     
 
Re: How to add container(like Grid) in r:datarange
Reply #1 - Feb 22nd, 2013 at 9:38am
 
You can use any WPF FrameworkElement in a report through the CustomReportItem object. The following code illustrates how to embed a Grid panel:

Code:
<r:CustomReportItem Location="5,5" Size="150,40">
	<r:CustomReportItem.Template>
		<DataTemplate>
			<Grid>
				<Grid.ColumnDefinitions>
					<ColumnDefinition />
					<ColumnDefinition />
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition />
					<RowDefinition />
					<RowDefinition />
				</Grid.RowDefinitions>
				<Border Background="#10000000">
					<TextBlock Text="Header 1" />
				</Border>
				<Border Background="#10000000" Grid.Column="1">
					<TextBlock Text="Header 2" />
				</Border>
				<TextBlock Text="item 1" Grid.Row="1" />
				<TextBlock Text="item 2" Grid.Row="1" Grid.Column="1" />
				<TextBlock Text="item 3" Grid.Row="2" />
				<TextBlock Text="item 4" Grid.Row="2" Grid.Column="1" />
			</Grid>
		</DataTemplate>
	</r:CustomReportItem.Template>
</r:CustomReportItem> 


Regards,
Meppy
 
 
 
IP Logged    
 
     

luolishuang   Offline
YaBB Newbies
*
Posts: 40
I Love MindFusion!


   
     
 
Re: How to add container(like Grid) in r:datarange
Reply #2 - Feb 25th, 2013 at 12:58am
 
Only in CustomReportItem? Could it be put in DataRange?

Thanks for you reply!
 
 
 
IP Logged    
 
     

Meppy   Offline
YaBB Moderator
*****
Posts: 1783
Gender: male
MindFusion support


   
     
 
Re: How to add container(like Grid) in r:datarange
Reply #3 - Feb 25th, 2013 at 6:49am
 
You can add the CustomReportItem containing the Grid to the DataRange object:

Code:
<r:DataRange Size="100%,50" DataSource="...">
	<r:DataRange.ItemTemplate>
		<DataTemplate>
			<r:ItemContainer>

				<r:CustomReportItem>...</r:CustomReportItem>

			<r:ItemContainer>
		</DataTemplate>
	</r:DataRange.ItemTemplate>
</r:DataRange> 


You can also check the CustomReportItems sample installed with the product. It illustrates how to add a WPF Grid object (containing a Border and a TextBlock) to the report.

Regards,
Meppy
 
 
 
IP Logged    
 
     

luolishuang   Offline
YaBB Newbies
*
Posts: 40
I Love MindFusion!


   
     
 
Re: How to add container(like Grid) in r:datarange
Reply #4 - Feb 25th, 2013 at 7:16am
 
Thanks for help.
 
 
 
IP Logged    
 
     

luolishuang   Offline
YaBB Newbies
*
Posts: 40
I Love MindFusion!


   
     
 
Re: How to add container(like Grid) in r:datarange
Reply #5 - Feb 27th, 2013 at 2:25am
 
Meppy,

Can the report control (like r:Label) be put in Grid?

Regards,
 
 
 
IP Logged    
 
     

Meppy   Offline
YaBB Moderator
*****
Posts: 1783
Gender: male
MindFusion support


   
     
 
Re: How to add container(like Grid) in r:datarange
Reply #6 - Feb 27th, 2013 at 7:20am
 
Hi,

Report elements are designed to be used only inside reports, parented in other report elements, or as root elements inside data templates. Even though technically you are able to put report elements (like Label) inside a WPF grid, this really would not yield the expected result.

Regards,
Meppy
 
 
 
IP Logged    
 
     
Page Index Toggle Pages: 1 Send Topic Print