How do I export a SSRS matrix to CSV without losing the structure?

大兔子大兔子 提交于 2019-12-05 12:29:19
kscott

This is part of a big change to the report rendering between SSRS 2005 and SSRS 2008.

The only solutions I've found are:

  1. Export to Excel, then save the Excel document as CSV - This flattens the Excel format, and requires the groupings to be set up so that each row repeats the values of the parent groups. However, there are issues with exporting to Excel to begin with, such as is if consecutive rows contain the same data, the renderer sometimes omits the data, which can be stopped by setting the 'DataElementOutput' to True for the affected columns instead of 'Auto' which allows the renderer to guess what fields you may think are important.

  2. Build your report as a flat table - This pretty much defeats the point of making a matrix to begin with, and is a pain, but you can define the columns in advance, and can do so dynamically either in the query or using a lot of expressions in the textbox value and setting dynamic visibility on the columns. But to pull this off could potentially involve creating dozens or hundreds of columns to handle the potential appearance of a particular value.

  3. Don't upgrade to 2008 - If matrix reporting, and the formatting of the export, are business critical, there is really no good way to recreate the functionality in 2008, sticking with 2005 SSRS is the only sure-fire way to get the old rendering.

Resources:

Gustavo Lopez

Here's an workaround:

  • Switch the source of CSV output to be an extra tablix which shows all the data as-is.
  • Disable the original tablix from outputting to CSV (Tablix > Properties > DataElementOutput > NoOutput).
  • Hide the extra tablix so it doesn't display. (Tablix > Right Click > Tablix Properties > Visibility > Hide).

This way you have full control of the display on-screen and of the CSV output.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!