Showing posts with label save. Show all posts
Showing posts with label save. Show all posts

Monday, March 26, 2012

How to fire off a report and save it as pdf...

Using vb.net, does anyone know or has anyone fired off a sql report, save it as PDF to a defined path?

I am knew to sql reporting services and the help files are not very helpfile.

Any sample code would be helpful.

Thanks

Hello,

Have a look at the sample code on this page:

http://msdn2.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsexecutionservice2005.reportexecutionservice.render.aspx

Specify the export format you want (in your case "PDF") as a parameter to the Render method.

-Chris

|||

I looked at the sample code, how ever, not sure where the references are to things like

"ReportExecutionService" and some of the other objects.

WHich .net items do I need to import?

Daryl

|||In your project you need add a web reference to the reportexecution service. this will create a proxy class that you an instantiate in code to call the web service|||does it matter that I am NOT building a web application? Building a Desktop vb.net exe.|||no it doesn't matter|||

I cannot find this reference. I looked in windows and system...

|||Right-click your project and select "Add Web Reference"|||

Hi Adam,

The post and the replies are really useful. Thanks a lot for the help...

Adam, the URL "http://localhost/reportserver/reportexecution2005.asmx" needs to be a working one or are we giving a dummy value?

Thanks in advance for the help....

Sudhiiiii...

|||Replace "localhost" with the name of your reports server.|||

Hi,

First of all thanks for the reply.

I tried the above stated method and the URL for my system was "http://localhost/reportserver$sqlserver/reportexecution2005.asmx".

As i'm developing a Windows application solution, i hasn't deployed any of my reports in the specified URL or any other.

I tried to add the URL as a Web reference its saying the URL doesnot contain any web service.

I tried to browse the URL manually, its saying that there is an authentication problem, and user "systemname\ASPNet" is unable to connect to the Database.I went to Sql server and given all the rights to 'aspnet" user , which was a normal user previously.In IIS i tried giving anonyous rights as well as windows integrated user for the virtual directory .My DB is having full rights, and working on integrated user while using the forms.

still the problem persists.

1) is the problem in SQL server or IIS or windows...?

2)Does this has any relation to 'ASP.Net state service' service in windows

3) will me publishing the reorts in iis server will solve the issue. I should have tried this but i'm a too newbie in this and i need to search for how to do that...

Please do help...... Thanks in advance......

Sudhiiii....

|||

Sudeesh,

If you are developing a windows application then you should use the ReportViewer control. This can be used in one of 2 modes:

local mode: the report files are saved as RDLC and stored in the application directory (no report server required)

server mode: where the control connects to a report server and displays shared reports. For this reports need to deployed tot he server.

|||

Hi Adam,

Thanks a lot for the reply...

I should have told my problem in detail...

Let me do that now..

I'm creating a windows application With Vb2005 and Sql 2005 express editions.
The basic point is to create 5 reports from the data in sql tables, each one having several subreports. These reports have to be exported to Excel as there was a VBA application on Excel previously.Currently I'm able to manually save each report as an individual file and later open five excel files move/copy them into one file and then save the excel.I want to automate the task using code such that for the end user it should be like, one button pressed and five reports are saved to excel file... The issue is that i'm able to save at least a report to an excel file manually only, not using code.

Once i'm able to save one report by code we can bundle all of them into one workbook.

To view the report I'm using Reportviewer control but i'm not able to save it.

I hope i made it clear....

Sudhiiiii...

sql

Friday, March 23, 2012

How to fire off a report and save it as pdf...

Using vb.net, does anyone know or has anyone fired off a sql report, save it as PDF to a defined path?

I am knew to sql reporting services and the help files are not very helpfile.

Any sample code would be helpful.

Thanks

Hello,

Have a look at the sample code on this page:

http://msdn2.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsexecutionservice2005.reportexecutionservice.render.aspx

Specify the export format you want (in your case "PDF") as a parameter to the Render method.

-Chris

|||

I looked at the sample code, how ever, not sure where the references are to things like

"ReportExecutionService" and some of the other objects.

WHich .net items do I need to import?

Daryl

|||In your project you need add a web reference to the reportexecution service. this will create a proxy class that you an instantiate in code to call the web service|||does it matter that I am NOT building a web application? Building a Desktop vb.net exe.|||no it doesn't matter|||

I cannot find this reference. I looked in windows and system...

|||

Right-click your project and select "Add Web Reference"

How to fire off a report and save it as pdf...

Using vb.net, does anyone know or has anyone fired off a sql report, save it as PDF to a defined path?

I am knew to sql reporting services and the help files are not very helpfile.

Any sample code would be helpful.

Thanks

Hello,

Have a look at the sample code on this page:

http://msdn2.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsexecutionservice2005.reportexecutionservice.render.aspx

Specify the export format you want (in your case "PDF") as a parameter to the Render method.

-Chris

|||

I looked at the sample code, how ever, not sure where the references are to things like

"ReportExecutionService" and some of the other objects.

WHich .net items do I need to import?

Daryl

|||In your project you need add a web reference to the reportexecution service. this will create a proxy class that you an instantiate in code to call the web service|||does it matter that I am NOT building a web application? Building a Desktop vb.net exe.|||no it doesn't matter|||

I cannot find this reference. I looked in windows and system...

|||Right-click your project and select "Add Web Reference"|||

Hi Adam,

The post and the replies are really useful. Thanks a lot for the help...

Adam, the URL "http://localhost/reportserver/reportexecution2005.asmx" needs to be a working one or are we giving a dummy value?

Thanks in advance for the help....

Sudhiiiii...

|||Replace "localhost" with the name of your reports server.|||

Hi,

First of all thanks for the reply.

I tried the above stated method and the URL for my system was "http://localhost/reportserver$sqlserver/reportexecution2005.asmx".

As i'm developing a Windows application solution, i hasn't deployed any of my reports in the specified URL or any other.

I tried to add the URL as a Web reference its saying the URL doesnot contain any web service.

I tried to browse the URL manually, its saying that there is an authentication problem, and user "systemname\ASPNet" is unable to connect to the Database.I went to Sql server and given all the rights to 'aspnet" user , which was a normal user previously.In IIS i tried giving anonyous rights as well as windows integrated user for the virtual directory .My DB is having full rights, and working on integrated user while using the forms.

still the problem persists.

1) is the problem in SQL server or IIS or windows...?

2)Does this has any relation to 'ASP.Net state service' service in windows

3) will me publishing the reorts in iis server will solve the issue. I should have tried this but i'm a too newbie in this and i need to search for how to do that...

Please do help...... Thanks in advance......

Sudhiiii....

|||

Sudeesh,

If you are developing a windows application then you should use the ReportViewer control. This can be used in one of 2 modes:

local mode: the report files are saved as RDLC and stored in the application directory (no report server required)

server mode: where the control connects to a report server and displays shared reports. For this reports need to deployed tot he server.

|||

Hi Adam,

Thanks a lot for the reply...

I should have told my problem in detail...

Let me do that now..

I'm creating a windows application With Vb2005 and Sql 2005 express editions.
The basic point is to create 5 reports from the data in sql tables, each one having several subreports. These reports have to be exported to Excel as there was a VBA application on Excel previously.Currently I'm able to manually save each report as an individual file and later open five excel files move/copy them into one file and then save the excel.I want to automate the task using code such that for the end user it should be like, one button pressed and five reports are saved to excel file... The issue is that i'm able to save at least a report to an excel file manually only, not using code.

Once i'm able to save one report by code we can bundle all of them into one workbook.

To view the report I'm using Reportviewer control but i'm not able to save it.

I hope i made it clear....

Sudhiiiii...

How to fire off a report and save it as pdf...

Using vb.net, does anyone know or has anyone fired off a sql report, save it as PDF to a defined path?

I am knew to sql reporting services and the help files are not very helpfile.

Any sample code would be helpful.

Thanks

Hello,

Have a look at the sample code on this page:

http://msdn2.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsexecutionservice2005.reportexecutionservice.render.aspx

Specify the export format you want (in your case "PDF") as a parameter to the Render method.

-Chris

|||

I looked at the sample code, how ever, not sure where the references are to things like

"ReportExecutionService" and some of the other objects.

WHich .net items do I need to import?

Daryl

|||In your project you need add a web reference to the reportexecution service. this will create a proxy class that you an instantiate in code to call the web service|||does it matter that I am NOT building a web application? Building a Desktop vb.net exe.|||no it doesn't matter|||

I cannot find this reference. I looked in windows and system...

|||Right-click your project and select "Add Web Reference"|||

Hi Adam,

The post and the replies are really useful. Thanks a lot for the help...

Adam, the URL "http://localhost/reportserver/reportexecution2005.asmx" needs to be a working one or are we giving a dummy value?

Thanks in advance for the help....

Sudhiiiii...

|||Replace "localhost" with the name of your reports server.|||

Hi,

First of all thanks for the reply.

I tried the above stated method and the URL for my system was "http://localhost/reportserver$sqlserver/reportexecution2005.asmx".

As i'm developing a Windows application solution, i hasn't deployed any of my reports in the specified URL or any other.

I tried to add the URL as a Web reference its saying the URL doesnot contain any web service.

I tried to browse the URL manually, its saying that there is an authentication problem, and user "systemname\ASPNet" is unable to connect to the Database.I went to Sql server and given all the rights to 'aspnet" user , which was a normal user previously.In IIS i tried giving anonyous rights as well as windows integrated user for the virtual directory .My DB is having full rights, and working on integrated user while using the forms.

still the problem persists.

1) is the problem in SQL server or IIS or windows...?

2)Does this has any relation to 'ASP.Net state service' service in windows

3) will me publishing the reorts in iis server will solve the issue. I should have tried this but i'm a too newbie in this and i need to search for how to do that...

Please do help...... Thanks in advance......

Sudhiiii....

|||

Sudeesh,

If you are developing a windows application then you should use the ReportViewer control. This can be used in one of 2 modes:

local mode: the report files are saved as RDLC and stored in the application directory (no report server required)

server mode: where the control connects to a report server and displays shared reports. For this reports need to deployed tot he server.

|||

Hi Adam,

Thanks a lot for the reply...

I should have told my problem in detail...

Let me do that now..

I'm creating a windows application With Vb2005 and Sql 2005 express editions.
The basic point is to create 5 reports from the data in sql tables, each one having several subreports. These reports have to be exported to Excel as there was a VBA application on Excel previously.Currently I'm able to manually save each report as an individual file and later open five excel files move/copy them into one file and then save the excel.I want to automate the task using code such that for the end user it should be like, one button pressed and five reports are saved to excel file... The issue is that i'm able to save at least a report to an excel file manually only, not using code.

Once i'm able to save one report by code we can bundle all of them into one workbook.

To view the report I'm using Reportviewer control but i'm not able to save it.

I hope i made it clear....

Sudhiiiii...

Friday, March 9, 2012

How To find out Database Growth.

I would like to know followings:

I want to see every day or weekly Database growth (%) save on table

I have some SP which will give me one time run and see the growth. which is ...

Please advice any other way to find out and save on a location ...

create procedure sp_growth as

set ansi_warnings off

declare @.l_db_name varchar(50)
,@.l_sql_string varchar(1000)

set nocount on
if object_id('DB_Growth') is not null
drop table DB_Growth

create table DB_Growth (Database_Name varchar(30), Logical_File_Name varchar(15), File_Size_MB int, Growth_Factor varchar(100))

declare db_name_cursor insensitive cursor
for
select name from master..sysdatabases

open db_name_cursor

fetch next from db_name_cursor into
@.l_db_name

While (@.@.fetch_status = 0)
begin
select @.l_sql_string = 'select ' + '''' + @.l_db_name + '''' + ', name, ceiling((size * 8192.0)/(1024.0 * 1024.0)), case when status & 0x100000 = 0 then convert(varchar,ceiling((growth * 8192.0)/(1024.0*1024.0))) + '' MB''' + char(10)+char(13)
+ 'else convert (varchar, growth) + '' Percent''' + char(10)+char(13)
+ 'end' + char(10)+char(13)
+ 'from [' + @.l_db_name + '].dbo.sysfiles'
insert into DB_Growth (Database_Name, Logical_File_Name, File_Size_MB, Growth_Factor)
exec (@.l_sql_string)

fetch next from db_name_cursor into
@.l_db_name
end
close db_name_cursor
deallocate db_name_cursor
select * from DB_Growth with (nolock)
if object_id('DB_Growth') is not null
drop table DB_Growth
set nocount off
set ansi_warnings on
return


GO


Thanks
Faiz Farazi
Daudkandi,Comilla, Bangladesh
http://www.databasetimes.net/

You seemed to have 'Carpet Bombed' quite a few forums...

Often, the quality of the responses received is related to our ability to ‘bounce’ ideas off of each other. In the future, to make it easier for us to offer you assistance, and to prevent folks from wasting time on already answered questions, please don't post to multiple newsgroups. Choose the one that best fits your question and post there. Only post to another newsgroup if you get no answer in a day or two (or if you accidentally posted to the wrong newsgroup –and you indicate that you've already posted elsewhere).

How To find out Database Growth.

I would like to know followings:

I want to see every day or weekly Database growth (%) save on table

I have some SP which will give me one time run and see the growth. which is ...

Please advice any other way to find out and save on a location ...

create procedure sp_growth as

set ansi_warnings off

declare @.l_db_name varchar(50)
,@.l_sql_string varchar(1000)

set nocount on
if object_id('DB_Growth') is not null
drop table DB_Growth

create table DB_Growth (Database_Name varchar(30), Logical_File_Name varchar(15), File_Size_MB int, Growth_Factor varchar(100))

declare db_name_cursor insensitive cursor
for
select name from master..sysdatabases

open db_name_cursor

fetch next from db_name_cursor into
@.l_db_name

While (@.@.fetch_status = 0)
begin
select @.l_sql_string = 'select ' + '''' + @.l_db_name + '''' + ', name, ceiling((size * 8192.0)/(1024.0 * 1024.0)), case when status & 0x100000 = 0 then convert(varchar,ceiling((growth * 8192.0)/(1024.0*1024.0))) + '' MB''' + char(10)+char(13)
+ 'else convert (varchar, growth) + '' Percent''' + char(10)+char(13)
+ 'end' + char(10)+char(13)
+ 'from [' + @.l_db_name + '].dbo.sysfiles'
insert into DB_Growth (Database_Name, Logical_File_Name, File_Size_MB, Growth_Factor)
exec (@.l_sql_string)

fetch next from db_name_cursor into
@.l_db_name
end
close db_name_cursor
deallocate db_name_cursor
select * from DB_Growth with (nolock)
if object_id('DB_Growth') is not null
drop table DB_Growth
set nocount off
set ansi_warnings on
return


GO


Thanks
Faiz Farazi
Daudkandi,Comilla, Bangladesh
http://www.databasetimes.net/

You seemed to have 'Carpet Bombed' quite a few forums...

Often, the quality of the responses received is related to our ability to ‘bounce’ ideas off of each other. In the future, to make it easier for us to offer you assistance, and to prevent folks from wasting time on already answered questions, please don't post to multiple newsgroups. Choose the one that best fits your question and post there. Only post to another newsgroup if you get no answer in a day or two (or if you accidentally posted to the wrong newsgroup –and you indicate that you've already posted elsewhere).