How To Do A Report With Multiple Sets Of Details For One Group

Mar 4, 2008



Hi,
I started working with SRS from the past one month. I am breaking my head to do this. My report has a single stored procedure. I made it to work all values of a parameter like
exec sp_employee 'All' (Returns data for all employees)
exec sp_employee '1111' (Returns data for an employee with id 1111)
exec sp_employee '1111,2222' (Returns data for an employee with id 1111 as well as 2222)

This part works perfectly. I could successfully pass the values as mentioned above using a code block.

Now my challenge is how to layout the data on the report.

I need to show the report as follows:

Employeeid Employee Name Address etc.......
Skills:
Skill# Skill Name
1 11111
2 22222
3 33333
4 44444
Contacts:
Contact Type Contact#
Main 111-1111
Emergency 222-1111
Eductation:
Name University
Degree UofU
Masters UofU

I tried using group by employeeid. But i can only show one group of data either Skills/Contacts/Education.
I do not know if I use sub-report, how to pass the parameter from the main, when I pick multiple values for Employeeid.

Any idea how to do this? I appreciate your help,
Thank you,



View 3 Replies


ADVERTISEMENT

Transact SQL :: Powershell Script To Fetch Database Usage Details For Multiple Servers (report)

Oct 28, 2015

Is there a way to fetch database usage details for multiple SQL servers (report) usirng powershell script.

Details: servername, databasename, datafile usage, logfile usage, free % age...etc.

View 3 Replies View Related

How To Combine 2 Sets Of Group By ........

Dec 11, 2007

Hi:

How can I combine 2 sets of group by together?

same criteria on group by Region, county

setA with where sum(timeSec) <= 30

while setB with where sum(timeSec) > 30

they are not necessary mutual exclusive. thus, union is not good.
However, when I use derived table method, I will have 'dups' on column of 'Region' and 'county', 2 total are fine.

thanks
David

View 2 Replies View Related

XML Data To SQL Server With Multiple Orders An Multiple Order Details??

Aug 5, 2004

Hi all!

I'm trying to get some XML data into SQL Server but i ran into problem when inserting the data (multiple orders with multiple order details) using a single sproc. Is it possible, or do I have to do in some other way? :confused:

I simplified my example to this:
-----------------------------
--CREATE PROCEDURE sp_InsertOrders AS

DECLARE @docHandle INT, @xmlDoc VARCHAR(4000), @orderID INT

--DROP TABLE #Orders
CREATE TABLE #Orders
(
OrderId SMALLINT IDENTITY(1,1),
FkCustomerID SMALLINT NOT NULL,
OrderDate DATETIME NOT NULL
)

--DROP TABLE #OrderDetails
CREATE TABLE #OrderDetails
(
OrderDetailsId SMALLINT IDENTITY(1,1),
FkOrderID SMALLINT NOT NULL,
ProductID SMALLINT NOT NULL,
UnitPrice SMALLINT NOT NULL
)

Set @xmlDoc = '
<Orders>
<Order CustomerID="1" OrderDate="2004-04-01">
<OrderDetails ProductID="6" UnitPrice="19"/>
<OrderDetails ProductID="3" UnitPrice="11"/>
<OrderDetails ProductID="9" UnitPrice="7"/>
</Order>
<Order CustomerID="2" OrderDate="2004-04-12">
<OrderDetails ProductID="2" UnitPrice="24"/>
<OrderDetails ProductID="4" UnitPrice="13"/>
</Order>
</Orders>'

EXEC sp_xml_preparedocument @docHandle OUTPUT, @xmlDoc

INSERT INTO #Orders (FkCustomerID, OrderDate)
SELECT CustomerID, OrderDate
FROM OpenXML(@docHandle, 'Orders/Order', 3)
WITH (
CustomerID INTEGER,
OrderDate DATETIME
)

SET @OrderID = @@IDENTITY;

--INSERT INTO #OrderDetails (@OrderID, ProductID, UnitPrice)
SELECT @OrderID AS OrderID, ProductID, UnitPrice
FROM OpenXML(@docHandle, 'Orders/Order/OrderDetails', 3)
WITH (
ProductID INTEGER,
UnitPrice INTEGER
)
-----------------------------

