Problem : In one of my text boxes on report i show "first name" of customer, but if this field is empty then i want to show a value defined in my web.config file.
Any clues how can i fetch a value from web.config file inside a rdlc report. and then conditionally assign it to that textbox .
i am trying to do the same thing. can you provide a sample of how you assigned a value from the web.config into the report. Im having some trouble writing the code in the Report Code window.
Member
127 Points
75 Posts
How to get web.config value in RDLC report ?
Mar 12, 2007 08:08 AM|sanjev.sharma|LINK
I am generating a rdlc report.
Problem : In one of my text boxes on report i show "first name" of customer, but if this field is empty then i want to show a value defined in my web.config file.
Any clues how can i fetch a value from web.config file inside a rdlc report. and then conditionally assign it to that textbox .
Member
41 Points
61 Posts
Re: How to get web.config value in RDLC report ?
Mar 12, 2007 02:35 PM|dr_99|LINK
Member
127 Points
75 Posts
Re: How to get web.config value in RDLC report ?
Mar 13, 2007 12:56 PM|sanjev.sharma|LINK
thanks for the reply
i solved the problem by writing a function in code tab.
You can write vb code in the code tab of report.. Report >> Report properties >>code..
and that function can then be accessed the using code.functionName()
:)
Contributor
3572 Points
1395 Posts
Re: How to get web.config value in RDLC report ?
Mar 22, 2007 09:14 PM|mcmcomasp|LINK
i am trying to do the same thing. can you provide a sample of how you assigned a value from the web.config into the report. Im having some trouble writing the code in the Report Code window.
is it VBScript? or can i use C#?
thanks,
mcm
Member
127 Points
75 Posts
Re: How to get web.config value in RDLC report ?
Mar 30, 2007 07:09 AM|sanjev.sharma|LINK
you have to write vb.net code ........with proper refrences to the namespaces used..
for getting web.config values ..its same as u get on any other page(configurationsettings.appsettings......)
write a function in code window and specify its return type as string (return web.config value from this function)
now you can call this function from ur report and get that value....
None
0 Points
9 Posts
Re: How to get web.config value in RDLC report ?
Apr 04, 2013 02:48 AM|deepu05|LINK
Hi I am facing smae problem i want to show external image whose path is stored in web config i have used following code in custom rdlc code
and using it in image expression as
=Code.GetUrl()
And web config settings are
<appSettings>
<add key="servername" value="Here is path of my image"/>
</appSettings>
But i am not geeting image when i run my rdlc file please tell me where i am wrong.