Using StoredProc With Multiple Result(or Datatable) In Server Reports

Sep 17, 2007

Hi guys,

I've been doing some LOCAL reports on my current application until recently there's has been a case that I really need to do SERVER reports.

Usually when I design my local reports, I create a XSD file, so I usually have one dataset with multiple tables in it. I just pass the dataset to report with a single procedure call that returns multiple result sets or data table.

From what I understood server reports are binded to database objects only, like stored procedures. Now I used the same stored procedure that I used in my local report to my server report. But the thing is only the first result set in the stored procedure is recognized. Are there anyway that I can bind the server report to a single stored procedure that return multiple result sets?

Thanks.

View 2 Replies


ADVERTISEMENT

Load Result Sets From Mysqldatareader Into Datatable Or Dataset

Nov 8, 2007

hi all.....
i select some records from my database using mysqldatareader.......but i want to load it's result sets into my datatable or dataset....
is it possible and how can i do it this way ?
thanks

View 1 Replies View Related

Retrieving Multiple Values From One Field In SQL Server For Use In Multiple Columsn In Reports

Mar 30, 2007

I am trying to create a report using Reporting Services.

My problem right now is that the way the table is constructed, I am trying to pull 3 seperate values i.e. One is the number of Hours, One is the type of work, and the 3rd is the Grade, out of one column and place them in 3 seperate columns in the report.

I can currently get one value but how to get the information I need to be able to use in my reports.

So far what I've been working with SQL Reporting Services 2005 I love it and have made several reports, but this one has got me stumped.

Any help would be appreciated.



Thanks.



I might not have made my problem quite clear enough. My table has one column labeled value. The value in that table is linked through an ID field to another table where the ID's are broken down to one ID =Number of Hours, One ID = Grade and One ID= type of work.

What I'm trying to do is when using these ID's and seperate the value related to those ID's into 3 seperate columns in a query for using in Reporting Services to create the report

As you can see, I'm attempting to change the name of the same column 3 times to reflect the correct information and then link them all to the person, where one person might have several entries in the other fields.

As you can see I can change the names individually in queries and pull the information seperately, it's when roll them altogether is where I'm running into my problem

Thanks for the suggestions that were made, I apoligize for not making the problem clearer.

Here is a copy of what I'm attempting to accomplish. I didn't have it with me last night when posting.



--Pulls the Service Opportunity

SELECT cs.value AS "Service Opportunity"

FROM Cstudent cs

INNER JOIN cattribute ca ON ca.attributeid = cs.attributeid

WHERE ca.name = 'Service Opportunity'



--Pulls the Number of Hours

SELECT cs.value AS 'Number of Hours'

FROM Cstudent cs

INNER JOIN cattribute ca ON ca.attributeid =cs.attributeid

WHERE ca.name ='Num of Hours'



--Pulls the Person Grade Level

SELECT cs.value AS 'Grade'

FROM Cstudent cs

INNER JOIN cattribute ca ON ca.attributeid =cs.attributeid

WHERE ca.name ='Grade'



--Pulls the Person Number, First and Last Name and Grade Level

SELECT s.personnumber, s.lastname, s.firstname, cs.value as "Grade"

FROM student s

INNER JOIN cperson cs ON cs.personid = s.personid

INNER JOIN cattribute ca ON ca.attributeid = cs.attributeid

WHERE cs.value =(SELECT cs.value AS 'Grade'

WHERE ca.attributeid = cs.attributeid AND ca.name='Grade')

View 11 Replies View Related

Multiple Datatable Select In C# And Sql?

May 10, 2008

Hello.
I have 2 diffrent tables in the database, is it possible to select both of those back to c# on the same time?
I DONT want to combine the tables, just select them into 2 diffrent datatables in one select statement?
At the moment, i have something like:
function XXOpenDBCon();mCom.Parameters.Clear();mCom.CommandText = "Stuff_GetMovieCategories";myAdap = new SqlDataAdapter();myTable = new DataTable();myAdap.SelectCommand = mCom;myAdap.Fill(myTable);CloseDBCon();return myTable;
Can i ask the database to perhaos retrieve Stuff_GetMovieCategories and on the same time retrieve Stuff_MostViewedMovies?
So the SP does 2 select statements and returns them, i get in the function above 2 datatables with the information, one datatable with Categories and one table with MostViewedMovies.
Is this possible?

View 7 Replies View Related

Multiple Sections In SQL Server Reports..

Nov 15, 2007

Hi,
Am using SQL Server Reporting service to generate reports.Actually i want is a reports containng two sections,How can i achieve that?
Cheers
Jan

