Last post Apr 04, 2013 07:48 AM by deepu05
Mar 12, 2007 01:08 PM|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 .
Mar 12, 2007 07:35 PM|dr_99|LINK
Mar 13, 2007 05: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()
Mar 23, 2007 02:14 AM|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#?
Mar 30, 2007 12:09 PM|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....
Apr 04, 2013 07: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
Public Function GetUrl() as String
Dim rootWebConfig1 As System.Configuration.Configuration
rootWebConfig1 = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Nothing)
Dim customSetting As System.Configuration.KeyValueConfigurationElement
customSetting = rootWebConfig1.AppSettings.Settings("servername")
and using it in image expression as
And web config settings are
<add key="servername" value="Here is path of my image"/>
But i am not geeting image when i run my rdlc file please tell me where i am wrong.