troubleshooting Question

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

Avatar of Stephan_Schrandt
Stephan_SchrandtFlag for Germany asked on
ASP.NET
5 Comments1 Solution732 ViewsLast Modified:
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:
<Textbox Name="lblProjektBezeichnung">
  ....
  <Value>=Fields!Fieldname.Value</Value>
</Textbox>

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

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




ASKER CERTIFIED SOLUTION
RameshS

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros