Thursday, March 29, 2012

Field Format Expression

I'm attempting to pass format values to a report field from a Db. I've tried
two approaches by placing the following in the format expression:
1.
=iif(Fields!type.Value="p","p",iif(Fields!type.Value=n,"n",iif(Fields!type.Value=n00,"n00",iif(Fields!type.Value=n0,"n0","n00"))))
2.
=Fields!type.Value
The first one always defaults to the false side of the equation and the
second overwrites my values with format values (n, n00, p).
How can make this work? Any help is appreciated...
DavidThe expressions should be entered into the Format property using the Property
sheet. Your data should not be overwritten.
First, you should have double quotes around the type values:
iif(Fields!type.Value="n",...). Secondly, I think you mean "N2" rather than
"N00" (number with two decimal places). Otherwise your first expression
should work if that is the logic you want.
Charles Kangai, MCT, MCDBA
"DJONES" wrote:
> I'm attempting to pass format values to a report field from a Db. I've tried
> two approaches by placing the following in the format expression:
> 1.
> =iif(Fields!type.Value="p","p",iif(Fields!type.Value=n,"n",iif(Fields!type.Value=n00,"n00",iif(Fields!type.Value=n0,"n0","n00"))))
> 2.
> =Fields!type.Value
> The first one always defaults to the false side of the equation and the
> second overwrites my values with format values (n, n00, p).
> How can make this work? Any help is appreciated...
> David|||Thanks for the reply! I've made the change...placing quotes around the value,
but the format still defaults to the falseside of the expression.
=iif(Fields!type.Value="p","p",iif(Fields!type.Value="n","n",iif(Fields!type.Value="n2","n2",iif(Fields!type.Value="n0","n0","n0"))))
any ideas?
"Charles Kangai" wrote:
> The expressions should be entered into the Format property using the Property
> sheet. Your data should not be overwritten.
> First, you should have double quotes around the type values:
> iif(Fields!type.Value="n",...). Secondly, I think you mean "N2" rather than
> "N00" (number with two decimal places). Otherwise your first expression
> should work if that is the logic you want.
> Charles Kangai, MCT, MCDBA
> "DJONES" wrote:
> > I'm attempting to pass format values to a report field from a Db. I've tried
> > two approaches by placing the following in the format expression:
> >
> > 1.
> > =iif(Fields!type.Value="p","p",iif(Fields!type.Value=n,"n",iif(Fields!type.Value=n00,"n00",iif(Fields!type.Value=n0,"n0","n00"))))
> >
> > 2.
> > =Fields!type.Value
> >
> > The first one always defaults to the false side of the equation and the
> > second overwrites my values with format values (n, n00, p).
> >
> > How can make this work? Any help is appreciated...
> >
> > David|||Did you remember that it does a case sensitive comparison? You probably
should be capitalizing your format values. The values used should definitely
be capitalized. At the very least, you should have
=iif(Fields!type.Value="p","P",iif(Fields!type.Value="n","N",iif(Fields!type.Value="n2","N2",iif(Fields!type.Value="n0","N0","N0"))))
You should additionally check the case of the database values to see whether
your comparions are working OK.
Charles Kangai, MCT, MCDBA
Charles Kangai, MCT, MCDBA
"DJONES" wrote:
> Thanks for the reply! I've made the change...placing quotes around the value,
> but the format still defaults to the falseside of the expression.
> =iif(Fields!type.Value="p","p",iif(Fields!type.Value="n","n",iif(Fields!type.Value="n2","n2",iif(Fields!type.Value="n0","n0","n0"))))
> any ideas?
> "Charles Kangai" wrote:
> > The expressions should be entered into the Format property using the Property
> > sheet. Your data should not be overwritten.
> > First, you should have double quotes around the type values:
> > iif(Fields!type.Value="n",...). Secondly, I think you mean "N2" rather than
> > "N00" (number with two decimal places). Otherwise your first expression
> > should work if that is the logic you want.
> >
> > Charles Kangai, MCT, MCDBA
> >
> > "DJONES" wrote:
> >
> > > I'm attempting to pass format values to a report field from a Db. I've tried
> > > two approaches by placing the following in the format expression:
> > >
> > > 1.
> > > =iif(Fields!type.Value="p","p",iif(Fields!type.Value=n,"n",iif(Fields!type.Value=n00,"n00",iif(Fields!type.Value=n0,"n0","n00"))))
> > >
> > > 2.
> > > =Fields!type.Value
> > >
> > > The first one always defaults to the false side of the equation and the
> > > second overwrites my values with format values (n, n00, p).
> > >
> > > How can make this work? Any help is appreciated...
> > >
> > > David|||Good point, but still no luck.
Is there a way that I can just insert my Db field value in as the format
expression?
"Charles Kangai" wrote:
> Did you remember that it does a case sensitive comparison? You probably
> should be capitalizing your format values. The values used should definitely
> be capitalized. At the very least, you should have:
> =iif(Fields!type.Value="p","P",iif(Fields!type.Value="n","N",iif(Fields!type.Value="n2","N2",iif(Fields!type.Value="n0","N0","N0"))))
> You should additionally check the case of the database values to see whether
> your comparions are working OK.
> Charles Kangai, MCT, MCDBA
>
> Charles Kangai, MCT, MCDBA
> "DJONES" wrote:
> > Thanks for the reply! I've made the change...placing quotes around the value,
> > but the format still defaults to the falseside of the expression.
> >
> > =iif(Fields!type.Value="p","p",iif(Fields!type.Value="n","n",iif(Fields!type.Value="n2","n2",iif(Fields!type.Value="n0","n0","n0"))))
> >
> > any ideas?
> >
> > "Charles Kangai" wrote:
> >
> > > The expressions should be entered into the Format property using the Property
> > > sheet. Your data should not be overwritten.
> > > First, you should have double quotes around the type values:
> > > iif(Fields!type.Value="n",...). Secondly, I think you mean "N2" rather than
> > > "N00" (number with two decimal places). Otherwise your first expression
> > > should work if that is the logic you want.
> > >
> > > Charles Kangai, MCT, MCDBA
> > >
> > > "DJONES" wrote:
> > >
> > > > I'm attempting to pass format values to a report field from a Db. I've tried
> > > > two approaches by placing the following in the format expression:
> > > >
> > > > 1.
> > > > =iif(Fields!type.Value="p","p",iif(Fields!type.Value=n,"n",iif(Fields!type.Value=n00,"n00",iif(Fields!type.Value=n0,"n0","n00"))))
> > > >
> > > > 2.
> > > > =Fields!type.Value
> > > >
> > > > The first one always defaults to the false side of the equation and the
> > > > second overwrites my values with format values (n, n00, p).
> > > >
> > > > How can make this work? Any help is appreciated...
> > > >
> > > > David|||For me, it just works doing =Fields!Type.Value. However, in my table the
formats are in capital letters.
Charles Kangai, MCT, MCDBA
"DJONES" wrote:
> Good point, but still no luck.
> Is there a way that I can just insert my Db field value in as the format
> expression?
> "Charles Kangai" wrote:
> > Did you remember that it does a case sensitive comparison? You probably
> > should be capitalizing your format values. The values used should definitely
> > be capitalized. At the very least, you should have:
> > =iif(Fields!type.Value="p","P",iif(Fields!type.Value="n","N",iif(Fields!type.Value="n2","N2",iif(Fields!type.Value="n0","N0","N0"))))
> >
> > You should additionally check the case of the database values to see whether
> > your comparions are working OK.
> >
> > Charles Kangai, MCT, MCDBA
> >
> >
> > Charles Kangai, MCT, MCDBA
> >
> > "DJONES" wrote:
> >
> > > Thanks for the reply! I've made the change...placing quotes around the value,
> > > but the format still defaults to the falseside of the expression.
> > >
> > > =iif(Fields!type.Value="p","p",iif(Fields!type.Value="n","n",iif(Fields!type.Value="n2","n2",iif(Fields!type.Value="n0","n0","n0"))))
> > >
> > > any ideas?
> > >
> > > "Charles Kangai" wrote:
> > >
> > > > The expressions should be entered into the Format property using the Property
> > > > sheet. Your data should not be overwritten.
> > > > First, you should have double quotes around the type values:
> > > > iif(Fields!type.Value="n",...). Secondly, I think you mean "N2" rather than
> > > > "N00" (number with two decimal places). Otherwise your first expression
> > > > should work if that is the logic you want.
> > > >
> > > > Charles Kangai, MCT, MCDBA
> > > >
> > > > "DJONES" wrote:
> > > >
> > > > > I'm attempting to pass format values to a report field from a Db. I've tried
> > > > > two approaches by placing the following in the format expression:
> > > > >
> > > > > 1.
> > > > > =iif(Fields!type.Value="p","p",iif(Fields!type.Value=n,"n",iif(Fields!type.Value=n00,"n00",iif(Fields!type.Value=n0,"n0","n00"))))
> > > > >
> > > > > 2.
> > > > > =Fields!type.Value
> > > > >
> > > > > The first one always defaults to the false side of the equation and the
> > > > > second overwrites my values with format values (n, n00, p).
> > > > >
> > > > > How can make this work? Any help is appreciated...
> > > > >
> > > > > David|||Thanks for helping me through this! It finally worked!
It turned out to be a field length issue on the the SQL side. A TRIM
function made it work. Ultimately, I went back to the SQL table and corrected
the field length.
David
"Charles Kangai" wrote:
> For me, it just works doing =Fields!Type.Value. However, in my table the
> formats are in capital letters.
> Charles Kangai, MCT, MCDBA
> "DJONES" wrote:
> > Good point, but still no luck.
> >
> > Is there a way that I can just insert my Db field value in as the format
> > expression?
> >
> > "Charles Kangai" wrote:
> >
> > > Did you remember that it does a case sensitive comparison? You probably
> > > should be capitalizing your format values. The values used should definitely
> > > be capitalized. At the very least, you should have:
> > > =iif(Fields!type.Value="p","P",iif(Fields!type.Value="n","N",iif(Fields!type.Value="n2","N2",iif(Fields!type.Value="n0","N0","N0"))))
> > >
> > > You should additionally check the case of the database values to see whether
> > > your comparions are working OK.
> > >
> > > Charles Kangai, MCT, MCDBA
> > >
> > >
> > > Charles Kangai, MCT, MCDBA
> > >
> > > "DJONES" wrote:
> > >
> > > > Thanks for the reply! I've made the change...placing quotes around the value,
> > > > but the format still defaults to the falseside of the expression.
> > > >
> > > > =iif(Fields!type.Value="p","p",iif(Fields!type.Value="n","n",iif(Fields!type.Value="n2","n2",iif(Fields!type.Value="n0","n0","n0"))))
> > > >
> > > > any ideas?
> > > >
> > > > "Charles Kangai" wrote:
> > > >
> > > > > The expressions should be entered into the Format property using the Property
> > > > > sheet. Your data should not be overwritten.
> > > > > First, you should have double quotes around the type values:
> > > > > iif(Fields!type.Value="n",...). Secondly, I think you mean "N2" rather than
> > > > > "N00" (number with two decimal places). Otherwise your first expression
> > > > > should work if that is the logic you want.
> > > > >
> > > > > Charles Kangai, MCT, MCDBA
> > > > >
> > > > > "DJONES" wrote:
> > > > >
> > > > > > I'm attempting to pass format values to a report field from a Db. I've tried
> > > > > > two approaches by placing the following in the format expression:
> > > > > >
> > > > > > 1.
> > > > > > =iif(Fields!type.Value="p","p",iif(Fields!type.Value=n,"n",iif(Fields!type.Value=n00,"n00",iif(Fields!type.Value=n0,"n0","n00"))))
> > > > > >
> > > > > > 2.
> > > > > > =Fields!type.Value
> > > > > >
> > > > > > The first one always defaults to the false side of the equation and the
> > > > > > second overwrites my values with format values (n, n00, p).
> > > > > >
> > > > > > How can make this work? Any help is appreciated...
> > > > > >
> > > > > > David

No comments:

Post a Comment