Showing posts with label field. Show all posts
Showing posts with label field. Show all posts

Wednesday, March 21, 2012

Grand Totals in Report Footer?

I have a table report with five groups and want to add grand totals to
my report footer. But if I add a field to the footer:
=Fields!Period_MonthToDate_Measures_B.Value
The footer shows the total of only the first item in the highest level
group. If I use a sum function:
=Sum(Fields!Period_MonthToDate_Measures_B.Value)
The total is five times the actual total, I guess due to the fact that
I have five levels.
How do I show the correct report total?
Thanks,
BurtBurt - I have been looking for an answer to a similar question - It would
strongly appear that MS didn't include this type of feature in this
release...and that is a kind way of putting it.
-KB
"Burt" <burt_5920@.yahoo.com> wrote in message
news:19e5f39f.0407271554.6cc831f0@.posting.google.com...
> I have a table report with five groups and want to add grand totals to
> my report footer. But if I add a field to the footer:
> =Fields!Period_MonthToDate_Measures_B.Value
> The footer shows the total of only the first item in the highest level
> group. If I use a sum function:
> =Sum(Fields!Period_MonthToDate_Measures_B.Value)
> The total is five times the actual total, I guess due to the fact that
> I have five levels.
> How do I show the correct report total?
> Thanks,
> Burt|||i had the same problem and i solved it with the runningvalue
did u try using RunningValue'

Grand Total for field problem


Hello,

In my SRS report, I have a field called "Alternate" where I need to check to find out if my picklist value = 2. This works out just great.

I have created a variable called "Total_Alternate". I don't seem to be able to get the right Grand Total here by using the code below

(1) Value in expression field for textbox9 - gives right total in this field for each group
=SUM(IIF(Fields!new_rpcstatus.value=2, CInt(Fields!Total_Alternate.value), 0))

(2) Value in Table Footer for the above field - doesn't give me the right number
=(Fields!Total_Alternate.Value)

What am I doing wrong?

If you want

number then

=Count(Fields!Total_Alternate.Value)

or if you want sum of these then

=Sum(Fields!Total_Alternate.Value)

sql

Grabbing a calculated field for a new calculation

I'm going to try and explain this as best as I can :)
I have calculated fields that has the following expressions - I've
named each textbox hoping that I could grab them in the expression but
I have no idea how':
1. totalMarket: =iif(sum(Fields!Wins.Value) = 0, 0, sum( Fields!
Wins.Value) + iif(sum(Fields!Pending.Value) = 0, 0, sum(Fields!
Pending.Value))) - iif(sum(Fields!Losses.Value) = 0, 0, sum(Fields!
Losses.Value))
2. remainingSales = =iif(Sum(Fields!Pending.Value)=0, 0, Sum(Fields!
Pending.Value))
I need the next text box (marketPercent) to do the following...
totalMarket - remainingSales / totalMarket
I used all the expression above to make it work - but there has to be
an easier way.. I tried using..
=iif(Sum(ReportItem!totalMarket.Value)) ... etc but that syntax did
not work... does anyone know how to grab the name of the textbox in
an expression?
ps - this is not a header or a footer - it's in the actual form
Thanks in advance!
LisaOn Jun 6, 10:38 am, peashoe <peas...@.yahoo.com> wrote:
> I'm going to try and explain this as best as I can :)
> I have calculated fields that has the following expressions - I've
> named each textbox hoping that I could grab them in the expression but
> I have no idea how':
> 1. totalMarket: =iif(sum(Fields!Wins.Value) = 0, 0, sum( Fields!
> Wins.Value) + iif(sum(Fields!Pending.Value) = 0, 0, sum(Fields!
> Pending.Value))) - iif(sum(Fields!Losses.Value) = 0, 0, sum(Fields!
> Losses.Value))
> 2. remainingSales = =iif(Sum(Fields!Pending.Value)=0, 0, Sum(Fields!
> Pending.Value))
> I need the next text box (marketPercent) to do the following...
> totalMarket - remainingSales / totalMarket
> I used all the expression above to make it work - but there has to be
> an easier way.. I tried using..
> =iif(Sum(ReportItem!totalMarket.Value)) ... etc but that syntax did
> not work... does anyone know how to grab the name of the textbox in
> an expression?
> ps - this is not a header or a footer - it's in the actual form
> Thanks in advance!
> Lisa
As far as I know, referencing the textbox control by an alias is not
possible. Referencing the textbox by the expression used is most
likely the only way to reference it. Sorry that I could not be of
greater assistance.
Regards,
Enrique Martinez
Sr. Software Consultantsql

Gr

I am creating a report in visual studio.
I pass in a field called delivery date
i want the report in 3 sections
Overdue, Today and future
however i am as yet able to find a way to have these 3 logical groupings
thanks frankI need it to know what todays date is.

i did have it working howver for each date it put in the heading|||>>I need it to know what todays date is.

Use currentdate in the formaulasql

Monday, March 19, 2012

Got HTML tags in my source, but need the text only on my Report..

Hello,
does anybody know how i can convince SRS to not show things like <DIV> , etc. ? Any Property of a Field or so ?
if not
2. Question :
Any Idea of how to do this in .NET programmatically ? There must be such a function !
HTML in -> Text out

Any hint would be appreciated !
best
regards
Robin

Try this: Right-click on the whitespace around the report and click on 'Properties' and then the Code tab.

In that spot put this function:

