Showing posts with label background. Show all posts
Showing posts with label background. Show all posts

Thursday, March 8, 2012

Code for Custom Background Colors

I am building a report that uses green, red, and white as the
background color of the cell. I've tried building a public shared
function with an if-elseif statement. My biggest problem is that I'm
not a VB programmer so I'm hacking away at this. I found a reference
to this at http://www.odetocode.com/Articles/130.aspx and tried to
follow the example but the example is based on older information.
Here is what my code looks like in the RDL:
<Code>Public Shared Function SetColor(ByVal Value As Integer) As
String
SetColor = "Red"
If Value < Fields!benchmark.value And Fields!hilo.value = "H"
SetColor = "Green"
ElseIf Value > Fields!benchmark.value And Fields!hilo.value = "Y"
SetColor = "Green"
ElseIf Value is nothing
SetColor = "White"
End If
End Function</Code>
When I try to compile the report I get this message:
There is an error on line 4 of custom code: [BC30469] Reference to a
non-shared member requires an object reference.
Does anyone know of a source for examples of how to write embedded
code in RS? I could really use the ability to do this but I'm just
too ignorant take advantage of this.On Dec 4, 10:47 am, Fred <fdk0154...@.cox.net> wrote:
> I am building a report that uses green, red, and white as the
> background color of the cell. I've tried building a public shared
> function with an if-elseif statement. My biggest problem is that I'm
> not a VB programmer so I'm hacking away at this. I found a reference
> to this athttp://www.odetocode.com/Articles/130.aspxand tried to
> follow the example but the example is based on older information.
> Here is what my code looks like in the RDL:
> <Code>Public Shared Function SetColor(ByVal Value As Integer) As
> String
> SetColor = "Red"
> If Value < Fields!benchmark.value And Fields!hilo.value = "H"
> SetColor = "Green"
> ElseIf Value > Fields!benchmark.value And Fields!hilo.value = "Y"
> SetColor = "Green"
> ElseIf Value is nothing
> SetColor = "White"
> End If
> End Function</Code>
> When I try to compile the report I get this message:
> There is an error on line 4 of custom code: [BC30469] Reference to a
> non-shared member requires an object reference.
> Does anyone know of a source for examples of how to write embedded
> code in RS? I could really use the ability to do this but I'm just
> too ignorant take advantage of this.
You can't mix the Fields object in a Function, the value has to be
passed as a parameter to the function. Like any other language, the
Fields object would be out of scope when the back color expression is
inside the function. Also, you want to check if the Value object is
Nothing before you attempt to do math expressions against it (<, >).
I also assume you may want to use Double floating points in case you
have fractions and want them rounded correctly.
Function SetColor(ByVal Value As Double, ByVal BenchmarkValue As
Double, hilo As String) As String
If IsNothing( Value ) Then
SetColor = "White"
ElseIf Value < BenchmarkValue And hilo = "Y" Then
SetColor = "Green"
Elseif Value > BenchmarkValue And hilo = "N" Then
SetColor = "Green"
Else
SetColor = "Red"
End If
End Function
Then in the BackgroundColor Property, you would use an Expression like
= Code.SetColor( Fields!Value.Value, Fields!benchmark.Value, Fields!
hilo.Value )
-- Scott

Tuesday, February 14, 2012

Clustered SQL Server 2000 is not seen by fn_virtualservernodes()