All orders are inserted first which makes the use of @@IDENTITY incorrect (it works fine if you insert a single order with multiple order details). Since it was quite some time since I last worked with SQL I am not sure if am doing it the right way... :confused: :confused: Anybody out there who knows how to solve the problem?

Cheers,
Christian

View 2 Replies View Related

Group/Details Formatting

May 26, 2007

Hello,


I am developing a report where i have one group e.g. Dealer Name and then details of that dealer.

Dealer details can have around 10 columns and where dealer name is of around 80 chars length. I need to use 10.7in*7.1in page size.



So how i can manage the formatting for dealer group, dealer details in one page.



Thanks.

View 2 Replies View Related

Displaying Details Of A Group

Feb 8, 2007

I have two groups. I want to do this:

Group 1

Group2

Group2 Summary info

Group2 Details

Group2 Details

Group2 Details

Group2 Details



I don't know how to get the table details row to only show my group 2 details.

Thanks

View 1 Replies View Related

Display Details Section For Each Group

Jul 2, 2007

Hi,

I want to display details ection for each group in a single table using one dataset.

For ex:



Group 1 Row --> Name Age

Details 1 Row--> XXX 30

Details 2 Row--> YYY 20

Group 2 Row --> City Country

Details 1 Row--> CCC ZZZZ

Details 2 Row--> BBB AAAA

View 3 Replies View Related

PRINT/ DISPLAY ALL GROUP DETAILS ON SAME PAGE

May 16, 2008

I have a report that is grouped based on a field. There is no way to pre-determine the number of detail lines each group will have. Is there a way to set the print condition such that if any group details do not fit onto one page then the whole group should be printed on the next page. Something like this:

Group1

DetailLine1 -------------
DetailLine2-------------
DetailLine3------------
-
-
DetailLinen-------------

Group2

DetailLine1 -------------
DetailLine2-------------
DetailLine3------------
-
-
DetailLinen-------------

Group3

DetailLine1 -------------
DetailLine2-------------
DetailLine3------------
-
-
DetailLinen-------------


If ALL Group2 details do not fit onto the same page print it on a new page. (I don't want each group on a separate page, I just want the group detail to start on a new page IF THEY DO NOT ALL fit on one page)

View 3 Replies View Related

Getting Details From A Row That Satisfies A Group Criteria In A Different Field

Apr 16, 2008

I know only enough SQL to be dangerous, but I'm stumped by this general task.

I need to know the method for selecting info from several fields of the records that satisfy a group function criteria on one of the fields. Example: Table contains Employees, products, amounts. If I group on Employee, and product, I can find the total amount of each product's sales for that employee.

create view prod_sales_by_emplyoee
select
employee
product
SUM(amount) as empl_prod_total
from sales
group by employee, product

But if I want to know which product made each employee the most money, I don't know how to do that, because the MAX function works on each field individually, not by row. From the above view, (or a table created from it) I want to know how to identify, for each employee, the product they made the most money selling, and what proportion of their total sales that product accounted for. Then, I'd like to use those results to eliminate the top tier, and find their second place product, etc.

I can do this in Access by sorting the table produced from the above view by empl_prod_total in decending order, joining that to a view that groups by employee only and provides a total, then using a grouped query on the joined data, I can use the "FIRST" function to find the values in each field of the record with the highest sales for that employee. However SQL doesn't have the FIRST function in its aggregate functions.

I suspect there's a standard way SQL does this, but it wasn't in my class. HELP!

View 7 Replies View Related

Multiple Result Sets

Jul 20, 2005

Hi!Another silly question:If a stored procedure returns multiple result sets, how do I choose the oneI want to insert into a table?For example sp_spaceused returns two result sets if object name is ommited.I only need the first result set. How do I do that?Tnx!Darko

View 2 Replies View Related

Multiple Result Sets

Jul 31, 2007

Hi,

I am aware that SSRS does not support stored procedures with multiple data sets, but what if the same stored procedure may only return one set based on a parameter?

For example, lets say if parameter @TableID = 0, the stored procedure returns 2 result sets. But if @TableID = 1, or @TableID = 2, the SP only brings back 1 result set. Is this also not supported?

When I try to do this it still only brings back the fields from the first table. Am I doing something wrong?

Thanks for any insight.

View 2 Replies View Related

Multiple Active Result Sets

Mar 29, 2007

Hi,
do u know
has sql server 2000 support MARS?

View 6 Replies View Related

Moving Through Recordset With Multiple Sets

Mar 28, 2008

I'm having some problems dealing with a VB script which delivers multiple results back from SQL Server. The script opens a connection to SQL 2000 and executes a procedure. The stored procedure has five select statements for its result. I receive a recordset object and try to move through each resultset. I get the first two result sets but when I execute the rs.nextrecordset on the third result, the rs.EOF is set to true and I never receive the third through fifth result set. The only difference I see from the stored procedure is that the first two result sets are "Select"s from local variables (ie @headertxt) and the third through the fifth result set are "Select"s from temporary (#tmptble) tables. I can't determine the root cause of why I can't see the third though fifth result set. I have "set nocount on" in the procedure. I have executed the stored procedure in Query Analyzer under the same ID/PW that I'm setting the connection with in the VBS. No errors are generated from the execution of the stored procedure. I'm running MDAC 2.81 on the workstation.
VBS:

dim Conn, strProvider, rs, SQL, i, j

dim asoftime, errorcode, cur1, cur2, atype, asofdate, display_title



'Get the data

Set Conn = Wscript.CreateObject("ADODB.Connection")



Conn.CommandTimeout = 60

Conn.ConnectionTimeout = 60

dim datasource

datasource = "xxxxxxxxx"



strProvider = "Provider=SQLOLEDB; Data Source=" & datasource & "; Initial Catalog=s; User ID=frndis; Password=frndis1; Connect Timeout=15; Persist Security Info=True;UseProcForPrepare=0"

SQL = "exec s.dbo.prcWebGetMostActiveSongs @currency = 'USD'"



Conn.Open strProvider



Set rs = Conn.Execute(SQL)



asoftime = rs(0)



wscript.echo asoftime, rs.Fields.Count



set rs = rs.nextrecordset

cur1 = rs(0)

cur2 = rs(1)

atype = rs(2)

display_title = replace(rs(3), "&", "&amp;")





wscript.echo cur1

wscript.echo cur2

wscript.echo atype

wscript.echo display_title, rs.Fields.Count



set rs = rs.nextrecordset



wscript.echo rs.Fields.Count



'grand total

while (not rs.eof)

for i = 0 to rs.Fields.Count - 1

wscript.echo rs(i)

next



rs.movenext



wend

wscript.echo "finished grand"



set rs = rs.nextrecordset

'mostactive total

while (not rs.eof)



rs.movenext



wend

wscript.echo "finished MA"



set rs = rs.nextrecordset

i = 0

'details

while (not rs.eof)

i = i + 1

rs.movenext



wend

wscript.echo "finished details", i





rs.close

Conn.Close

set rs = nothing

set Conn = nothing


Thanks,

Sid

View 5 Replies View Related

Multiple Data Sets In One List

Mar 24, 2008

Is there a way to put more then one data set in a list.
I have a report that has three data sets with three tables. Now i want to show each report by Region, per page. So you can view the same stuff for each region seperately, instead of all together. Is there a way to do this. Where i dont have to go back in my code, and find a way to link everything together, so its in one data set .

View 3 Replies View Related

Save Multiple Result Sets To One File??

Aug 9, 2007

Hello,

Is it possible to save the results of several SP calls in a script, to one file?

Here's what I mean:
I want to run these 4 sp calls--
exec EPC_SP1 'aph','live'
exec EAUI_SP2 'noble','newswire'
exec EAUI_SP3 'noble',1
exec EAUI_SP4 5507,'live'

And save the results of each one of those calls to the same file, in other words, an APPEND

Is this or something like it possible in TSQL?

Help appreciated!

Thank you,
--PhB

View 3 Replies View Related

Making A Chart Run With Multiple Data Sets.

Jul 26, 2007

Hello and thanks in advance.

I was wondering if anyone has ever written a chart with multiple datasets.

I need to be able to show sales dollars inflow by order date on one line and on the other needs to be sales dollars delivered by delivery date. So the all sections Values, Category groups, and Series Groups in the chart will be from 2 different datasets.

I have tried but it will not allow aggreates in the series groups.

Any Ideas would be greatly appreciated.

Thanks, Leo

View 1 Replies View Related

Multiple Result Sets From A Stored Procedure

Sep 28, 2006

I have a stored procedure like the following. This returns 2 result sets, however i only want it to return 2nd (SELECT SomeField FROM SomeTable). How is this done? Note - it is not possible to change 'SomeSPThatReturnsAnIntAndAResultSet '



CREATE PROCEDURE [dbo].[SomeSP]

@SomeParam int

AS

BEGIN

SET NOCOUNT ON;

declare @SomeScalar int

exec @SomeScalar = SomeSPThatReturnsAnIntAndAResultSet @SomeParam

if @SomeScalar = 0

BEGIN

SELECT SomeField FROM SomeTable

END

END

View 6 Replies View Related

How Stored Procedures Return Multiple Result Sets?

Jan 28, 2007

hi

i read that stored procedures can return multiple result sets?how is that?

thanks in advance.

View 4 Replies View Related

Adding Details To Multiple Records

Nov 29, 2007

Hello

I am trying to add a website address to all the records in a database that match a certain criteria. The statement that I am using is shown below, but surprise surprise, it's not working! I'm new to SQL so any help would me much appreciated! Thanks.

declare @ComNum int
set @ComNum = (select max(communication_number)+1 from communications)

insert into "communications"
(contact_number, device, ex_directory, dialling_code, std_code, number, extension, notes, amended_by, amended_on, cli_number, communication_number)
values (NULL, 'WW', 'N', NULL, 'WW', 'W', NULL, 'www.abc.co.uk', 'Jon', 2007-11-29, NULL, @ComNum);
select name
from organisations
where name ='Abc Limited'

So, I have not included a VALUE for CONTACT_NUMBER as I wish to update all records with the website details as per the INSERT statement where the NAME column in the ORGANISATIONS table is 'Abc Limited'. I know something is wrong but I can't quite work out what!

View 11 Replies View Related

Syntax For Returning And Accessing Multiple Result Sets In MSSQL 2k

Dec 29, 2006

Seasons greetings to everyone,A simple question. Could someone show me the syntax to produce multiple (2 or 3) result sets in a stored proc and how you access those sets from a c# program (ASP.NET)..Couldn't find a reference on Google, maybe I was asking the wrong question! Thanks for any help regardsDavej 

View 3 Replies View Related

How To Handle Multiple Result Sets Return From Stored Procedure

Aug 22, 2007

Hi all,

I want to know how to handle multiple result sets return from Stored Procedure? I know one way is to insert the result sets into the table, but the limitation is the result sets must have the same data structure. If the result sets have different data structure, how can I handle it.

Thanks,

View 5 Replies View Related

SQL 2005 Unexplained Error When Opening Recordset Or Multiple Sets

Aug 12, 2007

To anyone that can help me

we have a application written in straight ASP, we recently upgraded our SQL database connecting to the application from SQL 2000 to 2005 here is the issue

currently SQL 2005 is located in our test and UAT environments, SQL 2005 is not clustered in either location. Now let me make it clear THIS PROBLEM IS NOT HAPPENING IN OUR TEST ENVIRONMENT, I REPEAT THIS PROBLEM IS NOT HAPPENING IN OUR TEST ENVIROMENT, THIS PROBLEM IS ONLY HAPPENING IN OUR UAT ENVIROMENT

Each enviroment is outfitted with the following SQL 2005 environment, Enterprise Edition SP1 with Cumlative hotfix package 2153 just the SISS fix ONLY

now the problem is this, we have a vb program located directly on the server that has SQL 2005 on it that VB program inserts a timestamp into a table inside the database, now how this happens is the program connects to the database and opens a recordset with a forwardonly cursor and inserts the timestamp

NOW THE EXACT PROBLEM IS THAT THE VB PROGRAM CANNOT OPEN MULTIPLE RECORDSETS, THE ERROR RECEIVED IS LABLED LIKE THIS

ODBC DRIVER ERROR 8000405 SHARED MEMORY SQL DOESNT EXIST OR ACCESSED DENIED,

NOW here is the interesting part, AGAIN THIS IS NOT HAPPENING IN OUR TEST ENVIRONMENT, THE VB PROGRAM AGAIN IS ON THE TEST SQL SERVER AND HAS A FORWARD ONLY CURSOR AND INSERTS JUST FINE

NOW IF I MOVE THE VB PROGRAM OUT OF OUR UAT ENVIRONMENT ONTO ANOTHER SERVER IT INSERTS THE RECORD ONTO SQL SERVER JUST FINE, IT OPENS THE RECORDSET AND OPERATES NORMALLY, BOTH SERVERS HAVE EXACT SAME PERMISSIONS

Can anyone help me understand whats happening here

One note, when we changed the cursortype from forward-only to keyset it worked fine but that doesnt explain things

why does it work in test so clearly what we did with changing the cursortype isnt the answer

Thanks please consider this a urgent request

View 5 Replies View Related

Report Export Failing: An Internal Error Occurred On The Report Server. See The Error Log For More Details.

Feb 14, 2007

I have a pretty complicated report (lots of subreports, tables, etc) that can be well over a few hundred pages long. I can generate the report just fine, but I cannot seem to export it to anything other than an html archive. I need to export to PDF. Every time I try to export it get an error that says:

An internal error occurred on the report server. See the error log for more details.



I don't get any more information than that. Is there a way that I can figure out what the actual error is, or any other way I can go about troubleshooting this? Thanks.



Jeff



View 3 Replies View Related

How To Put A Footer On The Bottom Of Sets Of Pages In A Report

Aug 16, 2007

Hi forum members.


I'm a new SQL Reporting user and could use some guidance.

Here is a simple explanation of my application: imagine a report which prints out a grade report for each of 10 students. Depending on how many notes a teacher makes on the student's individual grade report, each student's report might be 1 or 2 pages long.

To create this report I just used a List report item and laid out a typical grade report and filled in the appropriate fields (name, teacher, etc.) from my dataset query.

When I run the report, it is running great and the students and their grade reports all print out.

The problem I am running into is I want to make sure each student's name is on page 2 if the grade report for that student goes more than 1 page (so pages aren't separated from each other or mixed up). I tried using a Report Footer, but that just put the first student's name at the bottom of every page. I could put a textfield at the bottom the list control but that would just appear at whatever length page 2 ended up being (basically you could have a "footer" at mid-page if the whole list only took up 1.5 pages).

