SSRS 2012 and CSV export

前端 未结 2 911
感情败类
感情败类 2021-01-22 08:57

I\'m using SSRS 2012 trying to do the following:

Some columns should only be visible on user request, using a combo box. Visibility of the columns dependes on the select

相关标签:
2条回答
  • 2021-01-22 09:10

    There is a native way to hide data elements sent to CSV by using DataElementOutput=NoOutput

    1. Open the properties menu (F4) for the TextBox

    2. Set the DataElementOutput property to NoOutput

      screenshot

    Further Explanation

    When SSRS has to render a chart, it has a couple of decisions to make. If you spent a lot of time doing some cool formatting, it will try to preserve that when going to PDF because PDF documents are full of rich formatting. For example, if you set the margins of the report, a PDF should care, but a CSV has no way to even hold that information (nor should it).

    As such, there are different rendering engines used by SSRS:

    Render Engines

    Each of these has their own process. The data exports, for example, will only pull information from datafields. For example, a data field is welcome to have several layers of headers, the names of which may or may not use CLS-compliant identifiers, so it's safer to extract that information directly from the textbox name itself.

    The TextBox containing the data can be used to set other data export properties as well.

    In this instance, you can remove a particular data field by using the DataElementOutput which:

    Indicates whether the data point should appear in a data rendering.

    Further Reading

    • SSRS: Conditionally hiding columns based on parameter values - CSV export ignores
    • Summary Data Appears in SSRS 2008R2 CSV Export
    • Hide/Show Items Dependant On Export Format (SSRS)
    0 讨论(0)
  • 2021-01-22 09:21

    CSV (and XML) export from SSRS is treated very differently than most export formats. These two are considered data renderers, not page renderers, and are generally written to get at the data underlying the report, disregarding layout options. Part of this is that field visibility isn't handled the same way. I don't know if it's a bug or intentional design, but .CSV apparently doesn't honor visibility set in expressions. One suggested work around is to conditionally set the value to null in the underlying dataset. (This could be based on a parameter.)

    0 讨论(0)
提交回复
热议问题