If I use a PagePresenterStyle with the contentPresenter's HorizontalAlignment set to Center the print generates "Unable to print this report section because the content area on the page was too small..."
My style code is:
<Style x:Key="PagePresenterStyle" TargetType="{x:Type igReporting:ReportPagePresenter}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igReporting:ReportPagePresenter}"> <Border BorderBrush="{TemplateBinding Border.BorderBrush}" BorderThickness="{TemplateBinding Border.BorderThickness}" Background="{TemplateBinding Panel.Background}" SnapsToDevicePixels="True" Padding="{TemplateBinding Padding}"> <DockPanel SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"> <ContentPresenter x:Name="PART_Header" ContentSource="Header" DockPanel.Dock="Top"/> <ContentPresenter x:Name="PART_Footer" ContentSource="Footer" DockPanel.Dock="Bottom"/> <ContentPresenter x:Name="PART_Content" HorizontalAlignment="Center" ContentSource="Content" /> </DockPanel> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style>
If I don't use the PagePresenterStyle or set HorizontalAlignment to stretch I do get the report.
Anyone have an idea?
Thanks
More to add..
I just found out from engineering that the next service release for the product should fix this issue. Until then, Peter's suggestion of setting the MinWidth and MinHeight is an excellent one.
Please let us know how we can help you any further.
Thank you,
Hello,
I have been looking into this issue and though I was able to reproduce it using your style, I am not sure if this is a bug. After all if you follow the instructions provided by the exception there is no problem. I suppose this is a limitation of some sort which, as you cna see, has been noted. What you can do to achieve your goal is set minimum height and width to the content presenter like so:
<ContentPresenter x:Name="PART_Content" HorizontalAlignment="Center" MinHeight="100" MinWidth ="100"...
Please let me know if you require further assistance on the matter.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support
I believe that you have uncovered a bug. I have submitted this as a case to our developer support team. Engineering is quick to fix these types of bugs. It sounds like you have a work-around. Another work-around would be to take care of centering the content in your view before assigning it to the Print job and leave the style using HorizontalAlignment set to Stretch.
Thank you for bringing this to our attention!