Wednesday, March 28, 2012
RunningValue crashes VS
table.
I've added a field for a running total:
Field is amount_rt
Definition is: =RunningValue(Fields!amount.Value,Sum,Nothing)
The second I try to preview the report or deploy it, VS crashes.
I figured it might be something with my data, so I changed
Fields!amount.Value to Fields!test.Value where test = 1
Same thing.
The error message gives me no detail whatsoever.
Has anyone seen this before?
ThanksDid you create this field by going to your dataset and adding a newfield, or
just by code in a textbox or table?
<bigbrorpi@.gmail.com> wrote in message
news:1156263917.161190.3160@.b28g2000cwb.googlegroups.com...
>I have a standard report with a bunch of fields and groups within a
> table.
> I've added a field for a running total:
> Field is amount_rt
> Definition is: =RunningValue(Fields!amount.Value,Sum,Nothing)
> The second I try to preview the report or deploy it, VS crashes.
> I figured it might be something with my data, so I changed
> Fields!amount.Value to Fields!test.Value where test = 1
> Same thing.
> The error message gives me no detail whatsoever.
> Has anyone seen this before?
> Thanks
>
Running update syntax at set time
Is it possible for me to run an update syntax at a certain time say midnight for example?
I'm trying to update a bit field in my table (which acts as a checkbox in my Access front end), but only if three date fields are before todays date. The dates in question are in two other tables.
If so how would I go about doing this?
ThanksHave you looked at Books OnLine and read about the SQL Server Agent and scheduled jobs?|||What's Books OnLine, and where can I find it?|||What's Books OnLine, and where can I find it?Books Online = BOL = SQL Server Help - easily accessed via Query Analyser and Enterprise Manager.
BTW - are you sure you want to derive this overnight rather than at runtime or (possibly) at point of data capture?
Monday, March 26, 2012
Running Total Formula
I have a formula that I am trying to use to create a sub-total for each group in a report.
For a field called billcode_name I am trying to separate the "Regular Bill" and "Travel" instances from the rest of the billcode names. I already have a sum that is adding the totals for these entries which is why I have to create a formula.
My code is as follows:
WhilePrintingRecords;
NumberVar totalb := 0;
If ({clientbreakdown_ttx.billcode_name} = "Regular Bill") OR ({clientbreakdown_ttx.billcode_name} = "Travel") Then
totalb := totalb + {clientbreakdown_ttx.task_dur}
Else
totalb := totalb;
totalb
This only adds the last sum to the total. Is there some sort of loop which will add both the "Regular Bill" and "Travel" to my totalb variable so I can display it?
Thanks in advance.please make ur query a bit clear so that i can give u closer solution to u.
do u want to calculate seperate sum for each.
or want to have combined sum etc etc
Thanks
Silly|||Hi Silly Star,
Yes , just total each for billable and non-billable items. But how do I sort?
It's supposed to look like this:
BILLCODE NAME BILLABLE HOURS NONBILLABLE HOURS|||Hi Silly Star,
Yes , just total each for billable and non-billable items. But how do I sort?
It's supposed to look like this:
BILLCODE NAME BILLABLE HOURS NONBILLABLE HOURS
Regular Bill 8.5 0.0
Travel .5 0.0
Meeting 0.0 1.0
Research 0.0 3.0
Total 9.0 4.0
How do I sort through the varios billcode names and total the billable and nonbillable hours?
Thanks.|||Hi Silly Star,
I solved my problem by putting the functions in the user defined funtions of the SQL Server database. Then the functions are included as fields in the query and can be manipulated by the IDE of Crystal Reports. Thansk for your help.
Krusty678sql
Friday, March 23, 2012
Running total for Cell Reference in SQL Reports
Hi,
I'm trying to do running total of the calculated field. Here is the detail of my RDL:
In a table, I have "textbox34" with the formula =count(Fields!ADF_NO.Value) in it and "textbox30" with the formula =first(Fields!TOTSTKS2.Value, "ProdServSales") - reportitems!TOTSTKS.value in it. I have divided "textbox 34" with "textbox30", and placed the results in "textbox36". Now, I want to do a cummulative total (Running total) of "textbox36", using the formula =runningvalue(reportitems!textbox36.Value, sum, nothing) in "textbox14". Its giving me an error saying:
"[rsAggregateReportItemInBody] The Value expression for the textbox 'textbox14' uses an aggregate function on a report item. Aggregate functions can be used only on report items contained in page headers and footers."
Any suggestions? I appreciate your help on this.
Thanks
Perm
Hello Perm,
Could you try to remove the ReportItems from your RunningValue calculation? Something like this, but you'll have to take out the 'reportitems!TOTSTKS.value' and replace it with the field it's pulling from.
=runningvalue(count(Fields!ADF_NO.Value) / (first(Fields!TOTSTKS2.Value, "ProdServSales") - reportitems!TOTSTKS.value)), sum, nothing)
Jarret
|||Hi Jarret,
Thanks for your reply.
Value in "reportitems!TOTSTKS.value" is also a runningvalue. It is: runningvalue(Fields!PSR_NO.Value, countdistinct, nothing)
When I try putting this in my query, I get an error saying that "An aggregate function cannot be nested inside another aggregate function".
Is it possible in VBasic...through Report Properties--> Code? Because, all I'm trying to do is to do a cummulative total (RunningTotal) of textbox36.
I appreciate your help on this.
Perm
Running Total
I want to add a Running Total field to a report, but i cant use the function
RunningValue() because the running total is calculated based on the some
other field's value.
I tried to solve this problem by adding a shared variable and a shared
function(to increment the shared variable). This method works fine. But now
i have to add 4 more running totals, so i have to add 4 more shared
variables and 4 more function(because the running total logic different for
each field). So this is not a good idea.
Any method to solve this problem without using a separate function for each
running total?
Thanks,
SamuelYou should be able to use RunningValue based on any field value (or
expression).
For example:
=RunningValue(Sum,Fields!Sales.Value,Nothing)
The third argument is the grouping scope on which to reset the running
value. If you're implementing your own running value functionality so that
you can control the resetting, you should instead group on the field on
which you want to reset and use the third argument.
--
My employer's lawyers require me to say:
"This posting is provided 'AS IS' with no warranties, and confers no
rights."
"Samuel" <samuel@.photoninfotech.com> wrote in message
news:uCJSJnkYEHA.3016@.tk2msftngp13.phx.gbl...
> Hi all,
> I want to add a Running Total field to a report, but i cant use the
function
> RunningValue() because the running total is calculated based on the some
> other field's value.
> I tried to solve this problem by adding a shared variable and a shared
> function(to increment the shared variable). This method works fine. But
now
> i have to add 4 more running totals, so i have to add 4 more shared
> variables and 4 more function(because the running total logic different
for
> each field). So this is not a good idea.
> Any method to solve this problem without using a separate function for
each
> running total?
> Thanks,
> Samuel
>|||Hi Chris,
Thanks for your reply.
Actually I want to perform the sum operation for some rows and skip others.
For Example, consider the following data
Date Amount Type
1-1-04 10000 Dr
1-2-04 5000 Cr
1-3-04 10000 Cr
I want to print Dr=10000 and Cr=5000 in the group footer.
Thanks,
Samuel
"Chris Hays [MSFT]" <chays@.online.microsoft.com> wrote in message
news:%23UyDHu4YEHA.3664@.TK2MSFTNGP12.phx.gbl...
> You should be able to use RunningValue based on any field value (or
> expression).
> For example:
> =RunningValue(Sum,Fields!Sales.Value,Nothing)
> The third argument is the grouping scope on which to reset the running
> value. If you're implementing your own running value functionality so
that
> you can control the resetting, you should instead group on the field on
> which you want to reset and use the third argument.
> --
> My employer's lawyers require me to say:
> "This posting is provided 'AS IS' with no warranties, and confers no
> rights."
> "Samuel" <samuel@.photoninfotech.com> wrote in message
> news:uCJSJnkYEHA.3016@.tk2msftngp13.phx.gbl...
> > Hi all,
> >
> > I want to add a Running Total field to a report, but i cant use the
> function
> > RunningValue() because the running total is calculated based on the some
> > other field's value.
> >
> > I tried to solve this problem by adding a shared variable and a shared
> > function(to increment the shared variable). This method works fine. But
> now
> > i have to add 4 more running totals, so i have to add 4 more shared
> > variables and 4 more function(because the running total logic different
> for
> > each field). So this is not a good idea.
> >
> > Any method to solve this problem without using a separate function for
> each
> > running total?
> >
> > Thanks,
> > Samuel
> >
> >
>|||It sounds like you don't actually want a RunningValue at all, but rather a
conditional sum.
Try this:
=Sum(iif(Fields!Type.Value="Dr",Fields!Amount.Value,0))
and
=Sum(iif(Fields!Type.Value="Cr",Fields!Amount.Value,0))
Note: If you really do want a running value, you can do something similar:
=RunningValue(Sum,iif(Fields!Type.Value="Dr",Fields!Amount.Value,0),Nothing)
--
My employer's lawyers require me to say:
"This posting is provided 'AS IS' with no warranties, and confers no
rights."
"Samuel" <samuel@.photoninfotech.com> wrote in message
news:OSmyVwAZEHA.1356@.TK2MSFTNGP09.phx.gbl...
> Hi Chris,
> Thanks for your reply.
> Actually I want to perform the sum operation for some rows and skip
others.
> For Example, consider the following data
> Date Amount Type
> 1-1-04 10000 Dr
> 1-2-04 5000 Cr
> 1-3-04 10000 Cr
> I want to print Dr=10000 and Cr=5000 in the group footer.
> Thanks,
> Samuel
> "Chris Hays [MSFT]" <chays@.online.microsoft.com> wrote in message
> news:%23UyDHu4YEHA.3664@.TK2MSFTNGP12.phx.gbl...
> > You should be able to use RunningValue based on any field value (or
> > expression).
> >
> > For example:
> > =RunningValue(Sum,Fields!Sales.Value,Nothing)
> >
> > The third argument is the grouping scope on which to reset the running
> > value. If you're implementing your own running value functionality so
> that
> > you can control the resetting, you should instead group on the field on
> > which you want to reset and use the third argument.
> >
> > --
> > My employer's lawyers require me to say:
> > "This posting is provided 'AS IS' with no warranties, and confers no
> > rights."
> >
> > "Samuel" <samuel@.photoninfotech.com> wrote in message
> > news:uCJSJnkYEHA.3016@.tk2msftngp13.phx.gbl...
> > > Hi all,
> > >
> > > I want to add a Running Total field to a report, but i cant use the
> > function
> > > RunningValue() because the running total is calculated based on the
some
> > > other field's value.
> > >
> > > I tried to solve this problem by adding a shared variable and a shared
> > > function(to increment the shared variable). This method works fine.
But
> > now
> > > i have to add 4 more running totals, so i have to add 4 more shared
> > > variables and 4 more function(because the running total logic
different
> > for
> > > each field). So this is not a good idea.
> > >
> > > Any method to solve this problem without using a separate function for
> > each
> > > running total?
> > >
> > > Thanks,
> > > Samuel
> > >
> > >
> >
> >
>|||Oops, I've been swapping the first two arguments in RunningValue.
Hopefully you read what I meant rather than what I wrote :)
My employer's lawyers require me to say:
"This posting is provided 'AS IS' with no warranties, and confers no
rights."
"Chris Hays [MSFT]" <chays@.online.microsoft.com> wrote in message
news:uwUopHFZEHA.2944@.TK2MSFTNGP11.phx.gbl...
> It sounds like you don't actually want a RunningValue at all, but rather a
> conditional sum.
> Try this:
> =Sum(iif(Fields!Type.Value="Dr",Fields!Amount.Value,0))
> and
> =Sum(iif(Fields!Type.Value="Cr",Fields!Amount.Value,0))
> Note: If you really do want a running value, you can do something
similar:
>
=RunningValue(Sum,iif(Fields!Type.Value="Dr",Fields!Amount.Value,0),Nothing)
> --
> My employer's lawyers require me to say:
> "This posting is provided 'AS IS' with no warranties, and confers no
> rights."
> "Samuel" <samuel@.photoninfotech.com> wrote in message
> news:OSmyVwAZEHA.1356@.TK2MSFTNGP09.phx.gbl...
> > Hi Chris,
> >
> > Thanks for your reply.
> >
> > Actually I want to perform the sum operation for some rows and skip
> others.
> > For Example, consider the following data
> > Date Amount Type
> >
> > 1-1-04 10000 Dr
> >
> > 1-2-04 5000 Cr
> >
> > 1-3-04 10000 Cr
> >
> > I want to print Dr=10000 and Cr=5000 in the group footer.
> >
> > Thanks,
> >
> > Samuel
> >
> > "Chris Hays [MSFT]" <chays@.online.microsoft.com> wrote in message
> > news:%23UyDHu4YEHA.3664@.TK2MSFTNGP12.phx.gbl...
> > > You should be able to use RunningValue based on any field value (or
> > > expression).
> > >
> > > For example:
> > > =RunningValue(Sum,Fields!Sales.Value,Nothing)
> > >
> > > The third argument is the grouping scope on which to reset the running
> > > value. If you're implementing your own running value functionality so
> > that
> > > you can control the resetting, you should instead group on the field
on
> > > which you want to reset and use the third argument.
> > >
> > > --
> > > My employer's lawyers require me to say:
> > > "This posting is provided 'AS IS' with no warranties, and confers no
> > > rights."
> > >
> > > "Samuel" <samuel@.photoninfotech.com> wrote in message
> > > news:uCJSJnkYEHA.3016@.tk2msftngp13.phx.gbl...
> > > > Hi all,
> > > >
> > > > I want to add a Running Total field to a report, but i cant use the
> > > function
> > > > RunningValue() because the running total is calculated based on the
> some
> > > > other field's value.
> > > >
> > > > I tried to solve this problem by adding a shared variable and a
shared
> > > > function(to increment the shared variable). This method works fine.
> But
> > > now
> > > > i have to add 4 more running totals, so i have to add 4 more shared
> > > > variables and 4 more function(because the running total logic
> different
> > > for
> > > > each field). So this is not a good idea.
> > > >
> > > > Any method to solve this problem without using a separate function
for
> > > each
> > > > running total?
> > > >
> > > > Thanks,
> > > > Samuel
> > > >
> > > >
> > >
> > >
> >
> >
>