View 7 Replies View Related

How To Store Multiple Result In A Variable On Sql Server Stored Procedure

Feb 29, 2008

 name               age            weightaaa                    23                50bbb                    23                60ccc                     22               70ddd                    24                20  eee                     22               30i need the output that calculate the sum of weight group by name input : age limit ex: 22 - 23 output  : age           total weight  23               11022                100  this output must stored in a sql declared variable for some other further process . 

View 7 Replies View Related

How To Set User Who Can't Modify Any StoredProc And Data In Tables But Can Read Data In Tables And Any StoredProc ?

Jul 13, 2007

Please give me advise ครับ
 

View 1 Replies View Related

Filling A DataTable From SqlQuery : If SqlQuery Returns Null Values Problem Ocurrs With DataTable

Sep 3, 2007

Filling a DataTable from SqlQuery : If SqlQuery returns some null values problem ocurrs with DataTable.
Is it possible using DataTable with some null values in it?
Thanks

View 2 Replies View Related

Transact SQL :: Create Email Report Which Gives Result Of Multiple Results From Multiple Databases In Table Format

Jul 24, 2015

I'm trying to create an email report which gives a result of multiple results from multiple databases in a table format bt I'm trying to find out if there is a simple format I can use.Here is what I've done so far but I'm having troble getting into html and also with the database column:

EXEC msdb.dbo.sp_send_dbmail
@subject
= 'Job Summary', 
@profile_name  =
'SQL SMTP',
   
[code]....

View 3 Replies View Related

Oracle StoredProc/Job Running At SQL Server?

Feb 5, 2003

Hi,
Is it possible Oracle Stored Proc or Jobs able to schedule in sql job?.
Thanks,
Ravi

View 3 Replies View Related

Multiple Row Result Concatenation

Oct 5, 2004

Table1
ID,Description
1,"Vowels"
2,"Others"

Table2
ID,Table1ID,Letter
1,1,"A"
2,2,"L"
3,2,"K"
4,1,"U"
5,1,"E"
6,2,"G"
7,1,"I"

How can I query the two tables to come up with a resulting table of:

ID,Description,Letter
1,"Vowels","A, U, E, I"
2,"Others","L, K, G"

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 Reports

Dec 20, 2007

Hi Friends,

How do I display a bar graph in my main report? I dont want it to be displayed on separate page. When I click on some entities on my main report, a graph should be popped up in the same report in some corner? how do I do that ? Please let me know.

Thanks & Regards
Naveen J V

View 3 Replies View Related

Multiple Reports

Apr 23, 2007

Hi all,

I have created a report that everyone is happy with.
My dataset (simplified) looks like this:
SELECT *
FROM FamilyMember
WHERE QuestionnaireID = @QuestionnaireID

Now, instead of running individual reports the users want to run several reports on a list of QuestionnaireID's.
I thought something like this would work:
SELECT *
FROM FamilyMember
WHERE QuestionnaireID IN (@QuestionnaireID)
but RS complains about converting '152,153' to an INT.

Is there a way to accomplish this?
I am guessing I need to convert the nvarchar @QuestionnaireID to a real list of INTs but am unsure how to do this...

View 9 Replies View Related

Multiple Column Result From One Table

Jul 20, 2005

Hi,I have a table like this :TimeIDApplicationLoginState1App1login101App2login211App3login311App1login401App1login511App4login102App1login102App2login202App3login312App1login402App1login512App4login103App1login103App2login213App3login313App1login403App1login513App4login10And I want a result like thisTimeID (state=0) (state=1)1 3 32 4 23 3 3I use this code :set nocount ondeclare @timeid1 intdeclare @timeid2 intdeclare @timeid intdeclare @sessionstate intdeclare @count1 intdeclare @count2 intdeclare @count intdeclare @aux intdeclare txt_cursor cursor forselect timeid, sessionstate , count(login) from metromasterwhere sessionstate = 0group by timeid, sessionstateUNIONselect timeid, sessionstate , count(login) from metromasterwhere sessionstate = 1group by timeid, sessionstateorder by timeidopen txt_cursorselect @aux = 0fetch next from txt_cursor into @timeid, @sessionstate, @countwhile (@@fetch_status = 0)beginif @aux = 0beginselect @timeid1 = @timeidselect @count1 = @countselect @aux =1endelsebeginselect @timeid2 = @timeidselect @count2 = @countselect @aux = 2endif @aux = 2begin--select @timeid1, @count1, @sessionstate, @count2, @timeid2select @timeid1, @count1, @count2select @aux = 0endfetch next from txt_cursor into@timeid, @sessionstate, @countendclose txt_cursordeallocate txt_cursorset nocount offBut it create a lot of blank row and field header.Does anyone know an other methode ??Thanks.

