none
Access Column_Alias in RDLC RRS feed

  • Question

  • I am creating an RLDC. The SQL statement has several unions, that create some column_aliases in the result table. Like ...
    select xCode, xDate as zTrans, xVal1 as zVal from DT where some_condition
    union
    select xCode, xDate+1 as zTrans, xVal2 as zVal from DT where some_condition
    union
    select xCode, xDate+2 as zTrans, xVal3 as zVal from DT where some_condition
    It is "xCode", "zTrans" and "zVal" that should appear in the report. I am creating the result table using a table adapter query. The RDLC seems to require an already existing data table, or at least, a data table that has the same structure as an existing table. So, I am not able to reference the column_aliases. Is there a way to handle this?
    Wednesday, January 21, 2015 7:07 PM

Answers

  • Evidently the answer is to create a new table adapter, using the SQL statement as the Fill. (Although the function can be called anything.) Then, when it is invoked, it will use a column_alias name as a column name. And referencing that table adapter as the data set in the report data, a person will be able to access the column_alias in the rdlc definition in the normal way any column is referenced.
    • Marked as answer by wodders Friday, January 23, 2015 3:09 PM
    Friday, January 23, 2015 3:09 PM