Hello,
Firstly I will provide some background. Few weeks before I started
work as database administrator but without cluster experience, and few
days ago I got a project to add sql serve pasive node to Windows 2003
cluster, I looked the internet but no serious sollutions wasn't find.
Nobody in company has idea how SQL Server was installed on this
cluster. Cluster consist of two machines with cluster services and
storage resurces installed, one has sql insatlled second, added later,
is waiting for my instalation. Cluster resuorces directing on active
SQL instance.
Before adding node quest I did some checks and found out that existing
sql node isn't recognize by fn_virtualservernodes() function. When I
wanted to add node according to Microsoft
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/failclus.mspx
I got error "Another Virtual Server of the same name exists on the
network error".
And finally my questions do have idea how to add second SQL node to
this configuration?
Or do I have to uninstall active sql serevr and start standard sql
serevr instalation on cluster?
Any help appreciate.
Regards,
BartekBartolo wrote:
> Hello,
> Firstly I will provide some background. Few weeks before I started
> work as database administrator but without cluster experience, and few
> days ago I got a project to add sql serve pasive node to Windows 2003
> cluster, I looked the internet but no serious sollutions wasn't find.
> Nobody in company has idea how SQL Server was installed on this
> cluster. Cluster consist of two machines with cluster services and
> storage resurces installed, one has sql insatlled second, added later,
> is waiting for my instalation. Cluster resuorces directing on active
> SQL instance.
> Before adding node quest I did some checks and found out that existing
> sql node isn't recognize by fn_virtualservernodes() function. When I
> wanted to add node according to Microsoft
> http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/failclus.mspx
> I got error "Another Virtual Server of the same name exists on the
> network error".
> And finally my questions do have idea how to add second SQL node to
> this configuration?
> Or do I have to uninstall active sql serevr and start standard sql
> serevr instalation on cluster?
> Any help appreciate.
> Regards,
> Bartek
hi Bartek,
I have few years of experience with MSCS and MSSQL. I setup SQL on MSCS
several times but never tried to add node later. AFAIK you need to
uninstall sql server and then install it again. This is not hard to do.
good luck and hth|||Thanks a lot Zarko!
It seems I have to take into account uninstallation and installation
from the very begining.
Best regards,
Bartek
On 7 Lut, 11:39, Zarko Jovanovic <mind_lessIsHsAsTsEsSsPsA...@.inet.hr>
wrote:
> Bartolo wrote:
> > Hello,
> > Firstly I will provide some background. Few weeks before I started
> > work as database administrator but without cluster experience, and few
> > days ago I got a project to add sql serve pasive node to Windows 2003
> > cluster, I looked the internet but no serious sollutions wasn't find.
> > Nobody in company has idea how SQL Server was installed on this
> > cluster. Cluster consist of two machines with cluster services and
> > storage resurces installed, one has sql insatlled second, added later,
> > is waiting for my instalation. Cluster resuorces directing on active
> > SQL instance.
> > Before adding node quest I did some checks and found out that existing
> > sql node isn't recognize by fn_virtualservernodes() function. When I
> > wanted to add node according to Microsoft
> >http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/failcl...
> > I got error "Another Virtual Server of the same name exists on the
> > network error".
> > And finally my questions do have idea how to add second SQL node to
> > this configuration?
> > Or do I have to uninstall active sql serevr and start standard sql
> > serevr instalation on cluster?
> > Any help appreciate.
> > Regards,
> > Bartek
> hi Bartek,
> I have few years of experience with MSCS and MSSQL. I setup SQL on MSCS
> several times but never tried to add node later. AFAIK you need to
> uninstall sql server and then install it again. This is not hard to do.
> good luck and hth

Clustered SQL Server 2000 is not seen by fn_virtualservernodes()

Hello,
Firstly I will provide some background. Few weeks before I started
work as database administrator but without cluster experience, and few
days ago I got a project to add sql serve pasive node to Windows 2003
cluster, I looked the internet but no serious sollutions wasn't find.
Nobody in company has idea how SQL Server was installed on this
cluster. Cluster consist of two machines with cluster services and
storage resurces installed, one has sql insatlled second, added later,
is waiting for my instalation. Cluster resuorces directing on active
SQL instance.
Before adding node quest I did some checks and found out that existing
sql node isn't recognize by fn_virtualservernodes() function. When I
wanted to add node according to Microsoft
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/failclus.mspx
I got error "Another Virtual Server of the same name exists on the
network error".
And finally my questions do have idea how to add second SQL node to
this configuration?
Or do I have to uninstall active sql serevr and start standard sql
serevr instalation on cluster?
Any help appreciate.
Regards,
Bartek
Thanks a lot Zarko!
It seems I have to take into account uninstallation and installation
from the very begining.
Best regards,
Bartek
On 7 Lut, 11:39, Zarko Jovanovic <mind_lessIsHsAsTsEsSsPsA...@.inet.hr>
wrote:
> Bartolo wrote:
>
>
> hi Bartek,
> I have few years of experience with MSCS and MSSQL. I setup SQL on MSCS
> several times but never tried to add node later. AFAIK you need to
> uninstall sql server and then install it again. This is not hard to do.
> good luck and hth