View 1 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

Putting Data From DataTable/DataSet Into SQL Server Table?

May 5, 2005

Hello,
I created this DataTable, add rows of data to it, and then display the data on to a form via a repeater.
Dim ds As DataSet = New DataSetDim dtTableName As DataTable = New DataTable("dtTableName") dtTableName.Columns.Add("Description")dtTableName.Columns.Add("ItemNumber")dtTableName.Columns.Add("Quantity")dtTableName.Columns.Add("Price")ds.Tables.Add(dtTableName)
What I need to do now is create a table in SQL Server and update the database with the data I've collect in my dataset. How do I bind and update this data to a sql server table?
Thanks!James

View 1 Replies View Related

Problem With Nested DataTable In Server-side ADOMD.NET SP

Jan 7, 2008

Hi, I have a server-side stored procedure that I created in C#. The SP issues one DMX statement (within the implicit connection) which has a prediction join with SHAPE/APPEND. It then tries to map the results of the AdomdDataReaders to System.Data.DataTable objects, returning one System.Data.DataTable object. Because of the SHAPE/APPEND, I end up with two nested AdomdDataReaders.




Code Block

using Microsoft.AnalysisServices.AdomdServer;

using System.Data;


...


public DataTable VivaOMengoSP()
{
AdomdCommand c = new AdomdCommand(CreatePredictedDMX());


// select ... prediction join ... shape ... append



DataTable dt = new DataTable();
dt.Columns.Add("att1", typeof(string));
dt.Columns.Add("att2", typeof(int));
dt.Columns.Add("predictednestedmonster", typeof(DataTable));

object[] row = new object[3];
try
{
AdomdDataReader dr = c.ExecuteReader();
while (dr.Read())
{
DataTable innerdt = new DataTable();
innerdt.Columns.Add("inneratt1", typeof(int));
innerdt.Columns.Add("inneratt2", typeof(string));

row[0] = dr[0];
row[1] = dr[1];
AdomdDataReader innerdr = (AdomdDataReader)dr[2];
object[] innerrow = new object[2];
while (innerdr.Read())
{
innerrow[0] = innerdr[0];
innerrow[1] = innerdr[1];
innerdt.Rows.Add(innerrow);
}
row[2] = innerdt;
dt.Rows.Add(row);
}
dr.Close();
return dt;
}
catch
{
return null;
}
}
(The code is a modification to listing 20-3, page 807, of the book "Programming Microsoft SQL Server 2005" by Brust & Forte)

I call it directly in SSMS and I get this result:

Executing the query ...
Execution of the managed stored procedure VivaOMengoSP failed with the following error: Microsoft::AnalysisServices::AdomdServer::AdomdException.
Errors in the high-level relational engine. The System.Data.DataTable type is not supported by Analysis Services code name "Katmai".

Execution complete

Is it possible to have nested table as a SP result? Is DataTable the appropriate class?

Thanks,
Gustavo Frederico

View 4 Replies View Related

Comparison Of SQL Server Reporting Services To Access Reports, Crystal Reports, Cognos Or Other Options

Nov 5, 2007

Hello SQL Server Experts, Data Analysts, and Report Writers et al:

re: Reporting Options with SQL Server

I wanted to propose an offshoot to the pryor thread:

Would anyone take a stab at comparing Access Reports, Crystal Reports,
Cognos or other options to all the Reporting Services and its components offered as part ofSQL Server, especially as to extracting data from SQL Server into a report format?

I guess this is a far as capabilites, ease of use, limitations, and especially formatting
or presentation of the end report product?

Thank you to all, and I hope this is a beneficial discussion to others.

Hal1490



Hal9000

View 4 Replies View Related

Ad Hoc Reports Multiple Tables

Aug 21, 2007

HI,
i am a new to SSRS and i am facing a problem with Ad Hoc reporting.
actually i wanted to create a report with data from two different table. now its the relation between these two tables that is not allowing me to create a req. adhoc report.

i want the report to have data from table A and table B and the relationship between A and B is many-to-many. so in the database design i have an associate table C between A and B. so in .dsv file i have C related to A as one-to-many and C related to B as one to many.

Now here how do i get data from both table A and table B?

View 1 Replies View Related

Generating Multiple Reports

Sep 25, 2007



I have a report that I pass parameters of a clientID. I run the report and export it to a .pdf file. I would like to be able to do this for multiple clients without manually having to enter the ID each time and exporting it.

I have thought about creating a report that calls this report so that I can pass in the clientID one at a time. The problem is trying to export each one.

Does anyone have any ideas? Thanks in advance!

View 2 Replies View Related

Sharing Multiple Reports

Oct 30, 2007

Hi,


Can we share and schedule whole report folder(not just one report) by using management studio?

Thanks

View 1 Replies View Related

Getting Reports On Multiple Pages

Jan 4, 2008

I have a data set which has more than one record. Iam tyring to create a report without using the wizard. I want the report on multiple pages. I dragged some text boxes on to the design and added the expressions in there. If I run the program now Iam only getting the report with the last record. How do I get the report for all the records in the Dataset on multiple pages ? . I want each record on one page. I am forsure getting more than one record into the Dataset.


Thanks in advace for the help

View 2 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

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

Remove All Reports ( Not Data Sources) From Reports Server

Jan 23, 2007

Hi does anyone know how to do the above with out going through reportserver url?

Preferably by using a cmd tool ? such rs.exe

or through the backend in the reportserver DB?

Thanks

Dave

View 2 Replies View Related

Code For Multiple Reports Deployment

Nov 5, 2007



Hi,

I have created bunch of reports using SSRS. Now I want to deliver all of these reports together. I can use data driven subscription in Report Manager. But that feature allows to deliver one report at a time. Can anyone tell me how to deliver all reports together?
Requirement is reports should be delivered to dirrent departments. These reports have parameterized. Can anyone tell me how to do this? at least if somebody provides sample codes I really appriciate.

Thanks

p/s ;

I found this one on MSDN. But I'm not sure whether I can change this and use for multiple reports subscription. I dont hv a good knowledge on C# or VB. Please can anyone help me to modify this? I think we can use a loop or smthing.

http://msdn2.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsmanagementservice2005.reportingservice2005.createdatadrivensubscription.aspx

View 4 Replies View Related

Sharing A Dataset In Multiple Reports?

Sep 26, 2007

I'm looking for some advice on how to manage reports that use the same query in their datasets. I have multiple reports that use several datasets that are the same. If I need to make a change to one dataset, I need to remember to update the other datasets. Of course I don't always remember to do that!

Is there a way to create a dataset in a single location and then share it? I was thinking of using a View but I don't think it'll accept the parameters.

I've been cutting & pasting the entire query as I make change but I'm afraid it'll mess that up or forget to update a dataset.

How do you do it?


Any suggestions you have would be helpful.

Rob

View 7 Replies View Related

Executing Multiple Simultaneous Reports

Oct 15, 2007

Is there a way to get the Report Manager to allow a single user to
execute more than 1 report at a time? Currently, each user can only
have a single report being executed at a time. It looks like any
other reports are being queued and executed serially.

View 1 Replies View Related

Reports Based On Multiple Databases

Oct 23, 2007

I'm new to developing reports using 2005 SQL Reporting Services. Is it possible to develop reports based on more than one database, (generally MS SQL)? I need to set up a dataset that includes tables from several different databases linked together so that information can be viewed together in one report.
thanks

View 9 Replies View Related

How To Execute Multiple Reports With The Same Parameter

Mar 29, 2007

We have timed-based subscriptions set up for our standard set of 10 client
reports which run monthly with the appropriate parameters set for each
of our clients. Our management has requested that we provide them with
the ability to run the set of 10 reports together at will. So we would
provide the client parameter and all 10 reports would be generated.
What is the recommended approach to accomplish this? We are using Sql
Server 2005, Visual Studio 2003 and .Net 2.0.

View 1 Replies View Related

Stock Age Query To Accept Multiple Rows As A Result

Jan 22, 2014

I worked with someone else to create a query that gives us the age of a stock. How long it has been in the warehouse since the Purchase order date (without completely selling out). It does exactly what I want, the problem is that it only accepts 1 row as a result.

The error message I get is:

quote:Msg 512, Level 16, State 1, Line 4

Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

So my question is; can this code be modified to pass it multiple SKUS and run a report on every item currently in stock?

SELECT TOP 1
@skuVar, CAST(GETDATE()-ReceivedOn AS INT) AS 'Age'
FROM
(SELECT pir.id AS id,aggregateQty AS aggregateQty,-qtyreceived as qtyreceived, (aggregateQty - qtyreceived) AS Diff, ReceivedOn AS ReceivedOn
,(
SELECT SUM (PurchaseItemReceive.qtyreceived)
FROM bvc_product pp

[code].....

I use Microsoft SQL 2008

View 1 Replies View Related







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