Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hi! I'm using PrintableControlLink to export TableView into the Excel file. Is there any possibilities to define some rows as bold or any other row custom formatting?

                                You must  log in  or  register  to leave comments

                                1 Solution

                                0

                                Hi,

                                You can customize PrintCellStyles (see How to use the PrintCellStyle property to customize cell's printing appearance) and add custom value converter to them in order to print different rows differently depending on the underlying data. Attached is a sample project and screencast that illustrates this approach in action. I hope this will help you.

                                Thanks,
                                Alessandro.

                                Q411825.zip
                                • Alexander S Smirnov 06.26.2012

                                  Thanks! With additional customization i've been able to fit this technic into my code.

                                  But i've run into the problem with export. Using this cell style i get 2 empty columns after each filled column and 2 empty rows after each filled row! If i don't use this cell style - all works fine:

                                          <Style x:Key="CellPrintingStyle" TargetType="dxe:TextEdit"
                                             BasedOn="{StaticResource {dxgt:TableViewThemeKey ResourceKey=DefaultPrintCellStyle}}">
                                              <Style.Setters>
                                                  <Setter Property="dxp:ExportSettings.TargetType" Value="Panel" />
                                                  <Setter Property="DisplayTemplate">
                                                      <Setter.Value>
                                                          <ControlTemplate>
                                                              <dxe:TextEdit Text="{Binding Value}"
                                                                            TextWrapping="Wrap"
                                                                            IsPrintingMode="True"
                                                                            Margin="4" FontWeight="{Binding Value, Converter={local:FontWeightConverter}}"
                                                                            VerticalContentAlignment="Center"
                                                                            HorizontalContentAlignment="Left"
                                                                            />
                                                          </ControlTemplate>
                                                      </Setter.Value>
                                                  </Setter>
                                              </Style.Setters>
                                          </Style>

                                  I think it's somehow related to TextEdit placement settings... I'll try to dig into it... anyway, do you have any ideas?

                                • Alexander S Smirnov 06.26.2012

                                  Yes! The margin was the cause of this behaviour. Thanks, all works fine now!

                                • Thank you for your feedback.

                                  I am glad to hear that the issue has been resolved. Please contact us if you experience any further difficulties.

                                You must  log in  or  register  to leave comments
                                You must  log in  or  register  to leave an answer

                                Is your intention to post an answer to your own question?

                                • If so, then proceed.
                                • If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
                                • If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.

                                To start a chat you should create a support ticket


                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Your Privacy - Legal Statements

                                Copyright © 1998-2013 Developer Express Inc.
                                ALL RIGHTS RESERVED
                                All trademarks or registered trademarks
                                are property of their respective owners