Thursday, March 22, 2012
Check if External Image Url valid/exist
I would like to check if the external image url is valid, if it is not valid
i would like to show another external "not available" image from an alternate
url. Any idea how do do it or any function that i can use?
i have added a vb function is the custom code to be called to check if the
url is valid, it works great in report designer preview, however after i
deployed, in the report manager all the image return an "not available" image
from an alternate url, regardless if the url is valid.
Below is the VB function that i added into the custom code:
Function IsValid(ByVal Url As String) As Boolean
Dim sStream As IO.Stream
Dim URLReq As Net.HttpWebRequest
Dim URLRes As Net.HttpWebResponse
Try
URLReq = Net.WebRequest.Create(Url)
URLRes = URLReq.GetResponse()
sStream = URLRes.GetResponseStream()
Dim reader As String = New IO.StreamReader(sStream).ReadToEnd()
Return True
Catch ex As Exception
Return False
End Try
End FunctionPlease can someone answer my question'? Thanks
"SL" wrote:
> Hi,
> I would like to check if the external image url is valid, if it is not valid
> i would like to show another external "not available" image from an alternate
> url. Any idea how do do it or any function that i can use?
> i have added a vb function is the custom code to be called to check if the
> url is valid, it works great in report designer preview, however after i
> deployed, in the report manager all the image return an "not available" image
> from an alternate url, regardless if the url is valid.
> Below is the VB function that i added into the custom code:
> Function IsValid(ByVal Url As String) As Boolean
> Dim sStream As IO.Stream
> Dim URLReq As Net.HttpWebRequest
> Dim URLRes As Net.HttpWebResponse
> Try
> URLReq = Net.WebRequest.Create(Url)
> URLRes = URLReq.GetResponse()
> sStream = URLRes.GetResponseStream()
> Dim reader As String = New IO.StreamReader(sStream).ReadToEnd()
> Return True
> Catch ex As Exception
> Return False
> End Try
> End Functionsql
Sunday, February 19, 2012
Chart error: Parameter is not valid
I'm using Reporting Services 2005, trying to design a report in Visual
Studio 2005.
I have a chart in the report that seems to work just fine when I test it
with Preview.
However, every now and then, if I change some trivial detail in the chart
properties, such as the title font, the chart suddenly won't render in design
mode, instead displaying the following error: "Parameter is not valid."
Does anyone have any idea what might be causing this?I sometimes get the same error in charts but they are still working in
preview.
It´s really strange...
"Rolf Smeds" <Rolf Smeds@.discussions.microsoft.com> escribió en el mensaje
news:8BE6B851-1C4A-4CEC-8943-28F1F703F362@.microsoft.com...
> Hi,
> I'm using Reporting Services 2005, trying to design a report in Visual
> Studio 2005.
> I have a chart in the report that seems to work just fine when I test it
> with Preview.
> However, every now and then, if I change some trivial detail in the chart
> properties, such as the title font, the chart suddenly won't render in
> design
> mode, instead displaying the following error: "Parameter is not valid."
> Does anyone have any idea what might be causing this?
Tuesday, February 14, 2012
Character is not valid error
Here's my code:
Dim Cmd as New SQLCommand(sqlString, conn)
cmd.CommandType=CommandType.StoredProcedure
Breaks Here -->>cmd.parameters.add(New SQLParameter(@.OrdAlias, OrdNum))
cmd.parameters.add(New SQLParameter(@.AliasSourceCode, 4))
The error says:
compilation error - -
then, on the line that is in red:
Compiler Error Message:BC30037: Character is not valid.
I have 'OrdNum' declared globally, and OrdNum is assigned right away in the Page_Load event. I've checked the spelling of the SQL parameters (OrdAlias is a varchar, and AliasSourceCode is a tinyInt)
After all this - then, this code runs
Any ideas why I'm getting this error??
Character is not valid
Hi,
I do not know what I did wrong. I tested a simple function in my custom code and get the error saying "Character is not valid". Any help is appreciated!
Here is the function inside my custom code.
Shared Function test() As string
Dim items As Fields
Return items("DataField1").Value;
End Function
I call the function in the body of my report using: Code.test()
and the error says "There is an error on line 18 of custom code: [BC30037] Character is not valid."
Thanks,
Tabbey
Try to remove " ; " after Return items("DataField1").Value|||Also, you cannot refer to dataset items inside of your Report code block. You must pass values into your function.
Something like this:
Shared Function test(fieldvalue as string) As string
test = fieldvalue
End Function
And then call the function in the body of the report:
=Code.test(ReportItems!DatasetField.Value)
|||I need to build "fields string" in my custom code depending on the parameters users selected.
If I cannot refer to the dataset items inside the custom code, can you think of any other alternative solution?
I construct the fields string in textbox expression, but I get an error if the field did not exist since IIF evaluate the entire expression.
Thanks,
Tabbey
|||Can you create a function with a signature that accepts all the fields you wish to concatenate?Function addString (field1 as string, field2 as string, field3 as string) as String
if Parameter!UserInput.Value = true then
addString = field1 & field2 & field3
End Function
You could always create a custom data processing extension and handle it there. you could also probably handle this in the logic of your stored procedure.|||
Andy,
That sounds like a good idea. Let me try that out. Thanks!