How can I create a footer for each set of pages? Basically this would be a "footer" to the list control itself.

Thanks in advance!
Dave
davehunt00

View 2 Replies View Related

Details As Report Parameter? Possible?

Mar 7, 2008

I've got a question regarding report parameters and how to handle them with report details.

Let's assume I've got a matrix with the year in columns and articles in rows. The detail block consists of the turnover and the amount of each article selled.

Is it possible to set a report parameter that'll let the user decide, via a drop down box, If he will the see the turnover, the amount or both? I know that it works for values but can I apply a parameter to columns?

Thanks in advance!!!

View 5 Replies View Related

Identifying Results Sets When Stored Procedure Called Multiple Times

Oct 18, 2005

I have a report based on our product names that consists of two parts.Both insert data into a temporary table.1. A single grouped set of results based on all products2. Multiple tables based on individual product names.I am getting data by calling the same stored procedure multipletimes... for the single set of data I use "product like '%'"To get the data for individual products, I am using a cursor to parsethe product list.It's working great except that I have no idea how to identify theresults short of including a column with the product name. While thatis fine, I'm wondering if there is something that is like a header ortitle that I could insert prior to generating the data that would looka little tighter.Thanks in advance-DanielleJoin Bytes!

View 3 Replies View Related

Asterix Not Showing In Report Details