public shared function StripHTML(strInput as string) as string
Return System.Text.RegularExpressions.Regex.Replace(strInput, "<[^>]*>", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase)
end function
For the textbox or whatever make the expression say '=Code.StripHTML(Fields!DivTag.Value)'
This will strip anything surrounded by '<' and '>'
Let me know if this works

|||BGRhoades!
Slick - I like!

Google style search

Is there a way to do a google style search in SQL.
For example if I have a search field and someone puts in:
safe car
It will automatically search like this
contains(*,'"safe*" AND "car*"')
Or
if they put in
"safe car"
it would search in SQL like contains(*,'"safe car"')
Or
if they put in
safe -car AND dog
it would search in sql like contains(*,'"safe*" AND "dog*" AND NOT
"car"')
etc.
I guess I am looking for a regular expression or a script that would
parse the input field and output the user's query in a SQL server
acceptable format.
Google does a strict phrase based query, so safe car is searched as "safe"
or "car"
However to do what you want you would do the following:
Create PROCEDURE SearchSQL (@.stringin varchar(200), @.BooleanType int= NULL)
AS
-- a @.boolean type of null means a phrase based search
-- a @.boolean type of 0 means a phrase based search
-- a @.boolean type of 1 means an OR type search
-- a @.boolean type of 2 means an AND type search
-- a @.boolean type of 3 means an OR wildcarded type search
DECLARE @.holdingString VarChar(2000)
DECLARE @.whitespace INT
DECLARE @.boolean VarChar(10)
--returning a syntax message if no search phrase is passed
IF LEN(@.stringin)=0
BEGIN
PRINT 'usage is SimpleSQLFTSSearch ''Your Search Phrase goes here'''
RETURN -1
END
SET @.boolean=case WHEN @.booleantype=1 THEN char(34)+' OR ' + char(34)
WHEN @.booleantype=2 THEN char(34)+' AND ' + char(34)
WHEN @.booleantype=3 THEN char(34)+' OR ' + char(34)
ELSE ' ' END
DECLARE @.counter INT
DECLARE @.posold int
DECLARE @.posnew int
SET @.holdingstring='SELECT * FROM authors AS a JOIN
CONTAINSTABLE(authors,*,'''+char(34)
SELECT @.whitespace=LEN(@.stringin) - LEN(replace(@.stringin,' ',''))
SELECT @.posold=0
SELECT @.posnew=Charindex(' ',@.stringin)
WHILE @.whitespace >=0
BEGIN
IF @.whitespace=0
BEGIN
if @.booleanType =3
begin
SELECT
@.holdingString=@.holdingString+SUBSTRING(@.stringin, @.posold+1,LEN(@.stringin)-@.
posold+1)+'*'+char(34)+char(39)+',200) AS t ON '
end
else
begin
SELECT
@.holdingString=@.holdingString+SUBSTRING(@.stringin, @.posold+1,LEN(@.stringin)-@.
posold+1)+char(34)+char(39)+',200) AS t ON '
end
print @.holdingString
END
ELSE
BEGIN
if @.booleantype=3
begin
SELECT @.holdingString = CASE WHEN LEN(SUBSTRING(@.stringin,@.posold+1,
@.posnew-@.posold-1))>0 THEN @.holdingString+SUBSTRING(@.stringin,@.posold+1,
@.posnew-@.posold-1)+'*'+@.boolean ELSE @.holdingstring END
SELECT @.posold=@.posnew, @.posnew=Charindex(' ',@.stringin, @.posold+1)
END
else
begin
SELECT @.holdingString = CASE WHEN LEN(SUBSTRING(@.stringin,@.posold+1,
@.posnew-@.posold-1))>0 THEN @.holdingString+SUBSTRING(@.stringin,@.posold+1,
@.posnew-@.posold-1)+@.boolean ELSE @.holdingstring END
SELECT @.posold=@.posnew, @.posnew=Charindex(' ',@.stringin, @.posold+1)
end
end
SELECT @.whitespace=@.whitespace-1
END
SELECT @.holdingString = @.holdingString + 't.[KEY]=a.au_id ORDER BY RANK
DESC'
PRINT @.holdingstring
EXEC(@.holdingstring)
RETURN @.@.rowcount
--Usage is:
DECLARE @.returncode int
EXEC @.returncode=SearchSQL2 'this is a test',3
PRINT @.returncode
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Chuck P" <pe@.temp.gov> wrote in message
news:MPG.1cbcaa2b92fc73ee98969b@.news.microsoft.com ...
> Is there a way to do a google style search in SQL.
> For example if I have a search field and someone puts in:
> safe car
> It will automatically search like this
> contains(*,'"safe*" AND "car*"')
> Or
> if they put in
> "safe car"
> it would search in SQL like contains(*,'"safe car"')
> Or
> if they put in
> safe -car AND dog
> it would search in sql like contains(*,'"safe*" AND "dog*" AND NOT
> "car"')
> etc.
> I guess I am looking for a regular expression or a script that would
> parse the input field and output the user's query in a SQL server
> acceptable format.
|||thanks, Hillary
but I wanted to have more of the Google features
like searching for quoted phrases and using not or -
I think it will be a long process

Sunday, February 19, 2012

global code

Hi ,
I wrote a function in the report property code :
Public Function AA(field as string)
AA = field
End Function
When I try to write an expretion like :
=AA(Me.Value)
I get and error of AA is not recognize.
What is the problem ?
10x.You need to call your function as =Code.AA(Me.Value) . This will
solve your problem mentioned error.
I am doubtfull about what you exactly mean by Me.Vlaue
Hope this helps.
Thanks,
Mahesh