Showing posts with label expression. Show all posts
Showing posts with label expression. Show all posts

Friday, March 30, 2012

RowNumber counts hidden rows?

Hello i have an expression build on RowNumber and i realized it counts hidden
rows (visibility = false)... this seems very odd to me.. is the way it was
designed'let me be more specific... i have a expression to change the row color... but
this isn't working because the report is incrementing RowNumber on hidden
rows... so the coloring seems random to the person reading the report. Is
this normal' Is there a work around?
"thejez" wrote:
> Hello i have an expression build on RowNumber and i realized it counts hidden
> rows (visibility = false)... this seems very odd to me.. is the way it was
> designed'|||check the visibility property before set row color.
"thejez" <thejez@.discussions.microsoft.com> escreveu na mensagem
news:29D9F5ED-DB50-4C48-9BD0-C62F1005EB97@.microsoft.com...
> let me be more specific... i have a expression to change the row color...
> but
> this isn't working because the report is incrementing RowNumber on hidden
> rows... so the coloring seems random to the person reading the report. Is
> this normal' Is there a work around?
> "thejez" wrote:
>> Hello i have an expression build on RowNumber and i realized it counts
>> hidden
>> rows (visibility = false)... this seems very odd to me.. is the way it
>> was
>> designed'sql

Wednesday, March 21, 2012

Row Number within the Current Page

Is there an expression that can be placed in text box, within a table, that
generates a sequential number which gets reset on every page?
Assuming that the report was 2 pages long.
Page 1
Seq# Description
1 line one
2 line two
...
Page 2
Seq# Description
1 Line one on page two
2 Line two on page twoOn Mar 6, 12:48 pm, Fidencio <Fiden...@.discussions.microsoft.com>
wrote:
> Is there an expression that can be placed in text box, within a table, that
> generates a sequential number which gets reset on every page?
> Assuming that the report was 2 pages long.
> Page 1
> Seq# Description
> 1 line one
> 2 line two
> ...
> Page 2
> Seq# Description
> 1 Line one on page two
> 2 Line two on page two
As far as I know there is not, outside of the RowNumber("tableName")
option, which does not reset per page. You might implement this easier
in the stored procedure or report query that sources the report. Sorry
that I could not be of further assistance.
Regards,
Enrique Martinez
Sr. SQL Server Developer|||Thank you Enrique for the response.
I will come up with an alternative.|||This resetting of the no works with groups so what you can do is to give a
group expression something like this..=Int((RowNumber(Nothing)-1)/20)
this infact breaks every 20 rows and goes to next page. so you can vary this
no as per your requirements and at the same time your no will get reset due
to group expression.
Amarnath, MCTS
"Fidencio" wrote:
> Is there an expression that can be placed in text box, within a table, that
> generates a sequential number which gets reset on every page?
> Assuming that the report was 2 pages long.
> Page 1
> Seq# Description
> 1 line one
> 2 line two
> ...
> Page 2
> Seq# Description
> 1 Line one on page two
> 2 Line two on page two

Row Num in matrix

I am using Matrix in my report.
I have One Row Group (ProductID) and 7 Static rows.
Expression for my ProductID Group is =Fields!ProductID.Value
How can I set the Page break so I can accomodate 4 Row Groups (i.e) 28 lines
on one page and then goto next page.
Any Suggestions.Assuming you have one row of data in your query per product, you can put the
matrix in a list which groups on =Ceiling(RowNumber(Nothing)/4) and put
PageBreakAtEnd on either the list's grouping or on the matrix.
--
This post is provided 'AS IS' with no warranties, and confers no rights. All
rights reserved. Some assembly required. Batteries not included. Your
mileage may vary. Objects in mirror may be closer than they appear. No user
serviceable parts inside. Opening cover voids warranty. Keep out of reach of
children under 3.
"battula" <battula_28@.hotmail.com> wrote in message
news:ODossYidEHA.1152@.TK2MSFTNGP09.phx.gbl...
> I am using Matrix in my report.
> I have One Row Group (ProductID) and 7 Static rows.
> Expression for my ProductID Group is =Fields!ProductID.Value
> How can I set the Page break so I can accomodate 4 Row Groups (i.e) 28
lines
> on one page and then goto next page.
> Any Suggestions.
>sql

Wednesday, March 7, 2012

rounding decimal points in an expression

This sounds so simple but yet don't know why it doesn't work.

i've got two decimal numbers in columns

closingUnits = 25093.53640

closingAmt = 59110.33

i use a derived column transformation to generate a string column which is the division of those two above.

mystrfield = closingAmt /closingUnits = 2.355599

what i want is cast it to just 4 decimal points when i run the expression below it cast it to 4 decimal points but it doesn't do any rounding.

the value i get is 2.3555 when i should get 2.3556

(ISNULL(closingAmt ) || closingUnits == 0) ? "0.0000" : ((closingAmt / closingUnits) < 1 && (closingAmt / closingUnits) > -1 ? "0" : "") + (DT_WSTR,15)(DT_DECIMAL,4)(closingAmt / closingUnits)

Found the answer,

silly me, it's ROUND duh!!!

http://msdn2.microsoft.com/en-us/library/ms141721.aspx