Question : How to use session variables in field names of asp.net report (.rdcl)

Hello, I have a report and need to set a field source depending on a session var. I know the fields I use have to be declared, so I wonder if I can get it to work.

e.g.:

Session("Language") is "de-DE"

In gridview I can evaluate a field like this:
Text='<%# Eval("FieldName" & Session("Language")) %>'

So when I have a column named "Fieldnamede-DE" it will evaluate correctly.

In reportviewer the values are assigned like this:

  ....
  =Fields!Fieldname.Valuee>


So my question is:
Is there a way to use something like:
  =Fields!Fieldname" & Session("Language") & ".Value

or can I use/write a function that returns the correct value. If so, how and where.
Thank you.




Answer : How to use session variables in field names of asp.net report (.rdcl)

H i Stephan,
For your scenario, you cannot customise/change field names using parameters and code section. I have also explored the same options before posting my previous post. It seems that we cannot change the field names at run timee using these options. Therefore I suggested to use XmlDocument method to read the content of RDLC file, update it and then load to ReportViewer.
Regards
Ramesh. S


 
Random Solutions  
 
programming4us programming4us