Jun 4, 2007

I have a report that shows a header, details and a footer



The detail line never prints lines with asterixes in them, e.g.



"**blah blah**"



As soon as I delete the asterix from the database, the line appears on the report



Any ideas anyone?

View 14 Replies View Related

T-SQL (SS2K8) :: Nested Stored Procedure - Multiple Results Of Record Sets Coming

Oct 1, 2014

I am calling stored procedure called GetCommonItemCount within another stored procedure called CheckBoxAvailability, the first stored procedure should return a count to second stored procedure and based on that some logic will be executed.

I have 2 problems in that

1. The result is not coming from first stored so the variable called @Cnt is always 0 although it should be 18
2. At the end i need to see in the output the result from second stored procedure only while now i am seeing multiple results of record sets coming.

I have attached the scripts also, the line i described in step1 is

View 9 Replies View Related

Exports To Excel The Details Of The Report But I Need Summary

Sep 25, 2007

The trouble I am having is that I have a drilldown report that exports the detail to Excel, but I want the summary exported to Excel.

I perform the following steps but get wrong results. Please help me identify the correct steps for the correct results. Thanks you.

1) Select Matrix.
2) Right click, select Properties.
3) Select tab Groups.
4) Select item in Columns list, click Edit.
5) Select tab Visibility.
6) Select Initial visibility: Hidden, and click okay to the Grouping and Sorting dialog box.

