Showing posts with label suppress. Show all posts
Showing posts with label suppress. Show all posts

Thursday, March 8, 2012

Code Problem - Updating parameter

I want to update a parameter in order to know whether a certain type of row
has been printed so that I can suppress it later. the code below generates
an error " Reference to a non-shared member requires an object reference" .
How do I pass in /reference my parameter so that I can set the value? Any
help greatly appreciated
Public Function PrintCensus() As Integer
if Parameters!PrintCensus.Value = 0 Then
Parameters!PrintCensus.Value = 1
Return 0
end if
return 1
End FunctionWhat you have to do is:
1. Define your function as:
> Public Function PrintCensus(PrintCensusValue as integer) As Integer
>
> if PrintCensusValue= 0 Then
> Return 1
> else
Return 0
> end if
> End Function
2. Call your function from expresion field as:
=Code.PrintCensus(Parameters!PrintCensus.Value)
Hope this helps,
Mónica
"Peter Feakins" <PeterFeakins@.discussions.microsoft.com> escribió en el
mensaje news:71D8DF3A-A67F-41CB-8B8B-CE71E0FF63E4@.microsoft.com...
>I want to update a parameter in order to know whether a certain type of row
> has been printed so that I can suppress it later. the code below
> generates
> an error " Reference to a non-shared member requires an object reference"
> .
> How do I pass in /reference my parameter so that I can set the value? Any
> help greatly appreciated
> Public Function PrintCensus() As Integer
> if Parameters!PrintCensus.Value = 0 Then
> Parameters!PrintCensus.Value = 1
> Return 0
> end if
> return 1
> End Function|||apparently you cannot change the value of a parameter after it is set prior
to report execution.
"Peter Feakins" wrote:
> I want to update a parameter in order to know whether a certain type of row
> has been printed so that I can suppress it later. the code below generates
> an error " Reference to a non-shared member requires an object reference" .
> How do I pass in /reference my parameter so that I can set the value? Any
> help greatly appreciated
> Public Function PrintCensus() As Integer
> if Parameters!PrintCensus.Value = 0 Then
> Parameters!PrintCensus.Value = 1
> Return 0
> end if
> return 1
> End Function

Wednesday, March 7, 2012

Code Box

I want to set a variable so i'll know if I printed census information
already so that I can suppress it later. something on the order of the
function below. I"m getting an error "Reference to a non-shared member
requires an object reference". I'm not sure if I need to passs theobject in
or how to reference it. any help is appreciated.
Public Function PrintCensus( ) As Integer
if Parameters!PrintCensus.Value = 0 Then
Parameters!PrintCensus.Value = 0
Return 0
end if
return 1
End Functioni aplogize for the double post - waited so long for this to show up i assumed
that I had clicked close instead
"Peter Feakins" wrote:
> I want to set a variable so i'll know if I printed census information
> already so that I can suppress it later. something on the order of the
> function below. I"m getting an error "Reference to a non-shared member
> requires an object reference". I'm not sure if I need to passs theobject in
> or how to reference it. any help is appreciated.
> Public Function PrintCensus( ) As Integer
> if Parameters!PrintCensus.Value = 0 Then
> Parameters!PrintCensus.Value = 0
> Return 0
> end if
> return 1
> End Function|||On Jan 22, 8:32 pm, Peter Feakins
<PeterFeak...@.discussions.microsoft.com> wrote:
> i aplogize for the double post - waited so long for this to show up i assumed
> that I had clicked close instead
> "Peter Feakins" wrote:
> > I want to set a variable so i'll know if I printed census information
> > already so that I can suppress it later. something on the order of the
> > function below. I"m getting an error "Reference to a non-shared member
> > requires an object reference". I'm not sure if I need to passs theobject in
> > or how to reference it. any help is appreciated.
> > Public Function PrintCensus( ) As Integer
> > if Parameters!PrintCensus.Value = 0 Then
> > Parameters!PrintCensus.Value = 0
> > Return 0
> > end if
> > return 1
> > End Function
If this function is a part of the Code section of a report, you will
most likely need to pass the parameter PrintCensus ByVal to the
function. Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant