Showing posts with label return. Show all posts
Showing posts with label return. Show all posts

Tuesday, March 20, 2012

Background Color Return:

I am writing a report that I need to return a background color for a cell in
a table. The background color depends on what color is named in another
cell. For example, if the cell (Quality_status.value) displays the word
Green then the cell (Quanity_status.value) background color needs to be
Green. I have tried several IIF expressions in the BackgroundColor
properties but none of them seem to work. Please help!!
--
Sincerely,
Debo
--
Sincerely,
DeboThe only supported property of a field is Value. Therefore you can't do it.
HTH
Charles Kangai, MCT, MCDBA
"Debo" wrote:
> I am writing a report that I need to return a background color for a cell in
> a table. The background color depends on what color is named in another
> cell. For example, if the cell (Quality_status.value) displays the word
> Green then the cell (Quanity_status.value) background color needs to be
> Green. I have tried several IIF expressions in the BackgroundColor
> properties but none of them seem to work. Please help!!
> --
> Sincerely,
> Debo
> --
> Sincerely,
> Debo|||I went to a textbox properties, background color, scrolled to the top to
add an expression. and did
=iif(fields!CompanyName.Value = "Alfred's","Red","Green") and it worked
have you tried
=(fields!Quality_status.Value)
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Debo" <debo@.discussions.microsoft.com> wrote in message
news:835302E4-20F1-4D56-A738-9954ED6B346E@.microsoft.com...
> I am writing a report that I need to return a background color for a cell
in
> a table. The background color depends on what color is named in another
> cell. For example, if the cell (Quality_status.value) displays the word
> Green then the cell (Quanity_status.value) background color needs to be
> Green. I have tried several IIF expressions in the BackgroundColor
> properties but none of them seem to work. Please help!!
> --
> Sincerely,
> Debo
> --
> Sincerely,
> Debo|||Hi Wayne,
I thought Debo was trying to read the BackColor property, and you cannot
read any property of a textbox except Value. Of course if you enter the name
of the color in words in a textbox, then you can do it, because you are
reading the Value property.
Cheers
Charles Kangai, MCT, MCDBA
ps - good to hear from you Wayne!
"Wayne Snyder" wrote:
> I went to a textbox properties, background color, scrolled to the top to
> add an expression. and did
> =iif(fields!CompanyName.Value = "Alfred's","Red","Green") and it worked
> have you tried
> =(fields!Quality_status.Value)
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
>
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Debo" <debo@.discussions.microsoft.com> wrote in message
> news:835302E4-20F1-4D56-A738-9954ED6B346E@.microsoft.com...
> > I am writing a report that I need to return a background color for a cell
> in
> > a table. The background color depends on what color is named in another
> > cell. For example, if the cell (Quality_status.value) displays the word
> > Green then the cell (Quanity_status.value) background color needs to be
> > Green. I have tried several IIF expressions in the BackgroundColor
> > properties but none of them seem to work. Please help!!
> > --
> > Sincerely,
> >
> > Debo
> > --
> > Sincerely,
> >
> > Debo
>
>

Sunday, March 11, 2012

Back button does not regenerate original report

When I drill down from one report to another and then depress the back button to return to the initial report, the message 'Generating Report" spins forever without actually running. However, if I depress the regenerate button during this time, it will run the report.

I believe that I may have inadvertingly reset a field attribute to have caused this condition. Ironocally, I have the same set of database installed on another server, and the this does not happen.

I forgot to mention that I am using Report Manager to deploy the reports.

Please assist.

Just checking if anyone has any additional info on this. I'm having the same problem. SQL Server 2005 (SP2), Reporting Services 2005 (SP2).

Any help is appreciated as this is a major usability issue.

|||I am also experiencing this issue.|||I think microsoft fixed this. In vista64/sql64 there is no back button......that I can find.|||This thread is talking about the browser (internet explorer) back button.|||

Can someone from Microsoft please chime in on this issue. If you hit the browser back button from IE from a drilled/jump to report, the original report is not shown. The "Report is being generated" screen just sits there. This is a huge usability issue.

Also, can someone from Microsoft point me to where we're supposed to find out when/if an upcoming SP/hotfix is going to come out and what is included. I want to move our reporting system to Reporting Services but the above issue is one of the reasons I can't.

|||

I am also getting this on multiple machines and databases. I can recreate it starting with 2 simple reports, the main report and a drill down report. The browser back button tries to bring up the original report, but never finishes. I noticed there is always an HTML error on the report that goes away if you click refresh. (Note: The error only shows up if your browser is set to show errors). I am using SQL Service Pack 2 and IE7. The error I get is:

Line: 718

Char: 5

Error: 'location' is null or not an object

Code: 0

URL: ......

|||

I am having this problem too, since we moved to SQL 2005 64-bit,sp2.

With certain reports that are hyperlinked to other reports, pressing the IE back button (to return to the previous report) goes into the endless 'Report is being generated, green spin'. Only by clicking on the report's toolbar refresh button does the report re-display.

This appears to be a problem only with the combination of SQL 2005 64-bit and IE 7. Everything works great! with SQL 2005 32-bit and IE 6 or 7 and even using SQL 2005 64-bit with IE 6. The problem seems to be in IE 7 when SQL 2005 64-bit is the backend database. Any help or advice would be greatly appreciated!

Sam

|||

Are all of you using the 64-bit version? I am using the 32 bit version with IE 7 and have never experienced that problem.

I experience a problem with report viewer where I drilldown into a report and click the next page button. Then mysteriously the parent report displays. It's odd, but not too big of a deal to me.

|||We are on the 64-bit version.

Back button does not regenerate original report

When I drill down from one report to another and then depress the back button to return to the initial report, the message 'Generating Report" spins forever without actually running. However, if I depress the regenerate button during this time, it will run the report.

I believe that I may have inadvertingly reset a field attribute to have caused this condition. Ironocally, I have the same set of database installed on another server, and the this does not happen.

I forgot to mention that I am using Report Manager to deploy the reports.

Please assist.

moving to SQL Server Reporting Services forum.

Back button does not regenerate original report

When I drill down from one report to another and then depress the back button to return to the initial report, the message 'Generating Report" spins forever without actually running. However, if I depress the regenerate button during this time, it will run the report.

I believe that I may have inadvertingly reset a field attribute to have caused this condition. Ironocally, I have the same set of database installed on another server, and the this does not happen.

I forgot to mention that I am using Report Manager to deploy the reports.

Please assist.

Just checking if anyone has any additional info on this. I'm having the same problem. SQL Server 2005 (SP2), Reporting Services 2005 (SP2).

Any help is appreciated as this is a major usability issue.

|||I am also experiencing this issue.|||I think microsoft fixed this. In vista64/sql64 there is no back button......that I can find.|||This thread is talking about the browser (internet explorer) back button.|||

Can someone from Microsoft please chime in on this issue. If you hit the browser back button from IE from a drilled/jump to report, the original report is not shown. The "Report is being generated" screen just sits there. This is a huge usability issue.

Also, can someone from Microsoft point me to where we're supposed to find out when/if an upcoming SP/hotfix is going to come out and what is included. I want to move our reporting system to Reporting Services but the above issue is one of the reasons I can't.

|||

I am also getting this on multiple machines and databases. I can recreate it starting with 2 simple reports, the main report and a drill down report. The browser back button tries to bring up the original report, but never finishes. I noticed there is always an HTML error on the report that goes away if you click refresh. (Note: The error only shows up if your browser is set to show errors). I am using SQL Service Pack 2 and IE7. The error I get is:

Line: 718

Char: 5

Error: 'location' is null or not an object

Code: 0

URL: ......

|||

I am having this problem too, since we moved to SQL 2005 64-bit,sp2.

With certain reports that are hyperlinked to other reports, pressing the IE back button (to return to the previous report) goes into the endless 'Report is being generated, green spin'. Only by clicking on the report's toolbar refresh button does the report re-display.

This appears to be a problem only with the combination of SQL 2005 64-bit and IE 7. Everything works great! with SQL 2005 32-bit and IE 6 or 7 and even using SQL 2005 64-bit with IE 6. The problem seems to be in IE 7 when SQL 2005 64-bit is the backend database. Any help or advice would be greatly appreciated!

Sam

|||

Are all of you using the 64-bit version? I am using the 32 bit version with IE 7 and have never experienced that problem.

I experience a problem with report viewer where I drilldown into a report and click the next page button. Then mysteriously the parent report displays. It's odd, but not too big of a deal to me.

|||We are on the 64-bit version.

Back button does not regenerate original report

When I drill down from one report to another and then depress the back button to return to the initial report, the message 'Generating Report" spins forever without actually running. However, if I depress the regenerate button during this time, it will run the report.

I believe that I may have inadvertingly reset a field attribute to have caused this condition. Ironocally, I have the same set of database installed on another server, and the this does not happen.

I forgot to mention that I am using Report Manager to deploy the reports.

Please assist.

Just checking if anyone has any additional info on this. I'm having the same problem. SQL Server 2005 (SP2), Reporting Services 2005 (SP2).

Any help is appreciated as this is a major usability issue.

|||I am also experiencing this issue.|||I think microsoft fixed this. In vista64/sql64 there is no back button......that I can find.|||This thread is talking about the browser (internet explorer) back button.|||

Can someone from Microsoft please chime in on this issue. If you hit the browser back button from IE from a drilled/jump to report, the original report is not shown. The "Report is being generated" screen just sits there. This is a huge usability issue.

Also, can someone from Microsoft point me to where we're supposed to find out when/if an upcoming SP/hotfix is going to come out and what is included. I want to move our reporting system to Reporting Services but the above issue is one of the reasons I can't.

|||

I am also getting this on multiple machines and databases. I can recreate it starting with 2 simple reports, the main report and a drill down report. The browser back button tries to bring up the original report, but never finishes. I noticed there is always an HTML error on the report that goes away if you click refresh. (Note: The error only shows up if your browser is set to show errors). I am using SQL Service Pack 2 and IE7. The error I get is:

Line: 718

Char: 5

Error: 'location' is null or not an object

Code: 0

URL: ......

|||

I am having this problem too, since we moved to SQL 2005 64-bit,sp2.

With certain reports that are hyperlinked to other reports, pressing the IE back button (to return to the previous report) goes into the endless 'Report is being generated, green spin'. Only by clicking on the report's toolbar refresh button does the report re-display.

This appears to be a problem only with the combination of SQL 2005 64-bit and IE 7. Everything works great! with SQL 2005 32-bit and IE 6 or 7 and even using SQL 2005 64-bit with IE 6. The problem seems to be in IE 7 when SQL 2005 64-bit is the backend database. Any help or advice would be greatly appreciated!

Sam

|||

Are all of you using the 64-bit version? I am using the 32 bit version with IE 7 and have never experienced that problem.

I experience a problem with report viewer where I drilldown into a report and click the next page button. Then mysteriously the parent report displays. It's odd, but not too big of a deal to me.

|||We are on the 64-bit version.

Back button does not regenerate original report

When I drill down from one report to another and then depress the back button to return to the initial report, the message 'Generating Report" spins forever without actually running. However, if I depress the regenerate button during this time, it will run the report.

I believe that I may have inadvertingly reset a field attribute to have caused this condition. Ironocally, I have the same set of database installed on another server, and the this does not happen.

I forgot to mention that I am using Report Manager to deploy the reports.

Please assist.

Just checking if anyone has any additional info on this. I'm having the same problem. SQL Server 2005 (SP2), Reporting Services 2005 (SP2).

Any help is appreciated as this is a major usability issue.

|||I am also experiencing this issue.|||I think microsoft fixed this. In vista64/sql64 there is no back button......that I can find.|||This thread is talking about the browser (internet explorer) back button.|||

Can someone from Microsoft please chime in on this issue. If you hit the browser back button from IE from a drilled/jump to report, the original report is not shown. The "Report is being generated" screen just sits there. This is a huge usability issue.

