2012年3月22日 上午 11:19
I want to export a report from the report viewer to Excel. All data and graphics are exported fine, but unfortunately in some cells there are data that exceed the width of the column in Excel. While these data are displayed in multiple lines in the report viewer, they are displayed in only a single line in Excel.
The exceeding lines of the text are there, I can see them when I click on the cell in Excel. Therefore the users would need to check each single line in the export for some hidden texts (e.g. by increasing the lines to a bigger height).
Is there a way to make the export working properly, so that the height of the lines is transferred correctly from the report viewer to Excel?
The report viewer is hosted in a WPF application, but we have seen the same behaviour on asp.net reprts, too. The report is exported correct to PDF.
2012年4月11日 上午 08:37Did you have any luck with this?
2012年4月11日 上午 08:58
Did you have any luck with this?
Unforunately not. We tried a lot of settings now, and for one report we made it working by changing the width of the first column (?!), but no general solution yet. Our management asked us now to investigate other reporting tools, but I don't want to move hundreds of reports to a new tool just because of this export issue (you know, building reports is the most interesting thing a software developer can do...).
2012年4月11日 上午 10:35
There is a solution, but it's neither layout friendly or very useful.
If the text that has the height issue is over merged cells it won't work. But if you line up all your report text boxes etc. so that the text area that goes over the lines is in line (and only requiring a single cell), then it will text wrap.
I achieved it by putting everything in to a table and making sure that the text areas that I wanted text wrapping to occur on were only over 1 cell. It's an awful way to do it, fortunately my cells were relatively thin (in width). But if you had a cell covering a large area you're pretty much stuck!
My advice, if anyone reading this is starting a new project and thinking of reporting, stay away from the ReportViewer!