tags:

views:

194

answers:

2

Hi i have an enum like

Designation{Admin=1,Manager=2}

Database contains just the degint 1,2 .........Now i want to built RDLC Report ......report don't show the degit ....report must show the degit across value like 1 for Admin.........How to do that ......Can any one give any idea ......or any help?

A: 

Create a table that holds the numeric values and the corresponding text values. Then create a User Defined Function to return the text value based on the enumerated value you return in the query for the report. The user defined function can be called in the select statement and will return the text value.

Achilles
Plz give me some working example......
Shamim
+1  A: 

Are you using C#?

If so, you want to use Enum.GetNames()
See this link for a code example.

If you need to do it in SQL code, then I agree with simply having a lookup table (although it can be a pain to keep the code enum and DB in sync).

chocojosh
Thanks your given link is very useful .....I use C# to built report on RDLC ....plz give me some example or link to built on RDLC
Shamim
I'm not familliar with RDLC. How are you passing the enum right now to RDLC? Can you pass the strings (using Enum.GetNames()) instead of the enum integer values?
chocojosh