Also, can someone from Microsoft point me to where we're supposed to find out when/if an upcoming SP/hotfix is going to come out and what is included. I want to move our reporting system to Reporting Services but the above issue is one of the reasons I can't.

|||

I am also getting this on multiple machines and databases. I can recreate it starting with 2 simple reports, the main report and a drill down report. The browser back button tries to bring up the original report, but never finishes. I noticed there is always an HTML error on the report that goes away if you click refresh. (Note: The error only shows up if your browser is set to show errors). I am using SQL Service Pack 2 and IE7. The error I get is:

Line: 718

Char: 5

Error: 'location' is null or not an object

Code: 0

URL: ......

|||

I am having this problem too, since we moved to SQL 2005 64-bit,sp2.

With certain reports that are hyperlinked to other reports, pressing the IE back button (to return to the previous report) goes into the endless 'Report is being generated, green spin'. Only by clicking on the report's toolbar refresh button does the report re-display.

This appears to be a problem only with the combination of SQL 2005 64-bit and IE 7. Everything works great! with SQL 2005 32-bit and IE 6 or 7 and even using SQL 2005 64-bit with IE 6. The problem seems to be in IE 7 when SQL 2005 64-bit is the backend database. Any help or advice would be greatly appreciated!

Sam

|||

Are all of you using the 64-bit version? I am using the 32 bit version with IE 7 and have never experienced that problem.

I experience a problem with report viewer where I drilldown into a report and click the next page button. Then mysteriously the parent report displays. It's odd, but not too big of a deal to me.

|||We are on the 64-bit version.

Back button does not regenerate original report

When I drill down from one report to another and then depress the back button to return to the initial report, the message 'Generating Report" spins forever without actually running. However, if I depress the regenerate button during this time, it will run the report.

I believe that I may have inadvertingly reset a field attribute to have caused this condition. Ironocally, I have the same set of database installed on another server, and the this does not happen.

I forgot to mention that I am using Report Manager to deploy the reports.

Please assist.

Just checking if anyone has any additional info on this. I'm having the same problem. SQL Server 2005 (SP2), Reporting Services 2005 (SP2).

Any help is appreciated as this is a major usability issue.

|||I am also experiencing this issue.|||I think microsoft fixed this. In vista64/sql64 there is no back button......that I can find.|||This thread is talking about the browser (internet explorer) back button.|||

Can someone from Microsoft please chime in on this issue. If you hit the browser back button from IE from a drilled/jump to report, the original report is not shown. The "Report is being generated" screen just sits there. This is a huge usability issue.

Also, can someone from Microsoft point me to where we're supposed to find out when/if an upcoming SP/hotfix is going to come out and what is included. I want to move our reporting system to Reporting Services but the above issue is one of the reasons I can't.

|||

I am also getting this on multiple machines and databases. I can recreate it starting with 2 simple reports, the main report and a drill down report. The browser back button tries to bring up the original report, but never finishes. I noticed there is always an HTML error on the report that goes away if you click refresh. (Note: The error only shows up if your browser is set to show errors). I am using SQL Service Pack 2 and IE7. The error I get is:

Line: 718

Char: 5

Error: 'location' is null or not an object

Code: 0

URL: ......

|||

I am having this problem too, since we moved to SQL 2005 64-bit,sp2.

With certain reports that are hyperlinked to other reports, pressing the IE back button (to return to the previous report) goes into the endless 'Report is being generated, green spin'. Only by clicking on the report's toolbar refresh button does the report re-display.

This appears to be a problem only with the combination of SQL 2005 64-bit and IE 7. Everything works great! with SQL 2005 32-bit and IE 6 or 7 and even using SQL 2005 64-bit with IE 6. The problem seems to be in IE 7 when SQL 2005 64-bit is the backend database. Any help or advice would be greatly appreciated!

Sam

|||

Are all of you using the 64-bit version? I am using the 32 bit version with IE 7 and have never experienced that problem.

I experience a problem with report viewer where I drilldown into a report and click the next page button. Then mysteriously the parent report displays. It's odd, but not too big of a deal to me.

|||We are on the 64-bit version.

Sunday, February 19, 2012

avoid cursor to get variables

Hi all,
I would like to know if there is any other way of doing the following
without a cursor.
Normally I need to return a single record and load of variables with it (the
query is very costly, so I cannot afford running it again and again.
At the moment it is done with a cursor to retrieve the parameters in the
select clause, and right away it is closed. I thought it could be faster to
do directly a select statement and assign the values to the variables
directly, but as the query is complex and has parameters in the from part I
cannot do it.
The query is normally built on a string and accessed through a cursors:
@.sql = "declare c cursor fast_forward for"
@.sql = @.sql + "select field1, field2,... fieldN"
@.sql = @.sql + " from " @.tableParameter
@.sql = @.sql + "where condition1 =" @.condition1Parameter
exec(@.sql)
open c
fetch next from c into @.field1,
@.field2,

@.fieldn
close c
deallocate c
What I would like to do is something of the like this:
@.sql = “select @.field1 = field1, @.field2 = field2 … from @.tableParameter
where condition1 = @.condition1Parameter “
But it always fails unless I declare the variables within the string as
well, but in that case I cannot use that variables in the scrip further.
I have also tried to enclose this logic in a stored procedure, but it would
only work if the query to be executed has only the parameters in the select
part, and not the from part.
Anyone has any idea?
Thanks in advance,
TristanHi
You should be able to use sp_executesql to do this.
DECLARE @.sql nvarchar(4000)
DECLARE @.field1 varchar(10)
DECLARE @.field2 varchar(10)
DECLARE @.condition1Parameter varchar(10)
SET @.sql = N'select @.field1 = field1, @.field2 = field2 … from ' +
QUOTENAME(@.tableParameter) + N'where condition1 = @.condition1Parameter'
EXEC sp_executesql @.@.sql,
N'@.field1 vachar(10) OUTPUT, @.field2 vachar(10) OUTPUT,
@.condition1Parameter vachar(10)',
@.field1 OUTPUT, @.field2 OUTPUT, @.condition1Parameter
GO
See books online and http://www.sommarskog.se/dynamic_sql.html#sp_executesql
for other examples.
John
"Tristan" wrote:

> Hi all,
> I would like to know if there is any other way of doing the following
> without a cursor.
> Normally I need to return a single record and load of variables with it (t
he
> query is very costly, so I cannot afford running it again and again.
> At the moment it is done with a cursor to retrieve the parameters in the
> select clause, and right away it is closed. I thought it could be faster t
o
> do directly a select statement and assign the values to the variables
> directly, but as the query is complex and has parameters in the from part
I
> cannot do it.
> The query is normally built on a string and accessed through a cursors:
> @.sql = "declare c cursor fast_forward for"
> @.sql = @.sql + "select field1, field2,... fieldN"
> @.sql = @.sql + " from " @.tableParameter
> @.sql = @.sql + "where condition1 =" @.condition1Parameter
> exec(@.sql)
> open c
> fetch next from c into @.field1,
> @.field2,
> …
> @.fieldn
> close c
> deallocate c
>
> What I would like to do is something of the like this:
> @.sql = “select @.field1 = field1, @.field2 = field2 … from @.tableParamet
er
> where condition1 = @.condition1Parameter “
> But it always fails unless I declare the variables within the string as
> well, but in that case I cannot use that variables in the scrip further.
> I have also tried to enclose this logic in a stored procedure, but it woul
d
> only work if the query to be executed has only the parameters in the selec
t
> part, and not the from part.
> Anyone has any idea?
> Thanks in advance,
> Tristan
>|||Thanks a lot John, that did the job :-) !!!
"John Bell" wrote:
> Hi
> You should be able to use sp_executesql to do this.
> DECLARE @.sql nvarchar(4000)
> DECLARE @.field1 varchar(10)
> DECLARE @.field2 varchar(10)
> DECLARE @.condition1Parameter varchar(10)
> SET @.sql = N'select @.field1 = field1, @.field2 = field2 … from ' +
> QUOTENAME(@.tableParameter) + N'where condition1 = @.condition1Parameter'
> EXEC sp_executesql @.@.sql,
> N'@.field1 vachar(10) OUTPUT, @.field2 vachar(10) OUTPUT,
> @.condition1Parameter vachar(10)',
> @.field1 OUTPUT, @.field2 OUTPUT, @.condition1Parameter
> GO
> See books online and [url]http://www.sommarskog.se/dynamic_sql.html#sp_executesql[/ur
l]
> for other examples.
> John
>
> "Tristan" wrote:
>|||You really need to re-think your entire approach. A table variable is
your way of tellignthe world that your code lacks any cohesion
(remember that term from Software Engineering 101?). This procedure
might be for automobiles, might be squid, or who knows? Well, any
random future user is a better judge and designer than the programmer
who did this.
I will not even remark on using a cursor and the way that you seemto
confuse fields and columns.
You are not yet writing SQL; you are using SQL to fake 1950's
procedural language that you already know.
It may take you years to un-learn . your old habits. But when you do,
your code will run1 to 3 orders of magnitude faster, port to new
platforms, be readable and take up a fraction of the space you are
using now.

