Thursday, March 22, 2012
Can total be moved to top of column rather than bottom
my second week with the tool, so my apologies if this is a rather
simple question or I am not asking the question properly.
My team has received a specification for a report where the customers
would like to see column totals at the top of the column, rather than
SSRS's default of bottom. I am new to banded report writing, so I am
hoping this is fairly simple. Using BusinessObjects, I would have
inserted a row at the top of the column and then copied the formula
from the total (or subtotal) line up to the line I had just inserted
(then deleted the row at the bottom).
Is there similar functionality with SRSS?
Kind regards,
Steve HaffnerYes, it is possible.
Option-1: If you want to show the total besides the group name: Ask them to
add the group Header(if not available). besides the group name table cell ,
write a expression like =sum(field!columnname.value)
Option-2: If you want to show the total in top of the group name:
right click on table row(Group row) and click on insert row above. and write
a expression like ="Group Total : " & sum(field!columnname.value)
Regards,
Sriman.
"shaffner" wrote:
> Standard newbie disclaimer: I have searched the archives and this is
> my second week with the tool, so my apologies if this is a rather
> simple question or I am not asking the question properly.
> My team has received a specification for a report where the customers
> would like to see column totals at the top of the column, rather than
> SSRS's default of bottom. I am new to banded report writing, so I am
> hoping this is fairly simple. Using BusinessObjects, I would have
> inserted a row at the top of the column and then copied the formula
> from the total (or subtotal) line up to the line I had just inserted
> (then deleted the row at the bottom).
> Is there similar functionality with SRSS?
> Kind regards,
> Steve Haffner
>|||On Apr 5, 10:48 am, "shaffner" <steve_haff...@.hotmail.com> wrote:
> Standard newbie disclaimer: I have searched the archives and this is
> my second week with the tool, so my apologies if this is a rather
> simple question or I am not asking the question properly.
> My team has received a specification for a report where the customers
> would like to see column totals at the top of the column, rather than
> SSRS's default of bottom. I am new to banded report writing, so I am
> hoping this is fairly simple. Using BusinessObjects, I would have
> inserted a row at the top of the column and then copied the formula
> from the total (or subtotal) line up to the line I had just inserted
> (then deleted the row at the bottom).
> Is there similar functionality with SRSS?
> Kind regards,
> Steve Haffner
This can be done similarly in SSRS. You can either insert a row/group
in the top of a table control and add something like the following as
the expression:
=Sum(Fields!FieldName.Value)
Also, you can do the totaling in the stored procedure/query that is
sourcing the report and just pass it to the report and create a
textbox control at the top of the table control and include it there.
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant
Tuesday, March 20, 2012
Can this be optimized? Newbie question
I'm running the following SQL to get values for 4 fields. It is
unacceptably slow. I have no control over the structure of the
database, field names, indexes etc. - what I'm given as far as DB
design is all I'm going to get. If anyone could make any suggestions
I'd really appreciate it!
Thanks,
Bill
SELECT DISTINCT
T_MULTILIST_GRADE.grade, T_MULTILIST.description, T_MULTILIST.code,
T_RECEIVING_DETAIL.amount
FROM T_MULTILIST, T_RECEIVING_DETAIL,
T_MULTILIST_GRADE,T_REQUISITION,T_REQUISITION_DETA IL,T_ORDER,T_DEPOSITORY,
T_RECEIVING
WHERE
(
T_RECEIVING_DETAIL.invoice_number =T_RECEIVING.invoice_number
AND T_RECEIVING_DETAIL.order_id =T_ORDER.id
AND T_ORDER.depository_id =T_DEPOSITORY.id
AND T_REQUISITION.id =T_ORDER.requisition_id
AND T_REQUISITION_DETAIL.requisition_id =T_REQUISITION.id
AND T_REQUISITION_DETAIL.multilist_code
=T_MULTILIST_GRADE.multilist_code
AND T_MULTILIST_GRADE.multilist_code =T_MULTILIST.code
AND T_ORDER.requisition_time_stamp BETWEEN '05/31/2005' AND
'06/01/2006'
AND T_MULTILIST.expiration_year > '2005'
AND T_MULTILIST.code IN ('0043','1043')
AND T_DEPOSITORY.depository_type = 'PRIVATE'
AND T_RECEIVING.status <> 'PAID'
)
wgblackmon@.yahoo.com wrote:
> Hi,
> I'm running the following SQL to get values for 4 fields. It is
> unacceptably slow. I have no control over the structure of the
> database, field names, indexes etc. - what I'm given as far as DB
> design is all I'm going to get. If anyone could make any suggestions
> I'd really appreciate it!
> Thanks,
> Bill
Well, it sounds like you're pretty much screwed. How many rows
does the query return? Is it appreciably faster if you remove
the 'DISTINCT' and do you have the opportunity to detect
and ignore duplicates at the client? Can you even find out
what indexes are on the tables or get the query plan for this?
There may be other query criteria that you could drop, and
instead post-qualify rows in the client.
Hope this (or someone else smarter) helps,
Joe Weinstein at BEA Systems
> SELECT DISTINCT
> T_MULTILIST_GRADE.grade, T_MULTILIST.description, T_MULTILIST.code,
> T_RECEIVING_DETAIL.amount
> FROM T_MULTILIST, T_RECEIVING_DETAIL,
> T_MULTILIST_GRADE,T_REQUISITION,T_REQUISITION_DETA IL,T_ORDER,T_DEPOSITORY,
> T_RECEIVING
> WHERE
> (
> T_RECEIVING_DETAIL.invoice_number =T_RECEIVING.invoice_number
> AND T_RECEIVING_DETAIL.order_id =T_ORDER.id
> AND T_ORDER.depository_id =T_DEPOSITORY.id
> AND T_REQUISITION.id =T_ORDER.requisition_id
> AND T_REQUISITION_DETAIL.requisition_id =T_REQUISITION.id
> AND T_REQUISITION_DETAIL.multilist_code
> =T_MULTILIST_GRADE.multilist_code
> AND T_MULTILIST_GRADE.multilist_code =T_MULTILIST.code
> AND T_ORDER.requisition_time_stamp BETWEEN '05/31/2005' AND
> '06/01/2006'
> AND T_MULTILIST.expiration_year > '2005'
> AND T_MULTILIST.code IN ('0043','1043')
> AND T_DEPOSITORY.depository_type = 'PRIVATE'
> AND T_RECEIVING.status <> 'PAID'
> )|||I'm using this query (and up to 20 similar ones combined with 'UNION')
in a Crystal Report. The report may or may not be able to remove dupes,
but I doubt it (I'm new at Crystal Reports). I'm using DBArtisan to
design the query. The database is an undocumented nightmare with few
indexes. I know it's hideous, but I was hoping I was missing something
really obvious...:)|||Bill,
There is nothing wrong with the query, except that maybe the DISTINCT is
not necessary and could save some time if you dropped it.
The key of this query's performance is in the available indexes (and
maybe the hardware configuration). If no usuable indexes are available
and the tables are large then this query will run like a dog. You should
really turn to the DBA who can put the proper indexes in place...
Gert-Jan
"wgblackmon@.yahoo.com" wrote:
> Hi,
> I'm running the following SQL to get values for 4 fields. It is
> unacceptably slow. I have no control over the structure of the
> database, field names, indexes etc. - what I'm given as far as DB
> design is all I'm going to get. If anyone could make any suggestions
> I'd really appreciate it!
> Thanks,
> Bill
> SELECT DISTINCT
> T_MULTILIST_GRADE.grade, T_MULTILIST.description, T_MULTILIST.code,
> T_RECEIVING_DETAIL.amount
> FROM T_MULTILIST, T_RECEIVING_DETAIL,
> T_MULTILIST_GRADE,T_REQUISITION,T_REQUISITION_DETA IL,T_ORDER,T_DEPOSITORY,
> T_RECEIVING
> WHERE
> (
> T_RECEIVING_DETAIL.invoice_number =T_RECEIVING.invoice_number
> AND T_RECEIVING_DETAIL.order_id =T_ORDER.id
> AND T_ORDER.depository_id =T_DEPOSITORY.id
> AND T_REQUISITION.id =T_ORDER.requisition_id
> AND T_REQUISITION_DETAIL.requisition_id =T_REQUISITION.id
> AND T_REQUISITION_DETAIL.multilist_code
> =T_MULTILIST_GRADE.multilist_code
> AND T_MULTILIST_GRADE.multilist_code =T_MULTILIST.code
> AND T_ORDER.requisition_time_stamp BETWEEN '05/31/2005' AND
> '06/01/2006'
> AND T_MULTILIST.expiration_year > '2005'
> AND T_MULTILIST.code IN ('0043','1043')
> AND T_DEPOSITORY.depository_type = 'PRIVATE'
> AND T_RECEIVING.status <> 'PAID'
> )|||T_MULTILIST.description may be wide. Sorting wide result sets may be
slow. try removing duplicates before joining with T_MULTILIST. Look up
article "The Less SQL Server Sorts, the Faster It Responds"|||wgblackmon@.yahoo.com (wgblackmon@.yahoo.com) writes:
> I'm running the following SQL to get values for 4 fields. It is
> unacceptably slow. I have no control over the structure of the
> database, field names, indexes etc. - what I'm given as far as DB
> design is all I'm going to get. If anyone could make any suggestions
> I'd really appreciate it!
My newsserver had an outage, so the reply I posted originally got lost.
What I said in that post was not that fantastic:
Without know the tables and indexes it's about impossible to give
suggestions. If you post the CREATE TABLE and CREATE INDEX statements
(don't forget constraints!), as well some indication of table sizes,
we might be able to give some tips.
Even better if you can run:
SET STATISTICS PROFILE ON
go
-- query goes here
go
SET STATISTICS PROFILE OFF
go
and post the output. (Preferably in an attachment, as the output is far too
wide for news article).
However, a few minutes later one more thing occurred to me, and that was
when I discovered that the newsserver was sick.
Anyway, what you could try is to run DBCC DBREINDEX on all involved tables.
While it is not going to cause the query to run with the speed of light
all of a sudden, you could see an improvement with 20-30% if there is
serious fragmentation of the tables.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
Wednesday, March 7, 2012
Can Sql 2005 Database be used by Sql 2000 server
|||
Dev2624 wrote:
Hi i am a newbie and an developer i have an issue the Development we are doing is on sql server 2005 and we are wanting to send this database for a front end team to develop fromt end and they are using sql server 2000 , will there be any problems with regarding to version. if there are problems what would be the way to provide them with the Data.
A better option is to give the developers SQL Server Express Advanced so you can use all the features in 2005 and moving database from development to testing is just moving either MDF/LDF or .BAK file. The reason is it takes a lot to move a SQL Server 2005 database to 2000 but it is easy to move a move 200 database to 2005. If you plan to use other subsystems of SQL Server for development a better choice for the developers is the under $50 no deployment restricted developer edition. Both the developer edition and the express editions comes locked down your developers need to enable all features needed to enable development. Hope this helps.
http://msdn2.microsoft.com/en-us/express/bb410792.aspx
Friday, February 24, 2012
Can someone Help me?
Hi peoples Im newbie in Sql server 2005 and learning Here is my problem:
I have:
Table1 Complaint_Types-
TypeID int PK
Type VarChar
Table2 -Members-
MemberID Int Pk
MemberName VarChar
Roomnumber VarChar
Table3 -Computers-
ComputerID Int Pk
ComputerDescription VarChar
MemberID Int Fk
Table4 -Techs-
TechID Int Pk
TechName VarChar
HireDate DateTime
Table5 -Complaints-
TypeID Int Fk
MemberID Int Fk
ComputerID Int Fk
TechID Int Fk
Description VarChar
PostDate DateTime
ResolvedDate DateTime
I Need:
1- Idea to Get data from related Tables
2- Insert / Update all Tables
3- Calculate Date Time Feilds
eg: Complaints in current month
Complaints in last year
Time Consumed on a Complaint (Return date Postdate) in Days, hours,minutes
if any body have a working example in vb.net in form of windows Forms or Asp.net please Let me Know
any type of help welcomed
regards
Rashed Nadeem
Moving to Getting Started forum|||
Hi Rashed,
I would suggest to refer SQL Server Books Online for Insert/Update/Delete Statements
select Columnlists from Table -- Will fetch records from table, adding where columnname would fetch records based on condition given in where
insert into Table values('values',0) -- will add values to table
Refer http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=16621
http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=18550
http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=13581
Refer http://www.connectionstrings.com/ for Various Connection Strings
and http://www.planet-source-code.com/ for VB, .Net source code examples
HTH
Hemantgiri S. Goswami
|||Hi Rashed:
It seems like you are seeking a way to access SQL data using managed code.
Getting familiar with ADO.net may be a great start.
Following are the links to some MSDN references and sample code that may help to get you started:
http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring.aspx
http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.parameters.aspx
http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqldataadapter.aspx
http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.aspx
Hope these information helps. :-)
Thanks
Tommy