Now I can export summary to Excel okay, but now I can not expand the summary in the report itself, so I do the following:

7) Do one through six above (but do not close dialog box), then click visibility can be toggled by another report item.
8) Select the report item in the Report Item drop down list.


Now the report functions normally in the Reporting Services report web page, but when I export on the summary level, again it exports the detail to Excel, but what I want it to export is the summary.

Ideas?

View 8 Replies View Related

Last Report Item Or RowNumber For Details Grouping

Apr 26, 2007

I have a report with details grouping on table. What i need to do is put row number only on Parent row and skip the child row. When i use RowNumber("GroupName") of course it gives me a current RowNumber. Is there a way to count only parents?

View 3 Replies View Related

Report Manager And The Show Details Button

Jan 24, 2008

I've read posts that state it is impossible to remove the "Show Details" button on the tool bar in Report Manager.

I created a new role assignment for an individual on a folder with the "Browse" role only.

When that individual navigates to the folder and clicks the "Show Details" button, the "Delete" and "Move" buttons also appear on the tool bar, with a checkbox next to each report item.

I can't have a folder where my users have the ability to delete or move my published reports!

Am I missing a setting? Again, the user has the "Browse" role only on the folder.

Thanks.

View 10 Replies View Related

How Are The Aggregate Details Being Calculated On A Click Through Report?

Jun 27, 2007

Hi -



I need help figuring out what setting I need to tweak to get the correct calculations for the default aggregate attributes for the related entities of the one I am drilling into. Right now it is calculating the total across all for every row and not slicing by sub-customer.

Example:

I have a customer with a one-to-many relationship to incidents. Both have a count aggregate that is part of the default aggregates for the entity. There are 58 rows in my table. If I run a report with CustomerName and #Incidents, I correctly get different sub totals for each customer, totalling to 58 for the grand total. However, if I run a summary report on customers and drill into the customers using click through, the #Incidents is displayed but it is 58 for all customers - every row.



If I go into the defaultDetailAttributes of the Customer and add the #Incidents to it and run the previous test, then the correct number of incidents are shown for the customer, then the incorrect number of incidents follow (from getting the aggregates from the children).



The query generated is huge and I am sure it has something to do with my OptionalMany relationships between the tables, but I can't understand why...



Can anyone help me out?



Thanks in advance,

Toni Fielder

View 2 Replies View Related

To Get Details Of Column Names From An Existing Report

Mar 25, 2008

All,

I want to retrive the column names from an existing report. The report is deployed on the report server and i want to write a code which will list all the column names of the reports along with the properties.

Is there any way i can do this. If so , please let me know. A code sample should help.

Regards..
Girija Shankar

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved