dbTalk Databases Forums  

Creating Excel Report From Dynamic Table

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Creating Excel Report From Dynamic Table in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ngorbunov via SQLMonster.com
 
Posts: n/a

Default Creating Excel Report From Dynamic Table - 04-05-2006 , 10:29 AM






I have a table with the following structure:

Code:
CREATE TABLE [#TEST] ( [sCalldate] [varchar]((20) NULL , [sProject] [varchar] (20) NULL , [dHours] numeric (10,4) NULL) INSERT [#TEST] (sCalldate,sProject, dHours) VALUES ('20060401', 'A', 12) INSERT [#TEST] (sCalldate,sProject, dHours) VALUES ('20060401', 'B', 0) INSERT [#TEST] (sCalldate,sProject, dHours) VALUES ('20060401', 'C', 2) INSERT [#TEST] (sCalldate,sProject, dHours) VALUES ('20060402', 'A', 2) INSERT [#TEST] (sCalldate,sProject, dHours) VALUES ('20060402', 'B', 5) INSERT [#TEST] (sCalldate,sProject, dHours) VALUES ('20060402', 'C', 4) INSERT [#TEST] (sCalldate,sProject, dHours) VALUES ('20060403', 'A', 3) INSERT [#TEST] (sCalldate,sProject, dHours) VALUES ('20060403', 'B', 5) INSERT [#TEST] (sCalldate,sProject, dHours) VALUES ('20060403', 'C', 1)

I need to create an excel report that contains the calldate down the first
column and the projects as cloumn headings across the top with the amount of
hours worked each projects per day.

I created a cross tab table with project codes across the top as columns. One
major issue here is that project codes are created daily. One day I can have
3 next day I can have 5.

So I have the table and the data populated the way I need, but I can't create
the excel spreadsheet in a dts package (this report needs to be run on a
nightly basis).

Can anyone help me? Is there any way of accomplishing this?

Thanks,
Ninel

--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums...r-dts/200604/1

Reply With Quote
  #2  
Old   
Enric
 
Posts: n/a

Default RE: Creating Excel Report From Dynamic Table - 04-05-2006 , 10:42 AM






hi,
Why not?
We've got several dts scheduled by Sql Server Agent on night-to-night basis.
--
Please post DDL, DCL and DML statements as well as any error message in
order to understand better your request. It''s hard to provide information
without seeing the code. location: Alicante (ES)


"ngorbunov via SQLMonster.com" wrote:

Quote:
I have a table with the following structure:

Code:
CREATE TABLE [#TEST] ( [sCalldate] [varchar]((20) NULL , [sProject] [varchar] (20) NULL , [dHours] numeric (10,4) NULL) INSERT [#TEST] (sCalldate,sProject, dHours) VALUES ('20060401', 'A', 12) INSERT [#TEST] (sCalldate,sProject, dHours) VALUES ('20060401', 'B', 0) INSERT [#TEST] (sCalldate,sProject, dHours) VALUES ('20060401', 'C', 2) INSERT [#TEST] (sCalldate,sProject, dHours) VALUES ('20060402', 'A', 2) INSERT [#TEST] (sCalldate,sProject, dHours) VALUES ('20060402', 'B', 5) INSERT [#TEST] (sCalldate,sProject, dHours) VALUES ('20060402', 'C', 4) INSERT [#TEST] (sCalldate,sProject, dHours) VALUES ('20060403', 'A', 3) INSERT [#TEST] (sCalldate,sProject, dHours) VALUES ('20060403', 'B', 5) INSERT [#TEST] (sCalldate,sProject, dHours) VALUES ('20060403', 'C', 1)

I need to create an excel report that contains the calldate down the first
column and the projects as cloumn headings across the top with the amount of
hours worked each projects per day.

I created a cross tab table with project codes across the top as columns. One
major issue here is that project codes are created daily. One day I can have
3 next day I can have 5.

So I have the table and the data populated the way I need, but I can't create
the excel spreadsheet in a dts package (this report needs to be run on a
nightly basis).

Can anyone help me? Is there any way of accomplishing this?

Thanks,
Ninel

--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums...r-dts/200604/1


Reply With Quote
  #3  
Old   
ngorbunov via SQLMonster.com
 
Posts: n/a

Default RE: Creating Excel Report From Dynamic Table - 04-05-2006 , 10:54 AM



I'm sorry, I don't understand.
Did you answer my question?

Enric wrote:
Quote:
hi,
Why not?
We've got several dts scheduled by Sql Server Agent on night-to-night basis.
I have a table with the following structure:

[quoted text clipped - 48 lines]
Thanks,
Ninel
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums...r-dts/200604/1


Reply With Quote
  #4  
Old   
Enric
 
Posts: n/a

Default RE: Creating Excel Report From Dynamic Table - 04-05-2006 , 11:01 AM



hi again ngorbunov,
No exactly, I was thinking aloud. Why you can't do this by dts, day in day
out?

Please post DDL, DCL and DML statements as well as any error message in
order to understand better your request. It''s hard to provide information
without seeing the code. location: Alicante (ES)


"ngorbunov via SQLMonster.com" wrote:

Quote:
I'm sorry, I don't understand.
Did you answer my question?

Enric wrote:
hi,
Why not?
We've got several dts scheduled by Sql Server Agent on night-to-night basis.
I have a table with the following structure:

[quoted text clipped - 48 lines]
Thanks,
Ninel

--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums...r-dts/200604/1


Reply With Quote
  #5  
Old   
ngorbunov via SQLMonster.com
 
Posts: n/a

Default RE: Creating Excel Report From Dynamic Table - 04-05-2006 , 11:10 AM



I created a crosstab table to get data that I need. Looks like this:

Calldate ProjectA ProjectB ProjectC
20060401 5 2 0
20060402 4 5 1

I was trying to create a DTS package to do this, but because the table
structure changes daily (Today I may have up to project C, but tomorrow I may
have project D and projectE as well )

How can I create an excel transformation if the table structure changes?

Enric wrote:
Quote:
hi again ngorbunov,
No exactly, I was thinking aloud. Why you can't do this by dts, day in day
out?

Please post DDL, DCL and DML statements as well as any error message in
order to understand better your request. It''s hard to provide information
without seeing the code. location: Alicante (ES)

I'm sorry, I don't understand.
Did you answer my question?
[quoted text clipped - 7 lines]
Thanks,
Ninel
--
Message posted via http://www.sqlmonster.com


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.