Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • I have a treelist control bound to a data source. Some cells in the treelist have special formatting like underline, italic, bold, back color, fore color, and row height. When I export the treelist to print or to Excel I expect it to retain the formatting, but it doesn't. I also have a special XtraReport report I use for a "finished" report that includes header and footer, etc. The export results there are the same - no formatting is retained.


                                    This used to work fine but doesn't work now. No code changes were made between when it worked and when it didn't. One of my customers just reported it, but they had not upgraded our product since last February. I just upgraded them this week. So I have no idea when it stopped working. I can only conclude that it is a bug introduced in a more recent version of the TreeList control. Until the last few months I have always immediately installed the latest version of DX. So I know it worked in whatever version of DX that was out on 3/7/2011.


                                    Attached is a zip file with a sample project with a treelist bound to a data source. I make format changes for underline, foreground and background to specific cells. I have buttons that send the treelist to a printer, to Excel, and to a report object that prints to Excel. The output XLS files get written to the executing assembly's folder.


                                    Please note that in this sample app and in my "real" app I don't explicitly set up columns. On my "real" app I can't because the columns in the treelist are variable (it's a report generator where the columns are defined by the user). I simply bind the data source to the grid and manually set column widths to fit their contents.


                                    Also in the attached zip file are the following files:


                                    1. BEFORE - GL Report - Print Preview.png - A screenshot of the Print Preview screen for a report I took a while back when the formatting was being honored. Unfortunately this screenshot does not show blank lines and thin solid lines (explained below).


                                    2. NOW - GL Report - Print Preview.png - A screenshot of the Print Preview screen for a report I took today where the formatting is not being honored. See note on Empty/Solid Lines below.


                                    3. Export TreeList.xls - A sample export XLS file from my "real" app (it's all fake test data) that was exported with a simple ExportToXLS command on the TreeList control. See note on Empty/Solid Lines below.


                                    4. Export Report.xls - A sample export XLS file from my "real" app (it's all fake test data) that was exported through a report the same way the sample app does it (i.e. it uses a WinControlContainer object). This is the method DevExpress pointed me to in a support ticket I submitted a long time ago. See note on Empty/Solid Lines below.


                                    5. Program Screen.png - A screenshot of the program screen - just the treelist control.


                                    NOTE on Empty/Solid Lines: You can see that I have rows with either "[Empty Line]" or "Solid Line". In the treelist, the former are formatted with fore/background colors of white so the line appears blank, while the latter are formatted with fore/background colors of black and have a custom height set so they look like a heavy bold line all the way across the treelist.


                                    I need to know how to get the formatting to carry over in the three scenarios like it used to be able to:

                                    1. Print treelist directly to printer.

                                    2. Print treelist to print preview, XLS, HTML, etc.

                                    3. Print treelist as part of a defined XtraReport embedded into a WinControlContainer object.


                                    For the XtraReport, I'm not hung up on using WinControlContainer. If there's a better way, I'm open to it.


                                    Thanks in advance for your help. This is very important and kind of time-sensitive, but I don't want to abuse the "urgent" option.


                                    Mike

                                KCX_DXTreeListPrint.zip
                                You must  log in  or  register  to leave comments

                                1 Solution

                                0

                                Thank you for contacting us. In version 12.1 we have introduced a breaking change (BC1604). Now TreeList uses printing appearances during printing by default. To resolve the issue, set the TreeList.OptionsPrint.UsePrintStyles property to False.

                                • Mike Wilson 09.20.2012

                                  Thank you for the information. At least I know there was a breaking change that caused the problem. However, the UsePrintStyles option does not affect the output or solve the problem. I toggle it between True and False and the output is identical - no formatting is carried across to the Excel output. Can you modify my sample app so it works? Thank you.

                                • Thank you for your reply. I have attached a modified project.

                                • Mike Wilson 09.20.2012

                                  I compared the project you sent back with my original and the only thing you changed was the UsePrintStyles property (except that you're using DX version 12.1.7 and I'm using 12.1.4). But like I said in my previous update, after your initial reply I tried that setting as both True and False and it made no difference. Is it possible that it is because you're using DX version 12.1.7 and I'm using 12.1.4? Maybe it just flat doesn't work in 12.1.4. I'll try upgrading to 12.1.7 and see if that fixes it.

                                • Mike Wilson 09.20.2012

                                  I had tried toggling the UsePrintStyles before I ever submitted this question. I installed 12.1.7 and now the treelist behaves properly in the export. So I guess it was 12.1.4 after all. Thanks for your help.

                                • I am glad to hear that you have found a solution.
                                  Please feel free to ask about any further problems you may have. We are glad to help you at any time.

                                You must  log in  or  register  to leave comments

                                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.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners