Showing posts with label types. Show all posts
Showing posts with label types. Show all posts

Monday, March 19, 2012

Conditional Sum trouble

Can someone help me figure this out? I'm trying to total up 4 columns which
have been X'd to indicate inventory types: RAWX, NSFGX, BUYX and SFGX.
I've tried:
=iif( Fields!RAWX.Value = "X", Sum(Fields!BKIC_PROD_AVGC.Value *
Fields!BKIC_PROD_UOH.Value), 0)
=iif( Fields!NSFGX.Value = "X", Sum(Fields!BKIC_PROD_AVGC.Value *
Fields!BKIC_PROD_UOH.Value), 0)
=iif( Fields!BUYX.Value = "X", Sum(Fields!BKIC_PROD_AVGC.Value *
Fields!BKIC_PROD_UOH.Value), 0)
=iif( Fields!SFGX.Value = "X", Sum(Fields!BKIC_PROD_AVGC.Value *
Fields!BKIC_PROD_UOH.Value), 0)
The reoport runs without errors, but I get a Grand Total for RAWX and 0 for
the other three columns.
If I change the expressions to:
=Sum(iif( Fields!RAWX.Value = "X", (Fields!BKIC_PROD_AVGC.Value *
Fields!BKIC_PROD_UOH.Value), 0))
=Sum(iif( Fields!NSFGX.Value = "X", (Fields!BKIC_PROD_AVGC.Value *
Fields!BKIC_PROD_UOH.Value), 0))
=Sum(iif( Fields!BUYX.Value = "X", (Fields!BKIC_PROD_AVGC.Value *
Fields!BKIC_PROD_UOH.Value), 0))
=Sum(iif( Fields!SFGX.Value = "X", (Fields!BKIC_PROD_AVGC.Value *
Fields!BKIC_PROD_UOH.Value), 0))
I get #ERROR in all columns and a warning for each field:
"The value expression for the textbox â'RAWXâ' uses an aggregate function on
data of varying data types. Aggregate functions other than First, Last,
Previous, Count, and CountDistinct can only aggregate data of a single data
type.
BKIC_PROD_AVGC and BKIC_PROD_UOH are the same data type.
What is this message trying to tell me?Did you try this for the RAWX column?
=iif( Fields!RAWX.Value = "X", Sum(Fields!BKIC_PROD_AVGC.Value) *
Sum(Fields!BKIC_PROD_UOH.Value), 0)
--
I would also try to display the conditional value for the other three
to verify that those fields equal your "X" value
For example (for the NSFGX column), just put
= (Fields!NSFGX.Value = "X")
and see if it returns 'True' or 'False'
that may lead you in the right direction.
--
Also, I'm not sure how your report is set up, but did you notice that
for each of your columns, you're referencing the same values (
Fields!BKIC_PROD_AVGC.Value and Fields!BKIC_PROD_UOH.Value )?

Thursday, March 8, 2012

Conditional Page Breaks

Hi -
I'm trying to generate invoice reports where there are two types of
line items (with a different number of columns). I am basically looking
to have two sets of tables as follows:
Case A - at least one of each item
Table Items 1
<PAGE BREAK>
Table Items 2
Case B - items 2 exist, but no items 1
Table Items 2
Case C - items 1 exist, but no items 2
Table Items 1
I've spent hours trying to figure out how to accomplish this - I have
played with putting Table 1 in an object with conditional visibility,
but that doesn't seem to suppress a page break. I've tried a "hidden
group" but no luck there either. I've also tried having Table items 1
in a subreport.
I'm open to suggestion if you don't think I am going about this the
right way - I would really appreciate any help!
Thanks
BNo conditional page breaks. I've been asking for them since the first
release a couple years ago. It is the main reason we have not migrated. If
you can't control the layout of the report it's pointless. I've tried many
workarounds but it seems like the developers went out of their way to not let
you programatically control them. Be it if you want to remove them as in
HTML reports or insert them manually.
Good luck on your quest. If you find something let us know.
"bigbrorpi@.gmail.com" wrote:
> Hi -
> I'm trying to generate invoice reports where there are two types of
> line items (with a different number of columns). I am basically looking
> to have two sets of tables as follows:
> Case A - at least one of each item
> Table Items 1
> <PAGE BREAK>
> Table Items 2
> Case B - items 2 exist, but no items 1
> Table Items 2
> Case C - items 1 exist, but no items 2
> Table Items 1
>
> I've spent hours trying to figure out how to accomplish this - I have
> played with putting Table 1 in an object with conditional visibility,
> but that doesn't seem to suppress a page break. I've tried a "hidden
> group" but no luck there either. I've also tried having Table items 1
> in a subreport.
> I'm open to suggestion if you don't think I am going about this the
> right way - I would really appreciate any help!
> Thanks
> B
>|||See if this can help :
You can insert a rectangle into a rectangle, and set a page break in the
inner rectangle and visibility in the outer and paste this empty nested
rectangles
in between subreports or tables . If Visible expression is True, the page
break will
work. if Visible expression is False , it will ignore a Page Break. So,
this nested construction will work as a conditional page break ( for RSS
2000) .