Thursday, February 16, 2012

Average Turnaround Time - Datediff() Help

Hi everyone, I need some help with creating a report that calculates the average turnaround time in days that it takes for units to return from trips destined to a location.

The database that I am working with lists a trip each time a unit is dispatched to a destination, and then another trip is created for the units return. In the example below I am trying to calculate the number of days that it takes for a unit to return to Vancouver by calculating the difference between the departure date from Vancouver and the arrival date back into Vancouver. I then need to calculate the average number of days that it takes for a unit to return from a trip. See sample data below.

UNIT -- TRIP -- START LOCATION --START DATE--FIN LOCATION--FIN DATE
================================================== =======
U12 --001 -- VANCOUVER ---FEB 10 -- ONTARIO -- FEB 15
U10 --002 -- VANCOUVER ---FEB 13 -- ONTARIO -- FEB 18
U12 --003 -- ONTARIO ----MARCH 13 -- VANCOUVER -- MARCH 18
U10 --004 -- ONTARIO ----MARCH 1 -- VANCOUVER --MARCH 6

Unit U12 took 36 days to return back to Vancouver
Unit U10 took 21 days to return back to Vancouver

Therefore based on the two trips it takes an average of aproximately 28.5 days for a unit to return from trips destined to Ontario.try this, not a greate SQL though :)

select Route, avg(DaysTaken) as AvgDaysTaken
from (
select A.Unit,(select top 1 Start_Location from MyTable where MyTable.Unit=A.Unit order by Trip)+ '-'+(select top 1 Fin_Location from MyTable where MyTable.Unit=A.Unit order by Trip)+'-'+(select top 1 Start_Location from MyTable where MyTable.Unit=A.Unit order by Trip) as Route, cast(A.DaysTaken as decimal(9,2)) as DaysTaken
from (
select Unit,datediff(d,min(Start_date),max(fin_date)) DaysTaken from MyTable group by unit
) A
) B
group by Route

Average problem

Hi,
I've a subtotal row in a matrix. I do an average of a column but the avg
function return me the average of all results of each rows. In fact, I want
do the average of each colums except where the results is equal to 0.
How can I do that?Aggregate functions like Sum, Count, Avg, etc. only consider values which
are not null.
Try this:
=Avg(iif(Fields!X.Value = 0, Nothing, Fields!X.Value))
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Seb" <Seb@.discussions.microsoft.com> wrote in message
news:AA16A434-5BB4-4D03-B9E8-4C4D5224BB1D@.microsoft.com...
> Hi,
> I've a subtotal row in a matrix. I do an average of a column but the avg
> function return me the average of all results of each rows. In fact, I
want
> do the average of each colums except where the results is equal to 0.
> How can I do that?