Showing posts with label report. Show all posts
Showing posts with label report. Show all posts

Thursday, March 29, 2012

Do nto send scheduled report when no data is present

Dear Friends:

Could somebody please help me to stop sending scheduled report when no data is present in the report? Actually I have a daily report which is sent to the client and in a week, two or three days, data will not be there and thus it delivers blank report to the client.

So how can I stop sending blank mails to the client?

Thanks in Advance

Emmanuel Mathew

One possibility would be creating a data-driven subscription with query that returns an empty list of recipients if no data for the report is available.sql

Do not render report with no data

Hi!
I would like to stop processing of a report that has no data in a specific
dataset. Is this somehow possible?
In Access its possible to not process a report if there is no data behind
it.
Or is the only way to write an application that checks if the data exist and
if not just skips the Render part?
Thanks for any hints!
rgds,
tomOr can I somehow throw an excpetion inside of the report if a specific
dataset has no data?
"Thomas Kern" <tomiknocker@.hotmail.com> wrote in message
news:OUgDeGX$EHA.3372@.TK2MSFTNGP10.phx.gbl...
> Hi!
> I would like to stop processing of a report that has no data in a
> specific dataset. Is this somehow possible?
> In Access its possible to not process a report if there is no data behind
> it.
> Or is the only way to write an application that checks if the data exist
> and if not just skips the Render part?
> Thanks for any hints!
> rgds,
> tom
>|||Thomas Kern wrote:
> Or can I somehow throw an excpetion inside of the report if a specific
> dataset has no data?
You can use the rowcount-property of the dataset and that the
report-visibility or your dataregion or elements to true or false.
regards
Frank
www.xax.de|||Where is the RowCount property of a dataset?
I need to limit mine...
thanks,
trint
Frank Matthiesen wrote:
> Thomas Kern wrote:
> > Or can I somehow throw an excpetion inside of the report if a
specific
> > dataset has no data?
> You can use the rowcount-property of the dataset and that the
> report-visibility or your dataregion or elements to true or false.
> regards
> Frank
> www.xax.de|||Use the CountRows aggregate function. E.g. =CountRows("DatasetName")
See also:
http://msdn.microsoft.com/library/en-us/rscreate/htm/rcr_creating_expressions_v1_0k6r.asp
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"trint" <trinity.smith@.gmail.com> wrote in message
news:1106067185.185429.115960@.z14g2000cwz.googlegroups.com...
> Where is the RowCount property of a dataset?
> I need to limit mine...
> thanks,
> trint
>
> Frank Matthiesen wrote:
> > Thomas Kern wrote:
> > > Or can I somehow throw an excpetion inside of the report if a
> specific
> > > dataset has no data?
> >
> > You can use the rowcount-property of the dataset and that the
> > report-visibility or your dataregion or elements to true or false.
> >
> > regards
> >
> > Frank
> > www.xax.de
>|||how can I set the report visibility to false?
I really want to prevent to report from beeing generated in this case.
thanks.
"Frank Matthiesen" <fm@.xax.de> wrote in message
news:354qr8F4969gvU1@.individual.net...
> Thomas Kern wrote:
>> Or can I somehow throw an excpetion inside of the report if a specific
>> dataset has no data?
> You can use the rowcount-property of the dataset and that the
> report-visibility or your dataregion or elements to true or false.
> regards
> Frank
> www.xax.de
>
>|||I found the following solution but its more database-centric:
-) Check the @.@.rowcount of the query inside the Stored Procedure.
-) If @.@.rowcount = 0, RAISERROR
here we go: this is becomes an exception in the report and it is not
rendered!
tom
"Thomas Kern" <tomiknocker@.hotmail.com> wrote in message
news:us3ocLa$EHA.2984@.TK2MSFTNGP09.phx.gbl...
> how can I set the report visibility to false?
> I really want to prevent to report from beeing generated in this case.
> thanks.
> "Frank Matthiesen" <fm@.xax.de> wrote in message
> news:354qr8F4969gvU1@.individual.net...
>> Thomas Kern wrote:
>> Or can I somehow throw an excpetion inside of the report if a specific
>> dataset has no data?
>> You can use the rowcount-property of the dataset and that the
>> report-visibility or your dataregion or elements to true or false.
>> regards
>> Frank
>> www.xax.de
>>
>

Do not Email if No Data

Is there a way to set up a subscription so that it does not email the
blank report if there was no data resulting from the query?
Thanks
BobBob,
Did you figure this out ? Just posted the same issue.
Thanks, Steve.
"Bob" wrote:
> Is there a way to set up a subscription so that it does not email the
> blank report if there was no data resulting from the query?
> Thanks
> Bob
>

Tuesday, March 27, 2012

Do I need to learn report services if I already knew Crystal report?

Do I need to learn report services if I already knew Crystal report?

What features of Reporting services are not in Crystal report?

Hi

Well when i first started building reports online i started with CR but when the big bang of SSRS came in i decided had to learn it but i felt really bad to start learning all from scratch... long story short the answer is yes!! you do have to learn it... it aint much though its quite simple i suggest u seek out in the web for some tutorials... theres a few good ones out there that saved my live!!

and about the features available that are not in CR's.. well it all depends on wich version ur working on... but the good thing about it is that the reports are centralized in a reportserver...

hope this motivates you (know how u feel being a CR ex user...)

Later aspfun...Yes

|||

Thank you.

I used CR in net for a few year but I still do not like CR. The only thing I like CR is you can select dataset as data source.

But, SSRS did not have this option.

|||

here is 3 videos that could give you a deeper idea about srss features and what you can and cannot do with it ...http://www.ssw.com.au/ssw/Standards/Rules/RulesToBetterSQLReportingServices.aspx#use

Enjoy...

sql

Thursday, March 22, 2012

Do i have SP1?

I thought i'd upgraded my Report Designer for SP1, but now i'm not so sure.
There is no "Prompt the User" checkbox for my parameters. The version number
for my RD is: Version 8.00.878.00.
Can anyone tell from that whether im SP1 or not?
TIA,
BrianThat is SP1. Did you install both at the designer client and at the server?
It needs to be installed both places. To check the version of the server do
this:
http://servername/Reportserver
Bruce L-C
"G" <brian.grant@.si-intl-kc.com> wrote in message
news:O4i0sqzaEHA.3988@.tk2msftngp13.phx.gbl...
> I thought i'd upgraded my Report Designer for SP1, but now i'm not so
sure.
> There is no "Prompt the User" checkbox for my parameters. The version
number
> for my RD is: Version 8.00.878.00.
> Can anyone tell from that whether im SP1 or not?
> TIA,
> Brian
>|||Report Server is showing the same version number. I should have a checkbox
which says "Prompt Users" when defining parameters, correct?
"Bruce Loehle-Conger" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:edO%23WwzaEHA.1764@.TK2MSFTNGP10.phx.gbl...
> That is SP1. Did you install both at the designer client and at the
server?
> It needs to be installed both places. To check the version of the server
do
> this:
> http://servername/Reportserver
> Bruce L-C
> "G" <brian.grant@.si-intl-kc.com> wrote in message
> news:O4i0sqzaEHA.3988@.tk2msftngp13.phx.gbl...
> > I thought i'd upgraded my Report Designer for SP1, but now i'm not so
> sure.
> > There is no "Prompt the User" checkbox for my parameters. The version
> number
> > for my RD is: Version 8.00.878.00.
> >
> > Can anyone tell from that whether im SP1 or not?
> >
> > TIA,
> > Brian
> >
> >
>|||Someone else will have to jump in. This SP1 feature is not one I have tried
to use.
Bruce L-C
"G" <brian.grant@.si-intl-kc.com> wrote in message
news:OvcJeK0aEHA.2520@.TK2MSFTNGP12.phx.gbl...
> Report Server is showing the same version number. I should have a checkbox
> which says "Prompt Users" when defining parameters, correct?
>
> "Bruce Loehle-Conger" <bruce_lcNOSPAM@.hotmail.com> wrote in message
> news:edO%23WwzaEHA.1764@.TK2MSFTNGP10.phx.gbl...
> > That is SP1. Did you install both at the designer client and at the
> server?
> > It needs to be installed both places. To check the version of the server
> do
> > this:
> >
> > http://servername/Reportserver
> >
> > Bruce L-C
> >
> > "G" <brian.grant@.si-intl-kc.com> wrote in message
> > news:O4i0sqzaEHA.3988@.tk2msftngp13.phx.gbl...
> > > I thought i'd upgraded my Report Designer for SP1, but now i'm not so
> > sure.
> > > There is no "Prompt the User" checkbox for my parameters. The version
> > number
> > > for my RD is: Version 8.00.878.00.
> > >
> > > Can anyone tell from that whether im SP1 or not?
> > >
> > > TIA,
> > > Brian
> > >
> > >
> >
> >
>|||I figured it out. As usual, i'm an idiot. I was confusing "Report Manager"
and "Report Designer".
On the report manager, the "Prompt User" box is as plain as the nose on my
face.
"Bruce Loehle-Conger" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:OyxQ2j0aEHA.3892@.TK2MSFTNGP10.phx.gbl...
> Someone else will have to jump in. This SP1 feature is not one I have
tried
> to use.
> Bruce L-C
> "G" <brian.grant@.si-intl-kc.com> wrote in message
> news:OvcJeK0aEHA.2520@.TK2MSFTNGP12.phx.gbl...
> > Report Server is showing the same version number. I should have a
checkbox
> > which says "Prompt Users" when defining parameters, correct?
> >
> >
> >
> > "Bruce Loehle-Conger" <bruce_lcNOSPAM@.hotmail.com> wrote in message
> > news:edO%23WwzaEHA.1764@.TK2MSFTNGP10.phx.gbl...
> > > That is SP1. Did you install both at the designer client and at the
> > server?
> > > It needs to be installed both places. To check the version of the
server
> > do
> > > this:
> > >
> > > http://servername/Reportserver
> > >
> > > Bruce L-C
> > >
> > > "G" <brian.grant@.si-intl-kc.com> wrote in message
> > > news:O4i0sqzaEHA.3988@.tk2msftngp13.phx.gbl...
> > > > I thought i'd upgraded my Report Designer for SP1, but now i'm not
so
> > > sure.
> > > > There is no "Prompt the User" checkbox for my parameters. The
version
> > > number
> > > > for my RD is: Version 8.00.878.00.
> > > >
> > > > Can anyone tell from that whether im SP1 or not?
> > > >
> > > > TIA,
> > > > Brian
> > > >
> > > >
> > >
> > >
> >
> >
>

Wednesday, March 21, 2012

DNS_HOST_NOT_FOUND on localhost with Adventureworks

Hi, I just installed on XP Pro SP1 - the developer edition for SQL 2000 &
Report Services. The problem I am encountering is that I can not get any
report to render. I can publish/deploy them without error. The report
manager works fine until I click on a report.
Here's the odd part, if I use the reportserver URL such as :
http://localhost/reportserver?%2fSampleReports%2fCompany+Sales&rs:Command=Render
The report renders fine. The issue is rendering in Report Manager. Here is
the full error message:
Bad Gateway
The following error occurred:
[code=DNS_HOST_NOT_FOUND] The host name was not found during the DNS lookup.
Contact your system administrator if the problem is not found by retrying the
URL.
----
Please contact the administrator.
I would appreciate any help.
Thank you.I found the problem - the config file for RSManager only had the computer
name, but not the entire DSN name.
"Bob" wrote:
> Hi, I just installed on XP Pro SP1 - the developer edition for SQL 2000 &
> Report Services. The problem I am encountering is that I can not get any
> report to render. I can publish/deploy them without error. The report
> manager works fine until I click on a report.
> Here's the odd part, if I use the reportserver URL such as :
> http://localhost/reportserver?%2fSampleReports%2fCompany+Sales&rs:Command=Render
> The report renders fine. The issue is rendering in Report Manager. Here is
> the full error message:
> Bad Gateway
> The following error occurred:
> [code=DNS_HOST_NOT_FOUND] The host name was not found during the DNS lookup.
> Contact your system administrator if the problem is not found by retrying the
> URL.
> ----
> Please contact the administrator.
> I would appreciate any help.
> Thank you.sql

Sunday, March 11, 2012

DLL

I have a report that need to use a decrypting dll. I can save the DLL on my
locat drive and run the report locally in the report designer. Ho do I get
it to work with a published report. I have put the dll on the local drive of
the server but it does not work when I run the report in report manager.There should be detailed instructions in RS books under "custom assemblies"
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
(Please respond only to the newsgroup.)
I support the Professional Association for SQL Server ( PASS) and it's
community of SQL Professionals.
"johnE" <johnE@.discussions.microsoft.com> wrote in message
news:535467D0-6489-4944-BB1C-7C445B36FAE5@.microsoft.com...
> I have a report that need to use a decrypting dll. I can save the DLL on
my
> locat drive and run the report locally in the report designer. Ho do I
get
> it to work with a published report. I have put the dll on the local drive
of
> the server but it does not work when I run the report in report manager.

Friday, March 9, 2012

Dividing reports into pages

I am displaying tabular reports and the report is set to dataset. I want to display only 10 records per page. How do I do this.

Thanks,

Sai Abhiram Bandhakavi

Have you looked in to custom code. Off the top of my head I don't know of another way to determine a page break other than groupings. So you could set a calculated field value based on some function through custom code to increment a number on everything 10th record.

The custom code would be a simple add one to a public variable when run... So in the calculated field you could use the IIF(RowNumber(Nothing) mod 10 = 0, <true>, <false>) to fire on every 10th record... or something similar.

Check this out. I'll run some tests as time permits. If nothing else I hope I provided some ideas.

Dividing lines between questions in report

Hello
I'm using SQL Server Reporting Services 2000. I have a report with the
following details:-
Subtopic Question Answer Total %age Details %age
The query behind the report groups results on subtopic and question.
What I would like to do is put in a dividing line every time the question
changes. This will not be every line, however, since there can be up to 4
answers for each question. I am hiding duplicate questions, so the
question text only shows on the first line, although there may be 4 lines
for each question altogether.
When I try to add a separating line it adds one after every line, so for
each question there will be up to 4 lines. I only want a line to appear
when the question changes.
Can anyone help with this? It's driving me bonkers!
Many thanks
Denise CrawleyIf you include a group footer, you can create the line there.
"Denise" wrote:
> Hello
> I'm using SQL Server Reporting Services 2000. I have a report with the
> following details:-
> Subtopic Question Answer Total %age Details %age
> The query behind the report groups results on subtopic and question.
> What I would like to do is put in a dividing line every time the question
> changes. This will not be every line, however, since there can be up to 4
> answers for each question. I am hiding duplicate questions, so the
> question text only shows on the first line, although there may be 4 lines
> for each question altogether.
> When I try to add a separating line it adds one after every line, so for
> each question there will be up to 4 lines. I only want a line to appear
> when the question changes.
> Can anyone help with this? It's driving me bonkers!
> Many thanks
> Denise Crawley
>|||Thanks very much, that's exactly what I was looking for.
On Wed, 8 Feb 2006 13:07:29 -0800, daw wrote:
> If you include a group footer, you can create the line there.
> "Denise" wrote:
>> Hello
>> I'm using SQL Server Reporting Services 2000. I have a report with the
>> following details:-
>> Subtopic Question Answer Total %age Details %age
>> The query behind the report groups results on subtopic and question.
>> What I would like to do is put in a dividing line every time the question
>> changes. This will not be every line, however, since there can be up to 4
>> answers for each question. I am hiding duplicate questions, so the
>> question text only shows on the first line, although there may be 4 lines
>> for each question altogether.
>> When I try to add a separating line it adds one after every line, so for
>> each question there will be up to 4 lines. I only want a line to appear
>> when the question changes.
>> Can anyone help with this? It's driving me bonkers!
>> Many thanks
>> Denise Crawley

Wednesday, March 7, 2012

Divide by a first row of resultset in a matrix

I'm creating my first matrix based report, and find that some things that
work with tables doesn't work the same way with matrix.
My resultset comes from an MDX statement. It looks something like this
..............................Registered hours ..........Amount
.............Total.....................10...................
1000
Month1....Group 1..................6.....................600
.............Group
2..................4.....................400
.............Total.....................12...................
1200
Month2....Group 1..................8.....................800
.............Group
2..................4.....................400
The customer wants to display the values for the months next to each other,
for each value. Now, I've managed to get this with a matrix, having the
[static group] ordered on top. (Thanks to Ohjoo Kwon).
BUT one of my columns is supposed to be "Group Result as % of total result."
Meaning for Group1 in Month1 I need to divide 600 on the Total Amount. The
first row in my result set is always a calculated total for that month. So,
when using tables, I usually just do =Amount/First(Amount), and that works
like a charm. When I try to do that in a matrix, all I get in return is
"100%". So my guess is that in a matrix, I can't use First() the same way as
in a table. But how can I do the division? How to divide "Any Row" by "First
Row"?
All help appreciated.
Kaisa M. LindahlYou have to provide the "right" scope for the aggregate function. Try one of
the two following expressions to divide by the first row:
=Sum(Fields!Amount.Value) / First(Fields!Amount.Value, "DataSetName")
=Sum(Fields!Amount.Value) / First(Fields!Amount.Value, "MatrixName")
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Kaisa M. Lindahl" <kaisaml@.hotmail.com> wrote in message
news:enVnqz6BFHA.2260@.TK2MSFTNGP14.phx.gbl...
> I'm creating my first matrix based report, and find that some things that
> work with tables doesn't work the same way with matrix.
> My resultset comes from an MDX statement. It looks something like this
> ..............................Registered hours
..........Amount
>
.............Total.....................10...................
> 1000
> Month1....Group 1..................6.....................600
> .............Group
> 2..................4.....................400
>
.............Total.....................12...................
> 1200
> Month2....Group 1..................8.....................800
> .............Group
> 2..................4.....................400
> The customer wants to display the values for the months next to each
other,
> for each value. Now, I've managed to get this with a matrix, having the
> [static group] ordered on top. (Thanks to Ohjoo Kwon).
> BUT one of my columns is supposed to be "Group Result as % of total
result."
> Meaning for Group1 in Month1 I need to divide 600 on the Total Amount. The
> first row in my result set is always a calculated total for that month.
So,
> when using tables, I usually just do =Amount/First(Amount), and that works
> like a charm. When I try to do that in a matrix, all I get in return is
> "100%". So my guess is that in a matrix, I can't use First() the same way
as
> in a table. But how can I do the division? How to divide "Any Row" by
"First
> Row"?
> All help appreciated.
> Kaisa M. Lindahl
>|||Thanks.
It worked with
=Sum(Fields!Amount.Value) / First(Fields!Amount.Value, "DataSetName")
Kaisa
"Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in message
news:etV2GOOCFHA.1392@.tk2msftngp13.phx.gbl...
> You have to provide the "right" scope for the aggregate function. Try one
of
> the two following expressions to divide by the first row:
> =Sum(Fields!Amount.Value) / First(Fields!Amount.Value, "DataSetName")
> =Sum(Fields!Amount.Value) / First(Fields!Amount.Value, "MatrixName")
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "Kaisa M. Lindahl" <kaisaml@.hotmail.com> wrote in message
> news:enVnqz6BFHA.2260@.TK2MSFTNGP14.phx.gbl...
> > I'm creating my first matrix based report, and find that some things
that
> > work with tables doesn't work the same way with matrix.
> > My resultset comes from an MDX statement. It looks something like this
> >
> > ..............................Registered hours
> ..........Amount
> >
>
.............Total.....................10...................
> > 1000
> > Month1....Group
1..................6.....................600
> > .............Group
> > 2..................4.....................400
> >
> >
>
.............Total.....................12...................
> > 1200
> > Month2....Group
1..................8.....................800
> > .............Group
> > 2..................4.....................400
> >
> > The customer wants to display the values for the months next to each
> other,
> > for each value. Now, I've managed to get this with a matrix, having the
> > [static group] ordered on top. (Thanks to Ohjoo Kwon).
> >
> > BUT one of my columns is supposed to be "Group Result as % of total
> result."
> > Meaning for Group1 in Month1 I need to divide 600 on the Total Amount.
The
> > first row in my result set is always a calculated total for that month.
> So,
> > when using tables, I usually just do =Amount/First(Amount), and that
works
> > like a charm. When I try to do that in a matrix, all I get in return is
> > "100%". So my guess is that in a matrix, I can't use First() the same
way
> as
> > in a table. But how can I do the division? How to divide "Any Row" by
> "First
> > Row"?
> >
> > All help appreciated.
> >
> > Kaisa M. Lindahl
> >
> >
>|||I just realized an error in my original code. What Robert suggested (below)
works for dividing by the very first row of the result set.
Unfortunately, I need to divide the right number with the right first row...
I'll explain
My result looks like this:
.......................Measures_Amount ...
............AllGrps...100
............Grp1........30
200409...Grp2........30
............Grp3.......40
............AllGrps....120
............Grp1........40
200309...Grp2........40
............Grp3........40
My report looks someting like this
.............Measures_Amount.....%ofTotalAmt
Group........200309|200409...200309|200409
Total..............120|...100........100%|...100%
Grp1...............40|....30.........33%|....30%
Grp2...............40|....30.........33%|....30%
Grp3...............40|....40.........33%|....40%
Today I realized that my statement
=First(Fields!Measures_Amount.Value)/ First(Fields!Measures_Amount.Value,
"OmsetningHT")
doesn't work quite as planned. This will divide all rows with the very first
row, which is the total for 200409. Suddenly all results from 200309 are
divided by the total for 200409, which is wrong.
So I need a way to divide a group result by the correct total in my matrix.
The months are organized in a column group.
All help appreciated!
Kaisa M. Lindahl
"Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in message
news:etV2GOOCFHA.1392@.tk2msftngp13.phx.gbl...
> You have to provide the "right" scope for the aggregate function. Try one
of
> the two following expressions to divide by the first row:
> =Sum(Fields!Amount.Value) / First(Fields!Amount.Value, "DataSetName")
> =Sum(Fields!Amount.Value) / First(Fields!Amount.Value, "MatrixName")
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "Kaisa M. Lindahl" <kaisaml@.hotmail.com> wrote in message
> news:enVnqz6BFHA.2260@.TK2MSFTNGP14.phx.gbl...
> > I'm creating my first matrix based report, and find that some things
that
> > work with tables doesn't work the same way with matrix.
> > My resultset comes from an MDX statement. It looks something like this
> >
> > ..............................Registered hours
> ..........Amount
> >
>
.............Total.....................10...................
> > 1000
> > Month1....Group
1..................6.....................600
> > .............Group
> > 2..................4.....................400
> >
> >
>
.............Total.....................12...................
> > 1200
> > Month2....Group
1..................8.....................800
> > .............Group
> > 2..................4.....................400
> >
> > The customer wants to display the values for the months next to each
> other,
> > for each value. Now, I've managed to get this with a matrix, having the
> > [static group] ordered on top. (Thanks to Ohjoo Kwon).
> >
> > BUT one of my columns is supposed to be "Group Result as % of total
> result."
> > Meaning for Group1 in Month1 I need to divide 600 on the Total Amount.
The
> > first row in my result set is always a calculated total for that month.
> So,
> > when using tables, I usually just do =Amount/First(Amount), and that
works
> > like a charm. When I try to do that in a matrix, all I get in return is
> > "100%". So my guess is that in a matrix, I can't use First() the same
way
> as
> > in a table. But how can I do the division? How to divide "Any Row" by
> "First
> > Row"?
> >
> > All help appreciated.
> >
> > Kaisa M. Lindahl
> >
> >
>|||This problem just resurfaced.
Anyone want to give it some thought?
Is it possible to check for something like
if month = Parameters!FirstPeriod.Value then
'use this row
end if ?
Kaisa
"Kaisa M. Lindahl" <kaisaml@.hotmail.com> wrote in message
news:OACV70qDFHA.1296@.TK2MSFTNGP10.phx.gbl...
> I just realized an error in my original code. What Robert suggested
(below)
> works for dividing by the very first row of the result set.
> Unfortunately, I need to divide the right number with the right first
row...
> I'll explain
> My result looks like this:
> .......................Measures_Amount ...
> ............AllGrps...100
> ............Grp1........30
> 200409...Grp2........30
> ............Grp3.......40
> ............AllGrps....120
> ............Grp1........40
> 200309...Grp2........40
> ............Grp3........40
> My report looks someting like this
> .............Measures_Amount.....%ofTotalAmt
> Group........200309|200409...200309|200409
> Total..............120|...100........100%|...100%
> Grp1...............40|....30.........33%|....30%
> Grp2...............40|....30.........33%|....30%
> Grp3...............40|....40.........33%|....40%
> Today I realized that my statement
> =First(Fields!Measures_Amount.Value)/ First(Fields!Measures_Amount.Value,
> "OmsetningHT")
> doesn't work quite as planned. This will divide all rows with the very
first
> row, which is the total for 200409. Suddenly all results from 200309 are
> divided by the total for 200409, which is wrong.
> So I need a way to divide a group result by the correct total in my
matrix.
> The months are organized in a column group.
> All help appreciated!
> Kaisa M. Lindahl
>
> "Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in message
> news:etV2GOOCFHA.1392@.tk2msftngp13.phx.gbl...
> > You have to provide the "right" scope for the aggregate function. Try
one
> of
> > the two following expressions to divide by the first row:
> > =Sum(Fields!Amount.Value) / First(Fields!Amount.Value, "DataSetName")
> > =Sum(Fields!Amount.Value) / First(Fields!Amount.Value, "MatrixName")
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >
> >
> > "Kaisa M. Lindahl" <kaisaml@.hotmail.com> wrote in message
> > news:enVnqz6BFHA.2260@.TK2MSFTNGP14.phx.gbl...
> > > I'm creating my first matrix based report, and find that some things
> that
> > > work with tables doesn't work the same way with matrix.
> > > My resultset comes from an MDX statement. It looks something like this
> > >
> > > ..............................Registered hours
> > ..........Amount
> > >
> >
>
.............Total.....................10...................
> > > 1000
> > > Month1....Group
> 1..................6.....................600
> > > .............Group
> > > 2..................4.....................400
> > >
> > >
> >
>
.............Total.....................12...................
> > > 1200
> > > Month2....Group
> 1..................8.....................800
> > > .............Group
> > > 2..................4.....................400
> > >
> > > The customer wants to display the values for the months next to each
> > other,
> > > for each value. Now, I've managed to get this with a matrix, having
the
> > > [static group] ordered on top. (Thanks to Ohjoo Kwon).
> > >
> > > BUT one of my columns is supposed to be "Group Result as % of total
> > result."
> > > Meaning for Group1 in Month1 I need to divide 600 on the Total Amount.
> The
> > > first row in my result set is always a calculated total for that
month.
> > So,
> > > when using tables, I usually just do =Amount/First(Amount), and that
> works
> > > like a charm. When I try to do that in a matrix, all I get in return
is
> > > "100%". So my guess is that in a matrix, I can't use First() the same
> way
> > as
> > > in a table. But how can I do the division? How to divide "Any Row" by
> > "First
> > > Row"?
> > >
> > > All help appreciated.
> > >
> > > Kaisa M. Lindahl
> > >
> > >
> >
> >
>|||If you can group on year or whatever is relevant in your scenario, then
within that group, =First(Fields!Amount.Value) should refer to the
first value in that group. As Robert said, it's all about scope with
aggregate functions. By grouping the data, you are limiting the scope,
which is what you want.
Chris
Kaisa M. Lindahl wrote:
> This problem just resurfaced.
> Anyone want to give it some thought?
> Is it possible to check for something like
> if month = Parameters!FirstPeriod.Value then
> 'use this row
> end if ?
> Kaisa
> "Kaisa M. Lindahl" <kaisaml@.hotmail.com> wrote in message
> news:OACV70qDFHA.1296@.TK2MSFTNGP10.phx.gbl...
> > I just realized an error in my original code. What Robert suggested
> (below)
> > works for dividing by the very first row of the result set.
> > Unfortunately, I need to divide the right number with the right
> > first
> row...
> > I'll explain
> >
> > My result looks like this:
> > .......................Measures_Amount ...
> > ............AllGrps...100
> > ............Grp1........30
> > 200409...Grp2........30
> > ............Grp3.......40
> > ............AllGrps....120
> > ............Grp1........40
> > 200309...Grp2........40
> > ............Grp3........40
> >
> > My report looks someting like this
> >
> > .............Measures_Amount.....%ofTotalAmt
> > Group........200309|200409...200309|200409
> > Total..............120|...100........100%|...100%
> > Grp1...............40|....30.........33%|....30%
> > Grp2...............40|....30.........33%|....30%
> > Grp3...............40|....40.........33%|....40%
> >
> > Today I realized that my statement
> > =First(Fields!Measures_Amount.Value)/
> > First(Fields!Measures_Amount.Value, "OmsetningHT")
> > doesn't work quite as planned. This will divide all rows with the
> > very
> first
> > row, which is the total for 200409. Suddenly all results from
> > 200309 are divided by the total for 200409, which is wrong.
> >
> > So I need a way to divide a group result by the correct total in my
> matrix.
> > The months are organized in a column group.
> >
> > All help appreciated!
> >
> > Kaisa M. Lindahl
> >
> >
> > "Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in
> > message news:etV2GOOCFHA.1392@.tk2msftngp13.phx.gbl...
> > > You have to provide the "right" scope for the aggregate function.
> > > Try
> one
> > of
> > > the two following expressions to divide by the first row:
> > > =Sum(Fields!Amount.Value) / First(Fields!Amount.Value,
> > > "DataSetName") =Sum(Fields!Amount.Value) /
> > > First(Fields!Amount.Value, "MatrixName")
> > >
> > > --
> > > This posting is provided "AS IS" with no warranties, and confers
> > > no
> > rights.
> > >
> > >
> > > "Kaisa M. Lindahl" <kaisaml@.hotmail.com> wrote in message
> > > news:enVnqz6BFHA.2260@.TK2MSFTNGP14.phx.gbl...
> > > > I'm creating my first matrix based report, and find that some
> > > > things
> > that
> > > > work with tables doesn't work the same way with matrix.
> > > > My resultset comes from an MDX statement. It looks something
> > > > like this
> > > >
> > > > ..............................Registered hours
> > > ..........Amount
> > > >
> > >
> >
> .............Total.....................10...............
> .....
> > > > 1000
> > > > Month1....Group
> > 1..................6.....................600
> > > > .............Group
> > > > 2..................4.....................400
> > > >
> > > >
> > >
> >
> .............Total.....................12...............
> .....
> > > > 1200
> > > > Month2....Group
> > 1..................8.....................800
> > > > .............Group
> > > > 2..................4.....................400
> > > >
> > > > The customer wants to display the values for the months next to
> > > > each
> > > other,
> > > > for each value. Now, I've managed to get this with a matrix,
> > > > having
> the
> > > > [static group] ordered on top. (Thanks to Ohjoo Kwon).
> > > >
> > > > BUT one of my columns is supposed to be "Group Result as % of
> > > > total
> > > result."
> > > > Meaning for Group1 in Month1 I need to divide 600 on the Total
> > > > Amount.
> > The
> > > > first row in my result set is always a calculated total for that
> month.
> > > So,
> > > > when using tables, I usually just do =Amount/First(Amount), and
> > > > that
> > works
> > > > like a charm. When I try to do that in a matrix, all I get in
> > > > return
> is
> > > > "100%". So my guess is that in a matrix, I can't use First()
> > > > the same
> > way
> > > as
> > > > in a table. But how can I do the division? How to divide "Any
> > > > Row" by
> > > "First
> > > > Row"?
> > > >
> > > > All help appreciated.
> > > >
> > > > Kaisa M. Lindahl
> > > >
> > > >
> > >
> > >
> >
> >|||OK, thanks to both. I finally figured it out. :)
I'm still getting confused by when to use what scope. The final solution was
to change from
First(Fields!Amount.Value, "Dataset") to First(Fields!Amount.Value,
"MatrixColumnGroupName").
Kaisa M. Lindahl
"Chris McGuigan" <chris.mcguigan@.zycko.com> wrote in message
news:uO5VPAzIFHA.2656@.TK2MSFTNGP09.phx.gbl...
> If you can group on year or whatever is relevant in your scenario, then
> within that group, =First(Fields!Amount.Value) should refer to the
> first value in that group. As Robert said, it's all about scope with
> aggregate functions. By grouping the data, you are limiting the scope,
> which is what you want.
> Chris
>
> Kaisa M. Lindahl wrote:
> > This problem just resurfaced.
> > Anyone want to give it some thought?
> >
> > Is it possible to check for something like
> > if month = Parameters!FirstPeriod.Value then
> > 'use this row
> > end if ?
> >
> > Kaisa
> >
> > "Kaisa M. Lindahl" <kaisaml@.hotmail.com> wrote in message
> > news:OACV70qDFHA.1296@.TK2MSFTNGP10.phx.gbl...
> > > I just realized an error in my original code. What Robert suggested
> > (below)
> > > works for dividing by the very first row of the result set.
> > > Unfortunately, I need to divide the right number with the right
> > > first
> > row...
> > > I'll explain
> > >
> > > My result looks like this:
> > > .......................Measures_Amount ...
> > > ............AllGrps...100
> > > ............Grp1........30
> > > 200409...Grp2........30
> > > ............Grp3.......40
> > > ............AllGrps....120
> > > ............Grp1........40
> > > 200309...Grp2........40
> > > ............Grp3........40
> > >
> > > My report looks someting like this
> > >
> > > .............Measures_Amount.....%ofTotalAmt
> > > Group........200309|200409...200309|200409
> > > Total..............120|...100........100%|...100%
> > > Grp1...............40|....30.........33%|....30%
> > > Grp2...............40|....30.........33%|....30%
> > > Grp3...............40|....40.........33%|....40%
> > >
> > > Today I realized that my statement
> > > =First(Fields!Measures_Amount.Value)/
> > > First(Fields!Measures_Amount.Value, "OmsetningHT")
> > > doesn't work quite as planned. This will divide all rows with the
> > > very
> > first
> > > row, which is the total for 200409. Suddenly all results from
> > > 200309 are divided by the total for 200409, which is wrong.
> > >
> > > So I need a way to divide a group result by the correct total in my
> > matrix.
> > > The months are organized in a column group.
> > >
> > > All help appreciated!
> > >
> > > Kaisa M. Lindahl
> > >
> > >
> > > "Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in
> > > message news:etV2GOOCFHA.1392@.tk2msftngp13.phx.gbl...
> > > > You have to provide the "right" scope for the aggregate function.
> > > > Try
> > one
> > > of
> > > > the two following expressions to divide by the first row:
> > > > =Sum(Fields!Amount.Value) / First(Fields!Amount.Value,
> > > > "DataSetName") =Sum(Fields!Amount.Value) /
> > > > First(Fields!Amount.Value, "MatrixName")
> > > >
> > > > --
> > > > This posting is provided "AS IS" with no warranties, and confers
> > > > no
> > > rights.
> > > >
> > > >
> > > > "Kaisa M. Lindahl" <kaisaml@.hotmail.com> wrote in message
> > > > news:enVnqz6BFHA.2260@.TK2MSFTNGP14.phx.gbl...
> > > > > I'm creating my first matrix based report, and find that some
> > > > > things
> > > that
> > > > > work with tables doesn't work the same way with matrix.
> > > > > My resultset comes from an MDX statement. It looks something
> > > > > like this
> > > > >
> > > > > ..............................Registered hours
> > > > ..........Amount
> > > > >
> > > >
> > >
> > .............Total.....................10...............
> > .....
> > > > > 1000
> > > > > Month1....Group
> > > 1..................6.....................600
> > > > > .............Group
> > > > > 2..................4.....................400
> > > > >
> > > > >
> > > >
> > >
> > .............Total.....................12...............
> > .....
> > > > > 1200
> > > > > Month2....Group
> > > 1..................8.....................800
> > > > > .............Group
> > > > > 2..................4.....................400
> > > > >
> > > > > The customer wants to display the values for the months next to
> > > > > each
> > > > other,
> > > > > for each value. Now, I've managed to get this with a matrix,
> > > > > having
> > the
> > > > > [static group] ordered on top. (Thanks to Ohjoo Kwon).
> > > > >
> > > > > BUT one of my columns is supposed to be "Group Result as % of
> > > > > total
> > > > result."
> > > > > Meaning for Group1 in Month1 I need to divide 600 on the Total
> > > > > Amount.
> > > The
> > > > > first row in my result set is always a calculated total for that
> > month.
> > > > So,
> > > > > when using tables, I usually just do =Amount/First(Amount), and
> > > > > that
> > > works
> > > > > like a charm. When I try to do that in a matrix, all I get in
> > > > > return
> > is
> > > > > "100%". So my guess is that in a matrix, I can't use First()
> > > > > the same
> > > way
> > > > as
> > > > > in a table. But how can I do the division? How to divide "Any
> > > > > Row" by
> > > > "First
> > > > > Row"?
> > > > >
> > > > > All help appreciated.
> > > > >
> > > > > Kaisa M. Lindahl
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
>|||Kaisa, in general, leaving the scope out lets RS decide for you.
Generally this will work the way you want.
Chris
Kaisa M. Lindahl wrote:
> OK, thanks to both. I finally figured it out. :)
> I'm still getting confused by when to use what scope. The final
> solution was to change from
> First(Fields!Amount.Value, "Dataset") to First(Fields!Amount.Value,
> "MatrixColumnGroupName").
> Kaisa M. Lindahl
>
> "Chris McGuigan" <chris.mcguigan@.zycko.com> wrote in message
> news:uO5VPAzIFHA.2656@.TK2MSFTNGP09.phx.gbl...
> > If you can group on year or whatever is relevant in your scenario,
> > then within that group, =First(Fields!Amount.Value) should refer to
> > the first value in that group. As Robert said, it's all about scope
> > with aggregate functions. By grouping the data, you are limiting
> > the scope, which is what you want.
> >
> > Chris
> >
> >
> >
> > Kaisa M. Lindahl wrote:
> >
> > > This problem just resurfaced.
> > > Anyone want to give it some thought?
> > >
> > > Is it possible to check for something like
> > > if month = Parameters!FirstPeriod.Value then
> > > 'use this row
> > > end if ?
> > >
> > > Kaisa
> > >
> > > "Kaisa M. Lindahl" <kaisaml@.hotmail.com> wrote in message
> > > news:OACV70qDFHA.1296@.TK2MSFTNGP10.phx.gbl...
> > > > I just realized an error in my original code. What Robert
> > > > suggested
> > > (below)
> > > > works for dividing by the very first row of the result set.
> > > > Unfortunately, I need to divide the right number with the right
> > > > first
> > > row...
> > > > I'll explain
> > > >
> > > > My result looks like this:
> > > > .......................Measures_Amount ...
> > > > ............AllGrps...100
> > > > ............Grp1........30
> > > > 200409...Grp2........30
> > > > ............Grp3.......40
> > > > ............AllGrps....120
> > > > ............Grp1........40
> > > > 200309...Grp2........40
> > > > ............Grp3........40
> > > >
> > > > My report looks someting like this
> > > >
> > > > .............Measures_Amount.....%ofTotalAmt
> > > > Group........200309|200409...200309|200409
> > > > Total..............120|...100........100%|...100%
> > > > Grp1...............40|....30.........33%|....30%
> > > > Grp2...............40|....30.........33%|....30%
> > > > Grp3...............40|....40.........33%|....40%
> > > >
> > > > Today I realized that my statement
> > > > =First(Fields!Measures_Amount.Value)/
> > > > First(Fields!Measures_Amount.Value, "OmsetningHT")
> > > > doesn't work quite as planned. This will divide all rows with
> > > > the very
> > > first
> > > > row, which is the total for 200409. Suddenly all results from
> > > > 200309 are divided by the total for 200409, which is wrong.
> > > >
> > > > So I need a way to divide a group result by the correct total
> > > > in my
> > > matrix.
> > > > The months are organized in a column group.
> > > >
> > > > All help appreciated!
> > > >
> > > > Kaisa M. Lindahl
> > > >
> > > >
> > > > "Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in
> > > > message news:etV2GOOCFHA.1392@.tk2msftngp13.phx.gbl...
> > > > > You have to provide the "right" scope for the aggregate
> > > > > function. Try
> > > one
> > > > of
> > > > > the two following expressions to divide by the first row:
> > > > > =Sum(Fields!Amount.Value) / First(Fields!Amount.Value,
> > > > > "DataSetName") =Sum(Fields!Amount.Value) /
> > > > > First(Fields!Amount.Value, "MatrixName")
> > > > >
> > > > > --
> > > > > This posting is provided "AS IS" with no warranties, and
> > > > > confers no
> > > > rights.
> > > > >
> > > > >
> > > > > "Kaisa M. Lindahl" <kaisaml@.hotmail.com> wrote in message
> > > > > news:enVnqz6BFHA.2260@.TK2MSFTNGP14.phx.gbl...
> > > > > > I'm creating my first matrix based report, and find that
> > > > > > some things
> > > > that
> > > > > > work with tables doesn't work the same way with matrix.
> > > > > > My resultset comes from an MDX statement. It looks something
> > > > > > like this
> > > > > >
> > > > > > ..............................Registered hours
> > > > > ..........Amount
> > > > > >
> > > > >
> > > >
> > > .............Total.....................10............
> > > ... .....
> > > > > > 1000
> > > > > > Month1....Group
> > > > 1..................6.....................600
> > > > > > .............Group
> > > > > > 2..................4.....................400
> > > > > >
> > > > > >
> > > > >
> > > >
> > > .............Total.....................12............
> > > ... .....
> > > > > > 1200
> > > > > > Month2....Group
> > > > 1..................8.....................800
> > > > > > .............Group
> > > > > > 2..................4.....................400
> > > > > >
> > > > > > The customer wants to display the values for the months
> > > > > > next to each
> > > > > other,
> > > > > > for each value. Now, I've managed to get this with a matrix,
> > > > > > having
> > > the
> > > > > > [static group] ordered on top. (Thanks to Ohjoo Kwon).
> > > > > >
> > > > > > BUT one of my columns is supposed to be "Group Result as %
> > > > > > of total
> > > > > result."
> > > > > > Meaning for Group1 in Month1 I need to divide 600 on the
> > > > > > Total Amount.
> > > > The
> > > > > > first row in my result set is always a calculated total for
> > > > > > that
> > > month.
> > > > > So,
> > > > > > when using tables, I usually just do =Amount/First(Amount),
> > > > > > and that
> > > > works
> > > > > > like a charm. When I try to do that in a matrix, all I get
> > > > > > in return
> > > is
> > > > > > "100%". So my guess is that in a matrix, I can't use First()
> > > > > > the same
> > > > way
> > > > > as
> > > > > > in a table. But how can I do the division? How to divide
> > > > > > "Any Row" by
> > > > > "First
> > > > > > Row"?
> > > > > >
> > > > > > All help appreciated.
> > > > > >
> > > > > > Kaisa M. Lindahl
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> >

Divide by 0 error

How can I handle divide by 0 errors.
This is my report field expression:
=(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value)Thanks but same #Error. What would Val do?
"geissingert" wrote:
> Hi Chris,
> Try:
> =IIf(Val(Sum(Fields!B.Value))<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
>
> "Chris Patten" wrote:
> > Yea I had tried something similiar, it results in #Error.
> >
> > Any other ideas?
> >
> >
> >
> > "geissingert" wrote:
> >
> > > Hi Chris,
> > >
> > > Try:
> > >
> > > =IIf(Sum(Fields!B.Value)<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> > >
> > > Thanks,
> > >
> > > geissingert
> > >
> > > "Chris Patten" wrote:
> > >
> > > > How can I handle divide by 0 errors.
> > > >
> > > > This is my report field expression:
> > > > =(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value)|||Hi Chris,
Try:
=IIf(Sum(Fields!B.Value)<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
Thanks,
geissingert
"Chris Patten" wrote:
> How can I handle divide by 0 errors.
> This is my report field expression:
> =(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value)|||Perfect!, u r the man (or woman)
Thanks for your help.
"geissingert" wrote:
> Hi Chris,
> Sorry about that. I forgot that IIf still evaluates both expressions. That
> is the reason for the error.
> Give this a try:
> In the expression of the text box that doing the division add the following
> code:
> =Code.Divide(Sum(Fields!A.Value),Sum(Fields!B.Value))
>
> Then under the Report properties, code tab enter the following:
> Function Divide(ByVal a As Object, ByVal b As Object) As Decimal
> Dim retVal As Decimal = 0
> If Val(b) > 0 Then
> retVal = (a - b) / b
> End If
> Return retVal
> End Function
>
> Give that a try and let me know.
> Thanks,
> geissingert
> "Chris Patten" wrote:
> > Still errors out.
> > I noticed it has no problem with evaluating the direct part of the expression.
> > If I change it from:
> > =IIf(Sum(Fields!B.Value)<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> >
> > to:
> > =IIf(Sum(Fields!B.Value)<>0,"Not Zero",0)
> > It Returns 0 fine. Seems to not like evaluating the True part of the
> > expression for some reason?
> > (Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value)
> >
> >
> >
> >
> > "geissingert" wrote:
> >
> > > Hi Chris,
> > >
> > > Val returns the value of an object.
> > >
> > > Try:
> > >
> > > =IIf(Sum(Val(Fields!B.Value))<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> > >
> > > Thanks,
> > >
> > > geissingert
> > >
> > >
> > > "Chris Patten" wrote:
> > >
> > > > Thanks but same #Error. What would Val do?
> > > >
> > > > "geissingert" wrote:
> > > >
> > > > > Hi Chris,
> > > > >
> > > > > Try:
> > > > >
> > > > > =IIf(Val(Sum(Fields!B.Value))<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> > > > >
> > > > >
> > > > > "Chris Patten" wrote:
> > > > >
> > > > > > Yea I had tried something similiar, it results in #Error.
> > > > > >
> > > > > > Any other ideas?
> > > > > >
> > > > > >
> > > > > >
> > > > > > "geissingert" wrote:
> > > > > >
> > > > > > > Hi Chris,
> > > > > > >
> > > > > > > Try:
> > > > > > >
> > > > > > > =IIf(Sum(Fields!B.Value)<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> > > > > > >
> > > > > > > Thanks,
> > > > > > >
> > > > > > > geissingert
> > > > > > >
> > > > > > > "Chris Patten" wrote:
> > > > > > >
> > > > > > > > How can I handle divide by 0 errors.
> > > > > > > >
> > > > > > > > This is my report field expression:
> > > > > > > > =(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value)|||Hi Chris,
Try:
=IIf(Val(Sum(Fields!B.Value))<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
"Chris Patten" wrote:
> Yea I had tried something similiar, it results in #Error.
> Any other ideas?
>
> "geissingert" wrote:
> > Hi Chris,
> >
> > Try:
> >
> > =IIf(Sum(Fields!B.Value)<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> >
> > Thanks,
> >
> > geissingert
> >
> > "Chris Patten" wrote:
> >
> > > How can I handle divide by 0 errors.
> > >
> > > This is my report field expression:
> > > =(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value)|||Hi Chris,
Val returns the value of an object.
Try:
=IIf(Sum(Val(Fields!B.Value))<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
Thanks,
geissingert
"Chris Patten" wrote:
> Thanks but same #Error. What would Val do?
> "geissingert" wrote:
> > Hi Chris,
> >
> > Try:
> >
> > =IIf(Val(Sum(Fields!B.Value))<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> >
> >
> > "Chris Patten" wrote:
> >
> > > Yea I had tried something similiar, it results in #Error.
> > >
> > > Any other ideas?
> > >
> > >
> > >
> > > "geissingert" wrote:
> > >
> > > > Hi Chris,
> > > >
> > > > Try:
> > > >
> > > > =IIf(Sum(Fields!B.Value)<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> > > >
> > > > Thanks,
> > > >
> > > > geissingert
> > > >
> > > > "Chris Patten" wrote:
> > > >
> > > > > How can I handle divide by 0 errors.
> > > > >
> > > > > This is my report field expression:
> > > > > =(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value)|||Hi Chris,
Glad to hear it is working.
Thanks,
geissingert
"Chris Patten" wrote:
> Perfect!, u r the man (or woman)
> Thanks for your help.
>
> "geissingert" wrote:
> > Hi Chris,
> >
> > Sorry about that. I forgot that IIf still evaluates both expressions. That
> > is the reason for the error.
> >
> > Give this a try:
> >
> > In the expression of the text box that doing the division add the following
> > code:
> >
> > =Code.Divide(Sum(Fields!A.Value),Sum(Fields!B.Value))
> >
> >
> >
> > Then under the Report properties, code tab enter the following:
> >
> > Function Divide(ByVal a As Object, ByVal b As Object) As Decimal
> > Dim retVal As Decimal = 0
> > If Val(b) > 0 Then
> > retVal = (a - b) / b
> > End If
> > Return retVal
> > End Function
> >
> >
> >
> > Give that a try and let me know.
> >
> > Thanks,
> >
> > geissingert
> >
> > "Chris Patten" wrote:
> >
> > > Still errors out.
> > > I noticed it has no problem with evaluating the direct part of the expression.
> > > If I change it from:
> > > =IIf(Sum(Fields!B.Value)<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> > >
> > > to:
> > > =IIf(Sum(Fields!B.Value)<>0,"Not Zero",0)
> > > It Returns 0 fine. Seems to not like evaluating the True part of the
> > > expression for some reason?
> > > (Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value)
> > >
> > >
> > >
> > >
> > > "geissingert" wrote:
> > >
> > > > Hi Chris,
> > > >
> > > > Val returns the value of an object.
> > > >
> > > > Try:
> > > >
> > > > =IIf(Sum(Val(Fields!B.Value))<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> > > >
> > > > Thanks,
> > > >
> > > > geissingert
> > > >
> > > >
> > > > "Chris Patten" wrote:
> > > >
> > > > > Thanks but same #Error. What would Val do?
> > > > >
> > > > > "geissingert" wrote:
> > > > >
> > > > > > Hi Chris,
> > > > > >
> > > > > > Try:
> > > > > >
> > > > > > =IIf(Val(Sum(Fields!B.Value))<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> > > > > >
> > > > > >
> > > > > > "Chris Patten" wrote:
> > > > > >
> > > > > > > Yea I had tried something similiar, it results in #Error.
> > > > > > >
> > > > > > > Any other ideas?
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > "geissingert" wrote:
> > > > > > >
> > > > > > > > Hi Chris,
> > > > > > > >
> > > > > > > > Try:
> > > > > > > >
> > > > > > > > =IIf(Sum(Fields!B.Value)<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> > > > > > > >
> > > > > > > > Thanks,
> > > > > > > >
> > > > > > > > geissingert
> > > > > > > >
> > > > > > > > "Chris Patten" wrote:
> > > > > > > >
> > > > > > > > > How can I handle divide by 0 errors.
> > > > > > > > >
> > > > > > > > > This is my report field expression:
> > > > > > > > > =(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value)|||Yea I had tried something similiar, it results in #Error.
Any other ideas?
"geissingert" wrote:
> Hi Chris,
> Try:
> =IIf(Sum(Fields!B.Value)<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> Thanks,
> geissingert
> "Chris Patten" wrote:
> > How can I handle divide by 0 errors.
> >
> > This is my report field expression:
> > =(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value)|||Hi Chris,
Sorry about that. I forgot that IIf still evaluates both expressions. That
is the reason for the error.
Give this a try:
In the expression of the text box that doing the division add the following
code:
=Code.Divide(Sum(Fields!A.Value),Sum(Fields!B.Value))
Then under the Report properties, code tab enter the following:
Function Divide(ByVal a As Object, ByVal b As Object) As Decimal
Dim retVal As Decimal = 0
If Val(b) > 0 Then
retVal = (a - b) / b
End If
Return retVal
End Function
Give that a try and let me know.
Thanks,
geissingert
"Chris Patten" wrote:
> Still errors out.
> I noticed it has no problem with evaluating the direct part of the expression.
> If I change it from:
> =IIf(Sum(Fields!B.Value)<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> to:
> =IIf(Sum(Fields!B.Value)<>0,"Not Zero",0)
> It Returns 0 fine. Seems to not like evaluating the True part of the
> expression for some reason?
> (Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value)
>
>
> "geissingert" wrote:
> > Hi Chris,
> >
> > Val returns the value of an object.
> >
> > Try:
> >
> > =IIf(Sum(Val(Fields!B.Value))<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> >
> > Thanks,
> >
> > geissingert
> >
> >
> > "Chris Patten" wrote:
> >
> > > Thanks but same #Error. What would Val do?
> > >
> > > "geissingert" wrote:
> > >
> > > > Hi Chris,
> > > >
> > > > Try:
> > > >
> > > > =IIf(Val(Sum(Fields!B.Value))<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> > > >
> > > >
> > > > "Chris Patten" wrote:
> > > >
> > > > > Yea I had tried something similiar, it results in #Error.
> > > > >
> > > > > Any other ideas?
> > > > >
> > > > >
> > > > >
> > > > > "geissingert" wrote:
> > > > >
> > > > > > Hi Chris,
> > > > > >
> > > > > > Try:
> > > > > >
> > > > > > =IIf(Sum(Fields!B.Value)<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> > > > > >
> > > > > > Thanks,
> > > > > >
> > > > > > geissingert
> > > > > >
> > > > > > "Chris Patten" wrote:
> > > > > >
> > > > > > > How can I handle divide by 0 errors.
> > > > > > >
> > > > > > > This is my report field expression:
> > > > > > > =(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value)|||Still errors out.
I noticed it has no problem with evaluating the direct part of the expression.
If I change it from:
=IIf(Sum(Fields!B.Value)<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
to:
=IIf(Sum(Fields!B.Value)<>0,"Not Zero",0)
It Returns 0 fine. Seems to not like evaluating the True part of the
expression for some reason?
(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value)
"geissingert" wrote:
> Hi Chris,
> Val returns the value of an object.
> Try:
> =IIf(Sum(Val(Fields!B.Value))<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> Thanks,
> geissingert
>
> "Chris Patten" wrote:
> > Thanks but same #Error. What would Val do?
> >
> > "geissingert" wrote:
> >
> > > Hi Chris,
> > >
> > > Try:
> > >
> > > =IIf(Val(Sum(Fields!B.Value))<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> > >
> > >
> > > "Chris Patten" wrote:
> > >
> > > > Yea I had tried something similiar, it results in #Error.
> > > >
> > > > Any other ideas?
> > > >
> > > >
> > > >
> > > > "geissingert" wrote:
> > > >
> > > > > Hi Chris,
> > > > >
> > > > > Try:
> > > > >
> > > > > =IIf(Sum(Fields!B.Value)<>0,(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value),0)
> > > > >
> > > > > Thanks,
> > > > >
> > > > > geissingert
> > > > >
> > > > > "Chris Patten" wrote:
> > > > >
> > > > > > How can I handle divide by 0 errors.
> > > > > >
> > > > > > This is my report field expression:
> > > > > > =(Sum(Fields!A.Value)-Sum(Fields!B.Value))/Sum(Fields!B.Value)

Sunday, February 19, 2012

distributing reports to multiple report servers

Hi,
I am trying to figure out how to package and deploy reports to multiple
report servers. We have 200+ clients, and are trying to switch over to
report server, but I can't find any documentation about deploying reports
outside of an organization.
To clarify a little, new releases come out quarterly, and are installed with
an msi installer, and we would like to be able to distribute reports with
our current process.
any help would be greatly appreciated...
Thanks
CraigCraig,
There is a sample script that shows how to automate the publishing of
the reports. Is this the kind of thing you're looking for?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSAMPLES/htm/rss_sampleapps_v1_1apd.asp
Your msi installer could land the report rdl and collect the variables
necessary for running a script similar to this.
Andy Potter|||That should do just fine =)
Thanks,
Craig
"Potter" <drewpotter@.gmail.com> wrote in message
news:1135889173.574650.189300@.g43g2000cwa.googlegroups.com...
> Craig,
> There is a sample script that shows how to automate the publishing of
> the reports. Is this the kind of thing you're looking for?
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSAMPLES/htm/rss_sampleapps_v1_1apd.asp
> Your msi installer could land the report rdl and collect the variables
> necessary for running a script similar to this.
> Andy Potter
>|||To help automate the script generation have a look at
Reporting Services Scripter
http://www.sqldbatips.com/showarticle.asp?ID=62
--
HTH,
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
"Craig L" <craig.lonsbury@.diamondmunicipal.com> wrote in message
news:eShO$RLDGHA.516@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I am trying to figure out how to package and deploy reports to multiple
> report servers. We have 200+ clients, and are trying to switch over to
> report server, but I can't find any documentation about deploying reports
> outside of an organization.
> To clarify a little, new releases come out quarterly, and are installed
> with an msi installer, and we would like to be able to distribute reports
> with our current process.
> any help would be greatly appreciated...
> Thanks
> Craig
>