Showing posts with label report. Show all posts
Showing posts with label report. Show all posts

Tuesday, March 27, 2012

Creating a View help

i have a table which has 2 columns 1 'report' 2 'part'

now in my 'report' cloumn i have # with 6 digits ex. '111111' and 'part' has '1, 2, 3, 4,..to 50'

i want to create a view that will put them together in format like this:

1111110001

1111110002

1111110003 .. and on

it needs to be in 10 digits.

is there anyway i can create a View or may be a column in the table which can create the #'s in this format.

Try this:

SELECTRIGHT('00000'+Convert(nvarchar(6),[report]),6)+RIGHT('00000'+CAST([part]asNvarchar(6)), 4)AS TenDigitsString

FROM CAG

|||

Thanx limno ur example worked out.

Sunday, March 25, 2012

Creating a template

Can anybody help me how to create a template report i SQL Reporting Services 2005

Masi,

Create a SQL sample report of what you want your templete to be and then copy the rdl from to this local directory C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\ProjectItems\ReportProject

all rdl files in this directory show up when you add new item in BIDS.

Hammer

|||

Thanks

It works

|||Not a problem.

creating a template

Hi Guys
I have developed a new report in reporting services 2005. now i want to
use this report as a template. Where do i store this report in sql
server sub directory so that it is available in the template option
whenever i try to create a new report.
Any help would be great.
PassxSearch for "report.rdl" or report project in your HDD. Because I dont
remember the exact directory infact i have done it lot of times. or may be
just right click on the report and see the property, so that you can get
complete directory.
Amarnath
"Passx" wrote:
> Hi Guys
> I have developed a new report in reporting services 2005. now i want to
> use this report as a template. Where do i store this report in sql
> server sub directory so that it is available in the template option
> whenever i try to create a new report.
> Any help would be great.
>
> Passx
>|||Hi
I tried doing the same thing but was not able to find it. Found one in
vs8 folder. But when i placed my report in that folder was not able to
find that in the report template menu.
Any help would be great.
Passx
Amarnath wrote:
> Search for "report.rdl" or report project in your HDD. Because I dont
> remember the exact directory infact i have done it lot of times. or may be
> just right click on the report and see the property, so that you can get
> complete directory.
> Amarnath
> "Passx" wrote:
> > Hi Guys
> >
> > I have developed a new report in reporting services 2005. now i want to
> > use this report as a template. Where do i store this report in sql
> > server sub directory so that it is available in the template option
> > whenever i try to create a new report.
> >
> > Any help would be great.
> >
> >
> > Passx
> >
> >

Thursday, March 22, 2012

Creating a Table Of Contents

I would like to create a table of contents on the first page in a report I'm working on. I've been looking around for a couple of days now and have come up with nothing. I'm wondering if I can hook into the document map to create a custom TOC, if not how else might I be able to do this. I'm currently using the June CTP. Any help would be appreciated.
Thanks,
Brian Schmidt

Did you find a solution? I am also interested in creating a TOC to be printed from PDF.

Do you know if Reporting Services for SQL Server 2005 has the functionality to create a Table of Contents in a report?

Thanks,

Toby

|||Did not find a solution - the answer seems to be that you can't do it without running the report twice (once to create the pagination, then again to put the toc in (which hypothetically could change the pagination)), and write some custom specific code to put the toc in the doc.

I ended up just making sure there were bookmarks where I needed them so that you could at least jump to parts using the bookmark feature of acrobat reader. Works pretty well as long as the user reads the report interactively online. Not so good for a printed hardcopy.|||I am very new to SQL Reporting and would like to create a table of contents. You reference that you are currently using the June CTP. Could you please elaborate? Any help is greatly appreciated. It seems the table of contents is not very easy to automate. Thanks again!|||

Reporting Services does not support a table of contents for a report.

You can work around using a little trickery: You can add a query to your report that returns all of your group names and the number of rows for each group. Then design your report to include only a certain number of lines on a physical page. Then you would be able to carefully craft a report that shows a table at the beginning with the group names and an expected page number. Of course the page number would be dependent on the size of paper you're printing on. Not an ideal solution but it would get the job done.

As a previous post said, you can generally get around this by using the Document Map feature of the report. It works great interactively and is included when exporting to PDF.

Hope that helps,

-Lukasz

|||

Wouldn't putting together an index at the end of the report be easier and work better? I have a large order guide that I am working on via Reporting Services, and I have come to the conclusion that an index might be easier to implement. If I get it to work decently, I'll post an explanation, if desired.

What I think it can boil down to is supressing the page numbers in the footer (or header) after the "main" report, and after everything is hardcopy, move the un-numbered index to the front to work as a table of contents.

Thanks!

Curtis

|||

This is how I overcame my Table of contents issue. I used the following code in my SELECT statement. This allowed me to determine what page x item will be on. I do not know if this will be a fix all for everyone interested, but it worked well for me!

SELECT

,...

, ROW_NUMBER() OVER (ORDER BY P.PRODLINE, P.PRODCLASS, P.PRODDESC) AS ROWNUMBER

, ((ROW_NUMBER() OVER (ORDER BY P.PRODLINE, P.PRODCLASS, P.PRODDESC)) / 50) + 4 AS PAGENUMBER

...

I determined my table of contents will always be three pages, and I know that I have fifty rows per page. I have run my 200+ page report and compared random sections in my TOC to my report, and I found it was accurate. If there are any questions, please feel free to ask. I would be more than happy to clarify if it is necessary.

|||

I have been working on this table of content thing for a week now. I have somehow found a solution for that. You can write an assembly containing a function which would take 2 paramenters the page number and your group name (Which needs to be on the table of contents) and write them to an xml file or a database table. Once you are done with the assembly you can reference that assembly in you rdl file and pass that the page number and the current group on the page to that function. You will have a complete table of contents in form of an xml or database table whatever you select.

I have done this so far and now only thing left is to display that TOC on the original report again. I m wroking on it... so far this is what i tried... i added my TOC data set to a new report and made my original report a sub report in that report. Now there are 2 issues. (1) The sub report wont show the page numbers. (2) I will have to run the subreport once before the main report so that it writes the TOC values to the xml file or table which can be accessed then in the main report. I think it can be done on windows form or a web form to call that subreport as an independent report somehow hidden from user, but i would be more interested to do all this stuff from the report if possible.

Any body have some better idea to overcome the problems which i m facing.

Thanx!

Creating a Table Of Contents

I would like to create a table of contents on the first page in a report I'm working on. I've been looking around for a couple of days now and have come up with nothing. I'm wondering if I can hook into the document map to create a custom TOC, if not how else might I be able to do this. I'm currently using the June CTP. Any help would be appreciated.
Thanks,
Brian Schmidt

Did you find a solution? I am also interested in creating a TOC to be printed from PDF.

Do you know if Reporting Services for SQL Server 2005 has the functionality to create a Table of Contents in a report?

Thanks,

Toby

|||Did not find a solution - the answer seems to be that you can't do it without running the report twice (once to create the pagination, then again to put the toc in (which hypothetically could change the pagination)), and write some custom specific code to put the toc in the doc.

I ended up just making sure there were bookmarks where I needed them so that you could at least jump to parts using the bookmark feature of acrobat reader. Works pretty well as long as the user reads the report interactively online. Not so good for a printed hardcopy.|||I am very new to SQL Reporting and would like to create a table of contents. You reference that you are currently using the June CTP. Could you please elaborate? Any help is greatly appreciated. It seems the table of contents is not very easy to automate. Thanks again!|||

Reporting Services does not support a table of contents for a report.

You can work around using a little trickery: You can add a query to your report that returns all of your group names and the number of rows for each group. Then design your report to include only a certain number of lines on a physical page. Then you would be able to carefully craft a report that shows a table at the beginning with the group names and an expected page number. Of course the page number would be dependent on the size of paper you're printing on. Not an ideal solution but it would get the job done.

As a previous post said, you can generally get around this by using the Document Map feature of the report. It works great interactively and is included when exporting to PDF.

Hope that helps,

-Lukasz

|||

Wouldn't putting together an index at the end of the report be easier and work better? I have a large order guide that I am working on via Reporting Services, and I have come to the conclusion that an index might be easier to implement. If I get it to work decently, I'll post an explanation, if desired.

What I think it can boil down to is supressing the page numbers in the footer (or header) after the "main" report, and after everything is hardcopy, move the un-numbered index to the front to work as a table of contents.

Thanks!

Curtis

|||

This is how I overcame my Table of contents issue. I used the following code in my SELECT statement. This allowed me to determine what page x item will be on. I do not know if this will be a fix all for everyone interested, but it worked well for me!

SELECT

,...

, ROW_NUMBER() OVER (ORDER BY P.PRODLINE, P.PRODCLASS, P.PRODDESC) AS ROWNUMBER

, ((ROW_NUMBER() OVER (ORDER BY P.PRODLINE, P.PRODCLASS, P.PRODDESC)) / 50) + 4 AS PAGENUMBER

...

I determined my table of contents will always be three pages, and I know that I have fifty rows per page. I have run my 200+ page report and compared random sections in my TOC to my report, and I found it was accurate. If there are any questions, please feel free to ask. I would be more than happy to clarify if it is necessary.

|||

I have been working on this table of content thing for a week now. I have somehow found a solution for that. You can write an assembly containing a function which would take 2 paramenters the page number and your group name (Which needs to be on the table of contents) and write them to an xml file or a database table. Once you are done with the assembly you can reference that assembly in you rdl file and pass that the page number and the current group on the page to that function. You will have a complete table of contents in form of an xml or database table whatever you select.

I have done this so far and now only thing left is to display that TOC on the original report again. I m wroking on it... so far this is what i tried... i added my TOC data set to a new report and made my original report a sub report in that report. Now there are 2 issues. (1) The sub report wont show the page numbers. (2) I will have to run the subreport once before the main report so that it writes the TOC values to the xml file or table which can be accessed then in the main report. I think it can be done on windows form or a web form to call that subreport as an independent report somehow hidden from user, but i would be more interested to do all this stuff from the report if possible.

Any body have some better idea to overcome the problems which i m facing.

Thanx!

sql

Creating a Table Of Contents

I would like to create a table of contents on the first page in a report I'm working on. I've been looking around for a couple of days now and have come up with nothing. I'm wondering if I can hook into the document map to create a custom TOC, if not how else might I be able to do this. I'm currently using the June CTP. Any help would be appreciated.
Thanks,
Brian Schmidt

Did you find a solution? I am also interested in creating a TOC to be printed from PDF.

Do you know if Reporting Services for SQL Server 2005 has the functionality to create a Table of Contents in a report?

Thanks,

Toby

|||Did not find a solution - the answer seems to be that you can't do it without running the report twice (once to create the pagination, then again to put the toc in (which hypothetically could change the pagination)), and write some custom specific code to put the toc in the doc.

I ended up just making sure there were bookmarks where I needed them so that you could at least jump to parts using the bookmark feature of acrobat reader. Works pretty well as long as the user reads the report interactively online. Not so good for a printed hardcopy.|||I am very new to SQL Reporting and would like to create a table of contents. You reference that you are currently using the June CTP. Could you please elaborate? Any help is greatly appreciated. It seems the table of contents is not very easy to automate. Thanks again!|||

Reporting Services does not support a table of contents for a report.

You can work around using a little trickery: You can add a query to your report that returns all of your group names and the number of rows for each group. Then design your report to include only a certain number of lines on a physical page. Then you would be able to carefully craft a report that shows a table at the beginning with the group names and an expected page number. Of course the page number would be dependent on the size of paper you're printing on. Not an ideal solution but it would get the job done.

As a previous post said, you can generally get around this by using the Document Map feature of the report. It works great interactively and is included when exporting to PDF.

Hope that helps,

-Lukasz

|||

Wouldn't putting together an index at the end of the report be easier and work better? I have a large order guide that I am working on via Reporting Services, and I have come to the conclusion that an index might be easier to implement. If I get it to work decently, I'll post an explanation, if desired.

What I think it can boil down to is supressing the page numbers in the footer (or header) after the "main" report, and after everything is hardcopy, move the un-numbered index to the front to work as a table of contents.

Thanks!

Curtis

|||

This is how I overcame my Table of contents issue. I used the following code in my SELECT statement. This allowed me to determine what page x item will be on. I do not know if this will be a fix all for everyone interested, but it worked well for me!

SELECT

,...

, ROW_NUMBER() OVER (ORDER BY P.PRODLINE, P.PRODCLASS, P.PRODDESC) AS ROWNUMBER

, ((ROW_NUMBER() OVER (ORDER BY P.PRODLINE, P.PRODCLASS, P.PRODDESC)) / 50) + 4 AS PAGENUMBER

...

I determined my table of contents will always be three pages, and I know that I have fifty rows per page. I have run my 200+ page report and compared random sections in my TOC to my report, and I found it was accurate. If there are any questions, please feel free to ask. I would be more than happy to clarify if it is necessary.

|||

I have been working on this table of content thing for a week now. I have somehow found a solution for that. You can write an assembly containing a function which would take 2 paramenters the page number and your group name (Which needs to be on the table of contents) and write them to an xml file or a database table. Once you are done with the assembly you can reference that assembly in you rdl file and pass that the page number and the current group on the page to that function. You will have a complete table of contents in form of an xml or database table whatever you select.

I have done this so far and now only thing left is to display that TOC on the original report again. I m wroking on it... so far this is what i tried... i added my TOC data set to a new report and made my original report a sub report in that report. Now there are 2 issues. (1) The sub report wont show the page numbers. (2) I will have to run the subreport once before the main report so that it writes the TOC values to the xml file or table which can be accessed then in the main report. I think it can be done on windows form or a web form to call that subreport as an independent report somehow hidden from user, but i would be more interested to do all this stuff from the report if possible.

Any body have some better idea to overcome the problems which i m facing.

Thanx!

Creating a Table Of Contents

I would like to create a table of contents on the first page in a report I'm working on. I've been looking around for a couple of days now and have come up with nothing. I'm wondering if I can hook into the document map to create a custom TOC, if not how else might I be able to do this. I'm currently using the June CTP. Any help would be appreciated.
Thanks,
Brian Schmidt

Did you find a solution? I am also interested in creating a TOC to be printed from PDF.

Do you know if Reporting Services for SQL Server 2005 has the functionality to create a Table of Contents in a report?

Thanks,

Toby

|||Did not find a solution - the answer seems to be that you can't do it without running the report twice (once to create the pagination, then again to put the toc in (which hypothetically could change the pagination)), and write some custom specific code to put the toc in the doc.

I ended up just making sure there were bookmarks where I needed them so that you could at least jump to parts using the bookmark feature of acrobat reader. Works pretty well as long as the user reads the report interactively online. Not so good for a printed hardcopy.|||I am very new to SQL Reporting and would like to create a table of contents. You reference that you are currently using the June CTP. Could you please elaborate? Any help is greatly appreciated. It seems the table of contents is not very easy to automate. Thanks again!|||

Reporting Services does not support a table of contents for a report.

You can work around using a little trickery: You can add a query to your report that returns all of your group names and the number of rows for each group. Then design your report to include only a certain number of lines on a physical page. Then you would be able to carefully craft a report that shows a table at the beginning with the group names and an expected page number. Of course the page number would be dependent on the size of paper you're printing on. Not an ideal solution but it would get the job done.

As a previous post said, you can generally get around this by using the Document Map feature of the report. It works great interactively and is included when exporting to PDF.

Hope that helps,

-Lukasz

|||

Wouldn't putting together an index at the end of the report be easier and work better? I have a large order guide that I am working on via Reporting Services, and I have come to the conclusion that an index might be easier to implement. If I get it to work decently, I'll post an explanation, if desired.

What I think it can boil down to is supressing the page numbers in the footer (or header) after the "main" report, and after everything is hardcopy, move the un-numbered index to the front to work as a table of contents.

Thanks!

Curtis

|||

This is how I overcame my Table of contents issue. I used the following code in my SELECT statement. This allowed me to determine what page x item will be on. I do not know if this will be a fix all for everyone interested, but it worked well for me!

SELECT

,...

, ROW_NUMBER() OVER (ORDER BY P.PRODLINE, P.PRODCLASS, P.PRODDESC) AS ROWNUMBER

, ((ROW_NUMBER() OVER (ORDER BY P.PRODLINE, P.PRODCLASS, P.PRODDESC)) / 50) + 4 AS PAGENUMBER

...

I determined my table of contents will always be three pages, and I know that I have fifty rows per page. I have run my 200+ page report and compared random sections in my TOC to my report, and I found it was accurate. If there are any questions, please feel free to ask. I would be more than happy to clarify if it is necessary.

|||

I have been working on this table of content thing for a week now. I have somehow found a solution for that. You can write an assembly containing a function which would take 2 paramenters the page number and your group name (Which needs to be on the table of contents) and write them to an xml file or a database table. Once you are done with the assembly you can reference that assembly in you rdl file and pass that the page number and the current group on the page to that function. You will have a complete table of contents in form of an xml or database table whatever you select.

I have done this so far and now only thing left is to display that TOC on the original report again. I m wroking on it... so far this is what i tried... i added my TOC data set to a new report and made my original report a sub report in that report. Now there are 2 issues. (1) The sub report wont show the page numbers. (2) I will have to run the subreport once before the main report so that it writes the TOC values to the xml file or table which can be accessed then in the main report. I think it can be done on windows form or a web form to call that subreport as an independent report somehow hidden from user, but i would be more interested to do all this stuff from the report if possible.

Any body have some better idea to overcome the problems which i m facing.

Thanx!

Creating a Table Of Contents

I would like to create a table of contents on the first page in a report I'm working on. I've been looking around for a couple of days now and have come up with nothing. I'm wondering if I can hook into the document map to create a custom TOC, if not how else might I be able to do this. I'm currently using the June CTP. Any help would be appreciated.
Thanks,
Brian Schmidt

Did you find a solution? I am also interested in creating a TOC to be printed from PDF.

Do you know if Reporting Services for SQL Server 2005 has the functionality to create a Table of Contents in a report?

Thanks,

Toby

|||Did not find a solution - the answer seems to be that you can't do it without running the report twice (once to create the pagination, then again to put the toc in (which hypothetically could change the pagination)), and write some custom specific code to put the toc in the doc.

I ended up just making sure there were bookmarks where I needed them so that you could at least jump to parts using the bookmark feature of acrobat reader. Works pretty well as long as the user reads the report interactively online. Not so good for a printed hardcopy.|||I am very new to SQL Reporting and would like to create a table of contents. You reference that you are currently using the June CTP. Could you please elaborate? Any help is greatly appreciated. It seems the table of contents is not very easy to automate. Thanks again!|||

Reporting Services does not support a table of contents for a report.

You can work around using a little trickery: You can add a query to your report that returns all of your group names and the number of rows for each group. Then design your report to include only a certain number of lines on a physical page. Then you would be able to carefully craft a report that shows a table at the beginning with the group names and an expected page number. Of course the page number would be dependent on the size of paper you're printing on. Not an ideal solution but it would get the job done.

As a previous post said, you can generally get around this by using the Document Map feature of the report. It works great interactively and is included when exporting to PDF.

Hope that helps,

-Lukasz

|||

Wouldn't putting together an index at the end of the report be easier and work better? I have a large order guide that I am working on via Reporting Services, and I have come to the conclusion that an index might be easier to implement. If I get it to work decently, I'll post an explanation, if desired.

What I think it can boil down to is supressing the page numbers in the footer (or header) after the "main" report, and after everything is hardcopy, move the un-numbered index to the front to work as a table of contents.

Thanks!

Curtis

|||

This is how I overcame my Table of contents issue. I used the following code in my SELECT statement. This allowed me to determine what page x item will be on. I do not know if this will be a fix all for everyone interested, but it worked well for me!

SELECT

,...

, ROW_NUMBER() OVER (ORDER BY P.PRODLINE, P.PRODCLASS, P.PRODDESC) AS ROWNUMBER

, ((ROW_NUMBER() OVER (ORDER BY P.PRODLINE, P.PRODCLASS, P.PRODDESC)) / 50) + 4 AS PAGENUMBER

...

I determined my table of contents will always be three pages, and I know that I have fifty rows per page. I have run my 200+ page report and compared random sections in my TOC to my report, and I found it was accurate. If there are any questions, please feel free to ask. I would be more than happy to clarify if it is necessary.

|||

I have been working on this table of content thing for a week now. I have somehow found a solution for that. You can write an assembly containing a function which would take 2 paramenters the page number and your group name (Which needs to be on the table of contents) and write them to an xml file or a database table. Once you are done with the assembly you can reference that assembly in you rdl file and pass that the page number and the current group on the page to that function. You will have a complete table of contents in form of an xml or database table whatever you select.

I have done this so far and now only thing left is to display that TOC on the original report again. I m wroking on it... so far this is what i tried... i added my TOC data set to a new report and made my original report a sub report in that report. Now there are 2 issues. (1) The sub report wont show the page numbers. (2) I will have to run the subreport once before the main report so that it writes the TOC values to the xml file or table which can be accessed then in the main report. I think it can be done on windows form or a web form to call that subreport as an independent report somehow hidden from user, but i would be more interested to do all this stuff from the report if possible.

Any body have some better idea to overcome the problems which i m facing.

Thanx!

Creating a suscription on a parameterized report

I have a report that I just created that has a month and year parameter.
this report is needed at the first of every month to show the activity of
previous month. I would like to create a subscription that executes this
report automatically. Can I set up reporting services to automatically run
the subscription based on the previous month and year each first of the
month?This can be achieved by setting the parameters non-queried default values to
something liek this
=Today.AddMonths(-1)
This will grab todays date (execution date) and add a negative month. you
can do AddDays and AddYears...
for the start date and
"Aaronous" <aaronous@.hotmail.com> wrote in message
news:%230afyX%23DFHA.3928@.TK2MSFTNGP15.phx.gbl...
>I have a report that I just created that has a month and year parameter.
>this report is needed at the first of every month to show the activity of
>previous month. I would like to create a subscription that executes this
>report automatically. Can I set up reporting services to automatically run
>the subscription based on the previous month and year each first of the
>month?
>|||I have been using:
=Today.AddDays(-1)
The result is on the first day of the month, the default parameter is the
previous month. After that, it uses the current month. When I first started
doing this, I used iif(Day(Today()=1) & Hour(Now())<6, Today.AddDays(-1),
Today()). This assumed that the monthly subscriptions ran before 6am on the
1st of the month. I now assume that if somebody wants to look at a monthly
report on the 1st, they really want to see the last month.
"Joseph Scalise" wrote:
> This can be achieved by setting the parameters non-queried default values to
> something liek this
> =Today.AddMonths(-1)
> This will grab todays date (execution date) and add a negative month. you
> can do AddDays and AddYears...
> for the start date and
> "Aaronous" <aaronous@.hotmail.com> wrote in message
> news:%230afyX%23DFHA.3928@.TK2MSFTNGP15.phx.gbl...
> >I have a report that I just created that has a month and year parameter.
> >this report is needed at the first of every month to show the activity of
> >previous month. I would like to create a subscription that executes this
> >report automatically. Can I set up reporting services to automatically run
> >the subscription based on the previous month and year each first of the
> >month?
> >
>
>

creating a subscription via an application

Hello,

I am wondering if there is some sample code out there that shows how to create a subscription for a report on reporting services via a win app or if anyone has a better suggestion. We are wanting to have a report that resides on reporting services server be sent to a client via email subscription, but do not want the client to goto the actual website that host reporting services. Thanks in advance.

John

There are SOAP APIs that lets you create subscriptions programmatically. Is that what you are looking for? See the following link for details.

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

Thanks,

Sharmila

|||This was it. Thank you!!

Creating a Stored Procedure that will summarize data in a table into a table reflecting period d

I am attempting to create a stored procedure that will launch at report runtime to summarize data in a table into a table that will reflect period data using an array type field. I know how to execute one line but I am not sure how to run the script so that it not only summarizes the data below but also creates and drops the table.

Any help would be greatly appreciated.

Current Table

Project | Task | Category | Fiscal Year | Fiscal Month | Total Hours

Proj 1 | Task 1 | Cat 1 | 2007 | 01 | 40

Proj 1 | Task 1 | Cat 2 | 2007 | 02 | 20

Proj 1 | Task 1 | Cat 3 | 2007 | 03 | 35

Proj 1 | Task 1 | Cat 1 | 2008 | 01 | 40

Proj 1 | Task 1 | Cat 2 | 2008 | 02 | 40

Proj 1 | Task 1 | Cat 3 | 2008 | 03 | 40

Proposed Table

Project | Task | Category | Fiscal Month 01 | Fiscal Month 02 | Fiscal Month 03 | Fiscal Year

Proj 1 | Task 1 | Cat 1 | 40 | 0 | 0 | 2007

Proj 1 | Task 1 | Cat 2 | 0 | 20 | 0 | 2007

Proj 1 | Task 1 | Cat 3 | 0 | 0 | 35 | 2007

Proj 1 | Task 1 | Cat 1 | 40 | 0 | 0 | 2008

Proj 1 | Task 1 | Cat 2 | 0 | 40 | 0 | 2008

Proj 1 | Task 1 | Cat 3 | 0 | 0 | 40 | 2008

Thanks,

Mike Misera

Check out the PIVOT operator

|||

Mike, check out this sample script. You would need a case statement for each month, this is just using one for each month supplied in the example.

Code Snippet

CREATE TABLE #currentTable (

Project NVARCHAR(10),

Task NVARcHAR(10),

Category NVARcHAR(10),

FiscalYear INT,

FiscalMonth INT,

TotalHours INT

)

INSERT INTO #currentTable VALUES ('Proj 1', 'Task 1', 'Cat 1', 2007, 01, 40)

INSERT INTO #currentTable VALUES ('Proj 1', 'Task 1', 'Cat 2', 2007, 02, 20)

INSERT INTO #currentTable VALUES ('Proj 1', 'Task 1', 'Cat 3', 2007, 03, 35)

INSERT INTO #currentTable VALUES ('Proj 1', 'Task 1', 'Cat 1', 2008, 01, 40)

INSERT INTO #currentTable VALUES ('Proj 1', 'Task 1', 'Cat 2', 2008, 02, 40)

INSERT INTO #currentTable VALUES ('Proj 1', 'Task 1', 'Cat 3', 2008, 03, 40)

SELECT Project, Task, Category, FiscalYear,

SUM(CASE FiscalMonth WHEN 1 THEN TotalHours ELSE 0 END) AS '01',

SUM(CASE FiscalMonth WHEN 2 THEN TotalHours ELSE 0 END) AS '02',

SUM(CASE FiscalMonth WHEN 3 THEN TotalHours ELSE 0 END) AS '03'

FROM #currentTable

GROUP BY Project, FiscalYear, Task, Caetegory

DROP TABLE #currentTable

|||

ShawnNSF,

When I run this statement the results in query analyzer it pulls back the results that I want to see on the bottom of the results pane based off of the the Selection statement looking into X_PJLABDIS(view).

My problem with this script is the INSERT step. It adds the values in the parantheses and I need it to add the values returned from the SELECT Statement below that.

Mike

CREATE TABLE PIVOT (

Project NVARCHAR(10),
pjt_entity NVARcHAR(10),
acct NVARcHAR(10),
Fiscalno_year INT,
Fiscalno_month INT,
total_hrs INT

)

INSERT INTO PIVOT VALUES ('Project', 'Pjt_entity', 'acct', 2007, 01, 40)

SELECT Project, pjt_entity, acct, Fiscalno_year,

SUM(CASE Fiscalno_month WHEN 1 THEN total_hrs ELSE 0 END) AS 'Month 01',
SUM(CASE Fiscalno_month WHEN 2 THEN total_hrs ELSE 0 END) AS 'Month 02',
SUM(CASE Fiscalno_month WHEN 3 THEN total_hrs ELSE 0 END) AS 'Month 03',
SUM(CASE Fiscalno_month WHEN 4 THEN total_hrs ELSE 0 END) AS 'Month 04',
SUM(CASE Fiscalno_month WHEN 5 THEN total_hrs ELSE 0 END) AS 'Month 05',
SUM(CASE Fiscalno_month WHEN 6 THEN total_hrs ELSE 0 END) AS 'Month 06',
SUM(CASE Fiscalno_month WHEN 7 THEN total_hrs ELSE 0 END) AS 'Month 07',
SUM(CASE Fiscalno_month WHEN 8 THEN total_hrs ELSE 0 END) AS 'Month 08',
SUM(CASE Fiscalno_month WHEN 9 THEN total_hrs ELSE 0 END) AS 'Month 09',
SUM(CASE Fiscalno_month WHEN 10 THEN total_hrs ELSE 0 END) AS 'Month 10',
SUM(CASE Fiscalno_month WHEN 11 THEN total_hrs ELSE 0 END) AS 'Month 11',
SUM(CASE Fiscalno_month WHEN 12 THEN total_hrs ELSE 0 END) AS 'Month 12'

FROM X_PJLABDIS

GROUP BY Project, Fiscalno_year, pjt_entity, acct

|||

Mike,

Those values are just for example. Do not use that part of the script. You seem to have gotten the idea by modifying the select statement (the part that was for you). I should have explained a little better that the other part of my snippet was just me building test data to show you the example query.

You can just run a query with the same idea as what I posted against the table you have with the data already populated in it.

|||

Shawn,

As you can probably tell right now, I am have very limited knowledge of and using pivot tables and stored procedures. As you said I am going down the right path with this code.

How would I go about achieving returning the results into a report or table? Need all the help I can get right now and you are helping a lot and very much appreciate it.

Thanks,

Mike

|||

FYI, using pivot with SS 2005

Code Snippet

Create Table #Project (

Project nvarchar(10),

Task nvarchar(10),

Category nvarchar(10),

FisicalYear int,

FisicalMonth int,

totalhrs Int

);

--Sample Data

Insert Into #Project Values('Project 1','Task 1', 'Cat 1', '2007', '1', '40' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 2', '2007', '2', '20' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 3', '2007', '3', '35' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 4', '2007', '4', '40' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 5', '2007', '5', '20' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 6', '2007', '6', '35' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 7', '2007', '7', '40' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 8', '2007', '8', '20' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 9', '2007', '9', '35' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 10', '2007', '10', '40' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 11', '2007', '11', '20' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 12', '2007', '12', '35' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 1', '2008', '01', '40' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 2', '2008', '02', '40' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 3', '2008', '03', '40' );

--Pivot Query

SELECT Project,Task, Category, FisicalYear,

ISNULL([1],0) AS 'Month 01',ISNULL([2],0) AS 'Month 02',ISNULL([3],0) AS 'Month 03',ISNULL([4],0) AS 'Month 04',

ISNULL([5],0) AS 'Month 05',ISNULL([6],0) AS 'Month 06',ISNULL([7],0) AS 'Month 07',ISNULL([8],0) AS 'Month 08',

ISNULL([9],0) AS 'Month 09',ISNULL([10],0) AS 'Month 10',ISNULL([11],0) AS 'Month 11',ISNULL([12],0) AS 'Month 12'

FROM (SELECT Project, Task, Category, FisicalYear,FisicalMonth,totalhrs,

Row_NUmber() OVER (partition by FisicalYear Order by FisicalMonth) as RowNum

FROM #Project) p

PIVOT

(SUM(totalhrs) FOR FisicalMonth IN ([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12]))

AS pvt

ORDER BY FisicalYear, RowNum

--

--SELECT Project,Task, Category, FisicalYear,

--SUM(CASE FisicalMonth WHEN 1 THEN totalhrs ELSE 0 END) AS 'Month 01',

--SUM(CASE FisicalMonth WHEN 2 THEN totalhrs ELSE 0 END) AS 'Month 02',

--SUM(CASE FisicalMonth WHEN 3 THEN totalhrs ELSE 0 END) AS 'Month 03',

--SUM(CASE FisicalMonth WHEN 4 THEN totalhrs ELSE 0 END) AS 'Month 04',

--SUM(CASE FisicalMonth WHEN 5 THEN totalhrs ELSE 0 END) AS 'Month 05',

--SUM(CASE FisicalMonth WHEN 6 THEN totalhrs ELSE 0 END) AS 'Month 06',

--SUM(CASE FisicalMonth WHEN 7 THEN totalhrs ELSE 0 END) AS 'Month 07',

--SUM(CASE FisicalMonth WHEN 8 THEN totalhrs ELSE 0 END) AS 'Month 08',

--SUM(CASE FisicalMonth WHEN 9 THEN totalhrs ELSE 0 END) AS 'Month 09',

--SUM(CASE FisicalMonth WHEN 10 THEN totalhrs ELSE 0 END) AS 'Month 10',

--SUM(CASE FisicalMonth WHEN 11 THEN totalhrs ELSE 0 END) AS 'Month 11',

--SUM(CASE FisicalMonth WHEN 12 THEN totalhrs ELSE 0 END) AS 'Month 12'

--

--FROM #Project

--

--GROUP BY Project,Task, Category, FisicalYear

--cleanup

drop table #Project

Creating a Stored Procedure that will summarize data in a table into a table reflecting period d

I am attempting to create a stored procedure that will launch at report runtime to summarize data in a table into a table that will reflect period data using an array type field. I know how to execute one line but I am not sure how to run the script so that it not only summarizes the data below but also creates and drops the table.

Any help would be greatly appreciated.

Current Table

Project | Task | Category | Fiscal Year | Fiscal Month | Total Hours

Proj 1 | Task 1 | Cat 1 | 2007 | 01 | 40

Proj 1 | Task 1 | Cat 2 | 2007 | 02 | 20

Proj 1 | Task 1 | Cat 3 | 2007 | 03 | 35

Proj 1 | Task 1 | Cat 1 | 2008 | 01 | 40

Proj 1 | Task 1 | Cat 2 | 2008 | 02 | 40

Proj 1 | Task 1 | Cat 3 | 2008 | 03 | 40

Proposed Table

Project | Task | Category | Fiscal Month 01 | Fiscal Month 02 | Fiscal Month 03 | Fiscal Year

Proj 1 | Task 1 | Cat 1 | 40 | 0 | 0 | 2007

Proj 1 | Task 1 | Cat 2 | 0 | 20 | 0 | 2007

Proj 1 | Task 1 | Cat 3 | 0 | 0 | 35 | 2007

Proj 1 | Task 1 | Cat 1 | 40 | 0 | 0 | 2008

Proj 1 | Task 1 | Cat 2 | 0 | 40 | 0 | 2008

Proj 1 | Task 1 | Cat 3 | 0 | 0 | 40 | 2008

Thanks,

Mike Misera

Check out the PIVOT operator

|||

Mike, check out this sample script. You would need a case statement for each month, this is just using one for each month supplied in the example.

Code Snippet

CREATE TABLE #currentTable (

Project NVARCHAR(10),

Task NVARcHAR(10),

Category NVARcHAR(10),

FiscalYear INT,

FiscalMonth INT,

TotalHours INT

)

INSERT INTO #currentTable VALUES ('Proj 1', 'Task 1', 'Cat 1', 2007, 01, 40)

INSERT INTO #currentTable VALUES ('Proj 1', 'Task 1', 'Cat 2', 2007, 02, 20)

INSERT INTO #currentTable VALUES ('Proj 1', 'Task 1', 'Cat 3', 2007, 03, 35)

INSERT INTO #currentTable VALUES ('Proj 1', 'Task 1', 'Cat 1', 2008, 01, 40)

INSERT INTO #currentTable VALUES ('Proj 1', 'Task 1', 'Cat 2', 2008, 02, 40)

INSERT INTO #currentTable VALUES ('Proj 1', 'Task 1', 'Cat 3', 2008, 03, 40)

SELECT Project, Task, Category, FiscalYear,

SUM(CASE FiscalMonth WHEN 1 THEN TotalHours ELSE 0 END) AS '01',

SUM(CASE FiscalMonth WHEN 2 THEN TotalHours ELSE 0 END) AS '02',

SUM(CASE FiscalMonth WHEN 3 THEN TotalHours ELSE 0 END) AS '03'

FROM #currentTable

GROUP BY Project, FiscalYear, Task, Caetegory

DROP TABLE #currentTable

|||

ShawnNSF,

When I run this statement the results in query analyzer it pulls back the results that I want to see on the bottom of the results pane based off of the the Selection statement looking into X_PJLABDIS(view).

My problem with this script is the INSERT step. It adds the values in the parantheses and I need it to add the values returned from the SELECT Statement below that.

Mike

CREATE TABLE PIVOT (

Project NVARCHAR(10),
pjt_entity NVARcHAR(10),
acct NVARcHAR(10),
Fiscalno_year INT,
Fiscalno_month INT,
total_hrs INT

)

INSERT INTO PIVOT VALUES ('Project', 'Pjt_entity', 'acct', 2007, 01, 40)

SELECT Project, pjt_entity, acct, Fiscalno_year,

SUM(CASE Fiscalno_month WHEN 1 THEN total_hrs ELSE 0 END) AS 'Month 01',
SUM(CASE Fiscalno_month WHEN 2 THEN total_hrs ELSE 0 END) AS 'Month 02',
SUM(CASE Fiscalno_month WHEN 3 THEN total_hrs ELSE 0 END) AS 'Month 03',
SUM(CASE Fiscalno_month WHEN 4 THEN total_hrs ELSE 0 END) AS 'Month 04',
SUM(CASE Fiscalno_month WHEN 5 THEN total_hrs ELSE 0 END) AS 'Month 05',
SUM(CASE Fiscalno_month WHEN 6 THEN total_hrs ELSE 0 END) AS 'Month 06',
SUM(CASE Fiscalno_month WHEN 7 THEN total_hrs ELSE 0 END) AS 'Month 07',
SUM(CASE Fiscalno_month WHEN 8 THEN total_hrs ELSE 0 END) AS 'Month 08',
SUM(CASE Fiscalno_month WHEN 9 THEN total_hrs ELSE 0 END) AS 'Month 09',
SUM(CASE Fiscalno_month WHEN 10 THEN total_hrs ELSE 0 END) AS 'Month 10',
SUM(CASE Fiscalno_month WHEN 11 THEN total_hrs ELSE 0 END) AS 'Month 11',
SUM(CASE Fiscalno_month WHEN 12 THEN total_hrs ELSE 0 END) AS 'Month 12'

FROM X_PJLABDIS

GROUP BY Project, Fiscalno_year, pjt_entity, acct

|||

Mike,

Those values are just for example. Do not use that part of the script. You seem to have gotten the idea by modifying the select statement (the part that was for you). I should have explained a little better that the other part of my snippet was just me building test data to show you the example query.

You can just run a query with the same idea as what I posted against the table you have with the data already populated in it.

|||

Shawn,

As you can probably tell right now, I am have very limited knowledge of and using pivot tables and stored procedures. As you said I am going down the right path with this code.

How would I go about achieving returning the results into a report or table? Need all the help I can get right now and you are helping a lot and very much appreciate it.

Thanks,

Mike

|||

FYI, using pivot with SS 2005

Code Snippet

Create Table #Project (

Project nvarchar(10),

Task nvarchar(10),

Category nvarchar(10),

FisicalYear int,

FisicalMonth int,

totalhrs Int

);

--Sample Data

Insert Into #Project Values('Project 1','Task 1', 'Cat 1', '2007', '1', '40' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 2', '2007', '2', '20' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 3', '2007', '3', '35' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 4', '2007', '4', '40' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 5', '2007', '5', '20' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 6', '2007', '6', '35' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 7', '2007', '7', '40' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 8', '2007', '8', '20' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 9', '2007', '9', '35' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 10', '2007', '10', '40' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 11', '2007', '11', '20' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 12', '2007', '12', '35' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 1', '2008', '01', '40' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 2', '2008', '02', '40' );

Insert Into #Project Values('Project 1','Task 1', 'Cat 3', '2008', '03', '40' );

--Pivot Query

SELECT Project,Task, Category, FisicalYear,

ISNULL([1],0) AS 'Month 01',ISNULL([2],0) AS 'Month 02',ISNULL([3],0) AS 'Month 03',ISNULL([4],0) AS 'Month 04',

ISNULL([5],0) AS 'Month 05',ISNULL([6],0) AS 'Month 06',ISNULL([7],0) AS 'Month 07',ISNULL([8],0) AS 'Month 08',

ISNULL([9],0) AS 'Month 09',ISNULL([10],0) AS 'Month 10',ISNULL([11],0) AS 'Month 11',ISNULL([12],0) AS 'Month 12'

FROM (SELECT Project, Task, Category, FisicalYear,FisicalMonth,totalhrs,

Row_NUmber() OVER (partition by FisicalYear Order by FisicalMonth) as RowNum

FROM #Project) p

PIVOT

(SUM(totalhrs) FOR FisicalMonth IN ([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12]))

AS pvt

ORDER BY FisicalYear, RowNum

--

--SELECT Project,Task, Category, FisicalYear,

--SUM(CASE FisicalMonth WHEN 1 THEN totalhrs ELSE 0 END) AS 'Month 01',

--SUM(CASE FisicalMonth WHEN 2 THEN totalhrs ELSE 0 END) AS 'Month 02',

--SUM(CASE FisicalMonth WHEN 3 THEN totalhrs ELSE 0 END) AS 'Month 03',

--SUM(CASE FisicalMonth WHEN 4 THEN totalhrs ELSE 0 END) AS 'Month 04',

--SUM(CASE FisicalMonth WHEN 5 THEN totalhrs ELSE 0 END) AS 'Month 05',

--SUM(CASE FisicalMonth WHEN 6 THEN totalhrs ELSE 0 END) AS 'Month 06',

--SUM(CASE FisicalMonth WHEN 7 THEN totalhrs ELSE 0 END) AS 'Month 07',

--SUM(CASE FisicalMonth WHEN 8 THEN totalhrs ELSE 0 END) AS 'Month 08',

--SUM(CASE FisicalMonth WHEN 9 THEN totalhrs ELSE 0 END) AS 'Month 09',

--SUM(CASE FisicalMonth WHEN 10 THEN totalhrs ELSE 0 END) AS 'Month 10',

--SUM(CASE FisicalMonth WHEN 11 THEN totalhrs ELSE 0 END) AS 'Month 11',

--SUM(CASE FisicalMonth WHEN 12 THEN totalhrs ELSE 0 END) AS 'Month 12'

--

--FROM #Project

--

--GROUP BY Project,Task, Category, FisicalYear

--cleanup

drop table #Project

Wednesday, March 21, 2012

Creating a report using a stored procedure

Hi All,

Is there a way to create a report in SQL2005 reporting services to call a stored procedure that has parameters? I keep getting an error saying i am not supplying the params, I can't seem to find where to put my parameters for the report to use.

Thanks, Joe

You would be better posting this on the reporting services forum, as this is mainly for T-SQL issues

Creating a report using a Stored Procedure

Hi All,

Is there a way to create a report in SQL2005 reporting services to call a stored procedure that has parameters? I keep getting an error saying i am not supplying the params, I can't seem to find where to put my parameters for the report to use.

Thanks,

Joe

How about something like

exec uspTest @.parm1, @.parm2

If I remember right it will provide a couple of boxes for you to type the parm values when you view the report in Report Manager

|||the parameters (Report Parameters) you have in RS should have the same name as the parameters you declare in stored procedure.sql

Monday, March 19, 2012

Creating a Report to PDF in a folder?

We have created a report called "update" that we want to run every hour and place in a directory called d:\info\update.pdf

We would like to call the report from a procedure and have the proc generate the report in PDF format in the directory d:\info

Does anyone know how to do this?Try the subscription feature of Reporting Services? It will do exactly what you describe.|||Use the file share delivery method. Either create a special share with appropriate security settings, or use can also use the administrative share like this: \\localhost\d$\info, but this would required administrator credentials in the subscription.

Creating a report on a file share from a stored procedure

Hi,
I've seen one or two postings on this, and in particular 2 approaches:
1) running rs.exe from a stored procedure in conjunction with xp_cmdshell.
I have successfully managed to create and test a stored procedure that
renders a report to a file share using this approach - but for some reason
it doesn't work when integrated into the enterprise app I need it too work
with. When the sp is initiated from the app, the report appears to be
generated successfully (according to the entries in the ExecutionLog table
in the ReportServer database), but isn't being written to file on the server
(although it did in testing). No return errors, nothing in the EventLog,
nothing, nothing, nothing. Even when rs.exe is run with the -t parameter.
Very frustrating.
2) So, if I can do this quickly, I thought I'd look at a second approach i.e
accessing the web service directly from the stored procedure via the
sp_OACreate stored procedure. From a posting I've seen from Teo Lachev, he
indicates that the object to reference is MSXML2.ServerXMLHttp, with an
example provided. However what isn't clear to me is how this can be used to
render and write the report to a file share, in a similar manner to the .rss
file I used in conjunction with point 1 above. Is this approach possible?
or can the web service only be used to create an on-demand report back to a
browser?
Anyone with some examples/tips on this?
Thanks
GregWhat user security context is used when run from the app? Try (as a test)
setting Everyone Full Control to the directory where the file is being
written.
Jeff
"Greg Clark" <gclarkmail@.yahoo.com> wrote in message
news:#9IMhzamEHA.648@.tk2msftngp13.phx.gbl...
> Hi,
> I've seen one or two postings on this, and in particular 2 approaches:
> 1) running rs.exe from a stored procedure in conjunction with xp_cmdshell.
> I have successfully managed to create and test a stored procedure that
> renders a report to a file share using this approach - but for some reason
> it doesn't work when integrated into the enterprise app I need it too work
> with. When the sp is initiated from the app, the report appears to be
> generated successfully (according to the entries in the ExecutionLog table
> in the ReportServer database), but isn't being written to file on the
server
> (although it did in testing). No return errors, nothing in the EventLog,
> nothing, nothing, nothing. Even when rs.exe is run with the -t parameter.
> Very frustrating.
> 2) So, if I can do this quickly, I thought I'd look at a second approach
i.e
> accessing the web service directly from the stored procedure via the
> sp_OACreate stored procedure. From a posting I've seen from Teo Lachev,
he
> indicates that the object to reference is MSXML2.ServerXMLHttp, with an
> example provided. However what isn't clear to me is how this can be used
to
> render and write the report to a file share, in a similar manner to the
.rss
> file I used in conjunction with point 1 above. Is this approach possible?
> or can the web service only be used to create an on-demand report back to
a
> browser?
> Anyone with some examples/tips on this?
> Thanks
> Greg
>|||Hi Jeff,
The directory already has Everyone Full Control applied.
What I find so bizarre is that in theory there should be absolutely no
difference as to whether the stored procedure is called from the app
(doesn't create the file) or whether I initiate the stored procedure with a
test in SQL Query Analyzer (creates the file). The rss file createing and
rendering the report is called from within the sp, and the same credentials
are being used irrespective of how it is initiated.
I'm working in a test environment on vmware, and I have the app (which uses
sql server) installed on the same server as reporting services, and the only
clue I have is that in the TimeDataRetrieval field in the ExecutionLog
table, the value is 1000 times higher (e.g. 61315 vs 53) when the stored
procedure is initiated from the app as opposed to query analyzer. As the
Status field holds the value of rsSuccess, perhaps some timeout on the
stream.write() function is occuring' Not sure, which is why I thought I'd
try another approach..
My rss file is as follows:
Public Sub Main()
Dim format as string = "PDF"
Dim fileName as String = "C:\Reportd\yyyy.pdf"
Dim reportPath as String = "/CNSOfficeSystem/Quote"
' Prepare Render arguments
Dim historyID as string = Nothing
Dim deviceInfo as string = Nothing
Dim showHide as string = Nothing
Dim results() as Byte
Dim encoding as string
Dim mimeType as string
Dim warnings() AS Warning = Nothing
Dim reportHistoryParameters() As ParameterValue = Nothing
Dim streamIDs() as string = Nothing
' Report Parameters
Dim parameters(2) As ParameterValue
parameters(0) = New ParameterValue()
parameters(0).Name = "QuoteFolderID"
parameters(0).Value = QFID
' parameters(0).Value = "VMBP01$VMBP01$00000242"
parameters(1) = New ParameterValue()
parameters(1).Name = "CustomerID"
parameters(1).Value = CUID
' parameters(1).Value = "12809"
parameters(2) = New ParameterValue()
parameters(2).Name = "ContactID"
parameters(2).Value = COID
' parameters(2).Value = "245"
results = rs.Render(reportPath, format, Nothing, Nothing, parameters,
Nothing, Nothing, encoding, mimeType, reportHistoryParameters, warnings,
streamIDs)
' Open a file stream and write out the report
Dim stream As FileStream = File.OpenWrite(fileName)
stream.Write(results, 0, results.Length)
stream.Close()
End Sub
"Jeff Dillon" <jeff@.removeemergencyreporting.com> wrote in message
news:ePkHhBdmEHA.3336@.TK2MSFTNGP10.phx.gbl...
> What user security context is used when run from the app? Try (as a test)
> setting Everyone Full Control to the directory where the file is being
> written.
> Jeff
> "Greg Clark" <gclarkmail@.yahoo.com> wrote in message
> news:#9IMhzamEHA.648@.tk2msftngp13.phx.gbl...
> > Hi,
> > I've seen one or two postings on this, and in particular 2 approaches:
> >
> > 1) running rs.exe from a stored procedure in conjunction with
xp_cmdshell.
> > I have successfully managed to create and test a stored procedure that
> > renders a report to a file share using this approach - but for some
reason
> > it doesn't work when integrated into the enterprise app I need it too
work
> > with. When the sp is initiated from the app, the report appears to be
> > generated successfully (according to the entries in the ExecutionLog
table
> > in the ReportServer database), but isn't being written to file on the
> server
> > (although it did in testing). No return errors, nothing in the
EventLog,
> > nothing, nothing, nothing. Even when rs.exe is run with the -t
parameter.
> > Very frustrating.
> >
> > 2) So, if I can do this quickly, I thought I'd look at a second approach
> i.e
> > accessing the web service directly from the stored procedure via the
> > sp_OACreate stored procedure. From a posting I've seen from Teo Lachev,
> he
> > indicates that the object to reference is MSXML2.ServerXMLHttp, with an
> > example provided. However what isn't clear to me is how this can be
used
> to
> > render and write the report to a file share, in a similar manner to the
> .rss
> > file I used in conjunction with point 1 above. Is this approach
possible?
> > or can the web service only be used to create an on-demand report back
to
> a
> > browser?
> >
> > Anyone with some examples/tips on this?
> >
> > Thanks
> > Greg
> >
> >
>

Creating a Report Model on a UDB datasource

Hi all,

I'm just getting started with Reporting Services and have a question.

I'm trying to set up a report model based on a UDB data source. However when I use the report model wizard, I get presented with:

[DB2/SUN] SQL0104N An unexpected token "SET TRANSACTION" was found following "BEGIN-OF-STATEMENT" ... SQLSTATE 42601.

I think that this is trying to set transaction isolation levels however this is not valid SQL for a UDB database.

Is there something that I'm missing with my configuration to make RS know that this is a non-SQLServer database?

Many thanks,

JK

Hello,

Did you ever receive an answer to this issue?

Thanks.

Creating a Report Model on a UDB datasource

Hi all,

I'm just getting started with Reporting Services and have a question.

I'm trying to set up a report model based on a UDB data source. However when I use the report model wizard, I get presented with:

[DB2/SUN] SQL0104N An unexpected token "SET TRANSACTION" was found following "BEGIN-OF-STATEMENT" ... SQLSTATE 42601.

I think that this is trying to set transaction isolation levels however this is not valid SQL for a UDB database.

Is there something that I'm missing with my configuration to make RS know that this is a non-SQLServer database?

Many thanks,

JK

Hello,

Did you ever receive an answer to this issue?

Thanks.

Creating a Report Model from Analysis Services Cube then Editing

I have been told that you can create a Report Model from an Analysis Services
Cube in the Model Designer even though the documentation says you can not.
I can import the Analysis Project that contains the cube into BI Development
Studio but I can not create a model from that project.
Does anyone know how to create then edit a model in the Model Designer(BI
Development Studio not Management Studio or Report Manager) that is based on
an AS Cube?
--
New user - jhpuddyhave you noticed ? both while creating report model and cube you can see
something called "Data Source View" nothing but building relationships
between tables. so same refer your dw database and create view and you can
use report model to create reports using cube and view.
Amarnath
"jhpuddy" wrote:
> I have been told that you can create a Report Model from an Analysis Services
> Cube in the Model Designer even though the documentation says you can not.
> I can import the Analysis Project that contains the cube into BI Development
> Studio but I can not create a model from that project.
> Does anyone know how to create then edit a model in the Model Designer(BI
> Development Studio not Management Studio or Report Manager) that is based on
> an AS Cube?
> --
> New user - jhpuddy|||Amarnath,
Thank you for responding.
But the problem is that I can't create a model from a cube in BI Development
Studio. I can create one in Management Studio but I can not edit the Model
after it is created. We were planning on doing all of the formatting,
grouping and filtering in the model but we can not do that if we can not edit
it. The only thing that comes up for the model is the source code, can not
edit the code.
--
New user - jhpuddy
"Amarnath" wrote:
> have you noticed ? both while creating report model and cube you can see
> something called "Data Source View" nothing but building relationships
> between tables. so same refer your dw database and create view and you can
> use report model to create reports using cube and view.
> Amarnath
>
> "jhpuddy" wrote:
> > I have been told that you can create a Report Model from an Analysis Services
> > Cube in the Model Designer even though the documentation says you can not.
> > I can import the Analysis Project that contains the cube into BI Development
> > Studio but I can not create a model from that project.
> > Does anyone know how to create then edit a model in the Model Designer(BI
> > Development Studio not Management Studio or Report Manager) that is based on
> > an AS Cube?
> >
> > --
> > New user - jhpuddy|||You can do one thing If you have created a Analysis services project ie cube.
you can create one using "create datasource from other object" from add data
source.
Amarnath
"jhpuddy" wrote:
> Amarnath,
> Thank you for responding.
> But the problem is that I can't create a model from a cube in BI Development
> Studio. I can create one in Management Studio but I can not edit the Model
> after it is created. We were planning on doing all of the formatting,
> grouping and filtering in the model but we can not do that if we can not edit
> it. The only thing that comes up for the model is the source code, can not
> edit the code.
> --
> New user - jhpuddy
>
> "Amarnath" wrote:
> > have you noticed ? both while creating report model and cube you can see
> > something called "Data Source View" nothing but building relationships
> > between tables. so same refer your dw database and create view and you can
> > use report model to create reports using cube and view.
> >
> > Amarnath
> >
> >
> > "jhpuddy" wrote:
> >
> > > I have been told that you can create a Report Model from an Analysis Services
> > > Cube in the Model Designer even though the documentation says you can not.
> > > I can import the Analysis Project that contains the cube into BI Development
> > > Studio but I can not create a model from that project.
> > > Does anyone know how to create then edit a model in the Model Designer(BI
> > > Development Studio not Management Studio or Report Manager) that is based on
> > > an AS Cube?
> > >
> > > --
> > > New user - jhpuddy|||Yes, I know I have done that. It lets you create a data source but does not
recognize that data source when you try to create a data source view. It
puts you into a sort of loop.
--
New user - jhpuddy
"Amarnath" wrote:
> You can do one thing If you have created a Analysis services project ie cube.
> you can create one using "create datasource from other object" from add data
> source.
> Amarnath
> "jhpuddy" wrote:
> > Amarnath,
> >
> > Thank you for responding.
> >
> > But the problem is that I can't create a model from a cube in BI Development
> > Studio. I can create one in Management Studio but I can not edit the Model
> > after it is created. We were planning on doing all of the formatting,
> > grouping and filtering in the model but we can not do that if we can not edit
> > it. The only thing that comes up for the model is the source code, can not
> > edit the code.
> > --
> > New user - jhpuddy
> >
> >
> > "Amarnath" wrote:
> >
> > > have you noticed ? both while creating report model and cube you can see
> > > something called "Data Source View" nothing but building relationships
> > > between tables. so same refer your dw database and create view and you can
> > > use report model to create reports using cube and view.
> > >
> > > Amarnath
> > >
> > >
> > > "jhpuddy" wrote:
> > >
> > > > I have been told that you can create a Report Model from an Analysis Services
> > > > Cube in the Model Designer even though the documentation says you can not.
> > > > I can import the Analysis Project that contains the cube into BI Development
> > > > Studio but I can not create a model from that project.
> > > > Does anyone know how to create then edit a model in the Model Designer(BI
> > > > Development Studio not Management Studio or Report Manager) that is based on
> > > > an AS Cube?
> > > >
> > > > --
> > > > New user - jhpuddy

Creating a report model based on related entities

I created a report model that has two entities. Both entities, in the SQL
terminology, can have an inner join. Now the two tables do not have any
foreign key relationship or anything. ..
Now when i open the report builder and select a field from one of the entity
the other one just dissapears away. What do i need to do to be able to select
fields from both entities ?The above question is for designing ad hoc reports through the report model.|||It is not visible because when you select an entity then that becomes a
primary entity and remaining is not visible. Now the entities related to the
selected or the primary will be visible. As you said that there is no
relation so it doesn't appear on the list and it wont appear. So you need to
have a relation to be able to select other fields as well.
Amarnath
"Tk_Neo" wrote:
> The above question is for designing ad hoc reports through the report model.|||I have a smilar problem. I have a single data source view which contains 3
tables. Each table is a completely denormalized (like a spreadsheet) dataset
from a particular business system. Within the datasource view editor I
created primary keys on each table and established relationships between each
table. However, when I try to create a report in report builder, as soon as
add an entity from one table to my report, the other 2 tables disappear.
What do I have to do to prevent the tables from disappearing? Please be
specific since I am fairly new to the Ad Hoc component of reporting services.
Thanks.
"Amarnath" wrote:
> It is not visible because when you select an entity then that becomes a
> primary entity and remaining is not visible. Now the entities related to the
> selected or the primary will be visible. As you said that there is no
> relation so it doesn't appear on the list and it wont appear. So you need to
> have a relation to be able to select other fields as well.
> Amarnath
> "Tk_Neo" wrote:
> > The above question is for designing ad hoc reports through the report model.