Showing posts with label call. Show all posts
Showing posts with label call. Show all posts

Monday, March 26, 2012

Reporting Services 2005 and .NET 2003

Hello,

Can I integrate a Reporting Services 2005 report into an application done with .NET 2003, so that I can call the report from that application?

What should I consider for the deployment of the report and the application. Can I do that? (I am asking this because for the application I use framework 1.1, and for the report I use framework 2.0, don't I?)

Thanks,

Marco

Hi Marco-

You can't do that. You need VS2005 to use SSRS2005. VS2003 only works with SSRS2000.

Regards,
Scott
|||You should be able to interact with the server via SOAP and URL Access just fine from a .NET 1.1 application. What you will not be able to do is embed the Report Viewer control directly in your application.|||

You cannot design SRS 2005 reports using Visual Studio 2003, however, you can integrate/launch them from a VS2003 application. The easiest way to get this up and running is to have a copy of SRS 2005 running on your local / dev machine. I will continue assuming this is the case. I am also assuming this is probably a web application you are writing (?) because SRS is also.
My solution below. This is certainly not the only way of acheiving this, however, it will give you a good starting point I hope. I also assume you have setup SRS correctly with a data source and also know how the folder and report structure works.

1. First you will need to add a web reference for SRS 2005.

To do this, open your project and select Project > Add Web Reference from the main menu. Next click the Browse to: Web services on the local machine link. This should list all the SOAP apps on your local machine. In the list you should see ReportService. Click on the ReportService link, give it an appropriate name (the localhost default is not recommended) and click Add Reference.

2. Next, you will need to add some code to application to create the report from a stored RDL document.

I wrote this in VB.net as an example, to make it work you will need to modify it to fit your code. You will also need to add measures for the authentication mode you are using (e.g. a Shared Data Source) although this could be dealt with in the RDL. I did not have time to test this fully so be prepared to get the spade out.

Private Function MakeReport(ByVal sRDLLocalPath As String, ByVal sReportName As String, ByVal sReportFolder As String) As String

' Create reporting services object

' Possible alternate name: Dim rs As New ReportingServices2005.ReportingService2005

Dim rs As New ReportingServices.ReportingService

rs.Credentials = System.Net.CredentialCache.DefaultCredentials

rs.Url = "http://servername/ReportServer/ReportService.asmx"

' Read details of RDL from file

Dim oSR As IO.StreamReader

Dim sRDLDocument As String

oSR = System.IO.File.OpenText(sRDLLocalPath)

sRDLDocument = oSR.ReadToEnd

oSR.Close()

' Create the report on the server

Dim Warnings() As ReportingServices.Warning

Warnings = rs.CreateReport(sReportName, sReportFolder, True, StrToByteArray(sRDLDocument), Nothing)

' Check for errors

If Not Warnings Is Nothing Then

For Each Warning As ReportingServices.Warning In Warnings

If Not Warning.Message Is Nothing Then Throw New Exception("An error occured!")

Next

End If

Return "http://servername/Reports/" & sReportFolder & "/" & sReportName

End Function

3. Finally display the report in some way

Again some quick VB code to run this, using the code from above. Again, Mickey Mouse, sorry. You will need to be in an aspx.vb page and not a component class or similar to use the Response.Redirect, but there are better things you can do with the report URL as I'm sure you're probably aware.

Dim sReportURL As String

sReportURL = Me.MakeReport("c:\myreports\myreport.rdl", "MyReport1234", "MyReports")

Response.Redirect(sReportURL)

Tuesday, March 20, 2012

Reporting Services

Hi,
I am new for the Reporting Services. I need to generate a reports
based on a stored procedure. When we call the stored procedure it says
Invalid object name '#LType'. (Microsoft SQL SERVER, Error:208)
If we see the stored procedure, we find that there is a temporary table
'#LType' where we are storing the data and applying some condition for
fatching the records from the table. At the bottom of the stored
procedure we are also dropping the temporary table.The stored procedure
looks like:
alter procedure Test4 .
@.UID int,@.varSourceType varchar(10)=null
......
......
as
set quoted_identifier off
set nocount on
declare @.BranchIDsql varchar(1000),@.varleveltype varchar
.....
....
Begin
create table <b> #LType (LevelType varchar(4)) </b>
insert into #LType select ltrim(rtrim(UL.varleveltype)) from
tbluserlevel UL inner join tblUserProfile UP on
UL.intUserProfileID=UP.intUserProfileID where UP.intUserLoginID=@.UID
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[BID]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[BID]
create table BID (intUlBranchID int)
if ((select count(Leveltype) from #LType where LevelType='CORP')>0)
Begin
set @.BranchIDsql="insert into BID select tblULBranch.intUlBranchID
from tblULBranch where intULBranchGroupID in
(select intULBranchGroupID from tblULBranchGroup where intULCountyID
in
(select intULCountyID from tblULCounty where intULRegionID in
(select intULRegionID from tblULRegion where intULCompanyID in
(select intULCompanyID from tblULCompany where intULCompanyGroupID
in
(select intULCompanyGroupID from tblULCompanyGroup where
intULCorporateID in
(select intlevelvalue from tblUserLevel where intUserProfileID in
(select intUserProfileID from tblUserProfile where intUserLoginID in
("+convert(varchar,@.UID)+"))))))))"
exec(@.BranchIDsql)
End
............
............
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[#LType]') and OBJECTPROPERTY(id, N'IsUserTable') =
1)
drop table [dbo].[#LType]
Thanks in Advance
Munna Kumar Singh
Bangalore
IndiaHi
Your procedure is not returning a result set!
Why are you dropping the BID table, this could cause issues on a multiuser
system?
Maybe something like the following (untested!) may be what you want?
ALTER PROCEDURE Test4 @.UID INT,@.varSourceType VARCHAR(10)=NULL
......
......
AS
SET NOCOUNT ON
DECLARE @.BranchIDsql VARCHAR(1000),@.varleveltype VARCHAR(4)
.....
....
BEGIN
IF EXISTS ( SELECT * FROM
dbo.tbluserlevel UL
JOIN dbo.tblUserProfile UP ON UL.intUserProfileID=UP.intUserProfileID
WHERE UP.intUserLoginID=@.UID
AND LTRIM(RTRIM(UL.varleveltype)) = 'CORP'
)
BEGIN
SELECT DISTINCT B.intUlBranchID
FROM tblULBranch B
JOIN tblULBranchGroup G ON B.intULBranchGroupID = G.intULBranchGroupID
JOIN tblULCounty C ON G.intULCountyID = C.intULCountyID
JOIN tblULRegion R ON R.intULRegionID = C.intULRegionID
JOIN tblULCompany Y ON Y.intULCompanyID = R.intULCompanyID
JOIN tblULCompanyGroup Z ON Y.intULCompanyGroupID = Z.intULCompanyGroupID
JOIN tblUserLevel U ON U.intlevelvalue = Z.intULCorporateID
WHERE U.intUserLoginID = @.UID
END
ELSE
SELECT NULL AS intUlBranchID
END
Check out http://www.aspfaq.com/etiquette.asp?id=5006 on how to post DDL and
example data to get a more precise reply. Also posting expected results from
example data is very useful.
John
<dreammunna@.gmail.com> wrote in message
news:1135665571.048020.288240@.g43g2000cwa.googlegroups.com...
> Hi,
> I am new for the Reporting Services. I need to generate a reports
> based on a stored procedure. When we call the stored procedure it says
> Invalid object name '#LType'. (Microsoft SQL SERVER, Error:208)
> If we see the stored procedure, we find that there is a temporary table
> '#LType' where we are storing the data and applying some condition for
> fatching the records from the table. At the bottom of the stored
> procedure we are also dropping the temporary table.The stored procedure
> looks like:
>
> alter procedure Test4 .
> @.UID int,@.varSourceType varchar(10)=null
> ......
> ......
> as
> set quoted_identifier off
> set nocount on
> declare @.BranchIDsql varchar(1000),@.varleveltype varchar
> .....
> ....
> Begin
> create table <b> #LType (LevelType varchar(4)) </b>
> insert into #LType select ltrim(rtrim(UL.varleveltype)) from
> tbluserlevel UL inner join tblUserProfile UP on
> UL.intUserProfileID=UP.intUserProfileID where UP.intUserLoginID=@.UID
> if exists (select * from dbo.sysobjects where id =
> object_id(N'[dbo].[BID]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
> drop table [dbo].[BID]
> create table BID (intUlBranchID int)
> if ((select count(Leveltype) from #LType where LevelType='CORP')>0)
> Begin
> set @.BranchIDsql="insert into BID select tblULBranch.intUlBranchID
> from tblULBranch where intULBranchGroupID in
> (select intULBranchGroupID from tblULBranchGroup where intULCountyID
> in
> (select intULCountyID from tblULCounty where intULRegionID in
> (select intULRegionID from tblULRegion where intULCompanyID in
> (select intULCompanyID from tblULCompany where intULCompanyGroupID
> in
> (select intULCompanyGroupID from tblULCompanyGroup where
> intULCorporateID in
> (select intlevelvalue from tblUserLevel where intUserProfileID in
> (select intUserProfileID from tblUserProfile where intUserLoginID in
> ("+convert(varchar,@.UID)+"))))))))"
> exec(@.BranchIDsql)
> End
> ............
> ............
> if exists (select * from dbo.sysobjects where id =
> object_id(N'[dbo].[#LType]') and OBJECTPROPERTY(id, N'IsUserTable') =
> 1)
> drop table [dbo].[#LType]
>
> Thanks in Advance
> Munna Kumar Singh
> Bangalore
> India
>

Friday, March 9, 2012

Reporting Service Integration into asp.net application

Hello,

Is it possible to integrate SQL Server 2005 Reporting Services into an asp.net 2.0 application? It would be nice to be able to call these reports from our web application rather than going to a different server to do so.

If it is possible, any good links I can check out?

Thanks in advance.

Matt


Matt,

Yes - you can integrate. I got this from our developer who's handling that for us:

The reports are on a website secured with SSL, with the internet guest account granted browser permissions on each individual report, not on any of the directories.

The integration is just passing the report parameters in a querystring.

The querystring is built like this:

"/ReportServer?/ORSReports/ReportName¶m1=param1val¶m2=param2val"

Hope that helps.

|||

Rippleman,

We use a program called Windward Reports in our application here. It integrates into both ASP.NET and Java, nice in our situation where we do dev work on Windows and deploy to AIX systems.

http://www.windward.net

--TR

Wednesday, March 7, 2012

Reporting Service - print button shown on IE not shown on Firefox

Hi, I have my web application on which I use the ReportViewer to call a Server Report. I fill the report viewer and I see the report correctly on the IE 7, however on the Firefox the Print button does not appear, only the refresh. On the .Net the printButton is set to visible, just on Firefox does not appear...any one had this issue?Thanks a lot for helping!

Our friends at microsoft have decided to make the print function an ActiveX control, supported only by IE

Reporting service

Hi all,

I am new to reporting services.
I have to call the reporting service(some else did this) from the web application that I have created using VB.NET . Not sure how to do it .. was reading few articles on the web .

Any good atricles out there ?

I have created web reference to http://server/ReportServer/ReportService.asmx in my web app. The report expects one parameter .

Below is the code I was starting to write to call the reporting service

Dim rs As New RSWebReference.ReportingService

rs.Credentials = System.Net.CredentialCache.DefaultCredentials

Dim result As Byte

Dim encoding As String

Dim mimetype As String

Dim parameters(2) As Parametervalue()

For some reason I cannot do ParameterValue() it says undefined. I am using Microsoft .NET Framework 1.1 . do I have to use ASP.net2.0 for using reporting services?

ANy way i can get this working

Thanks in advance.

Add an import statement that refers to the ReportService.asmx to the top of your page.

Ex:

Imports <name of your reference>

|||

details, thanks well

Reporting service

Hi all,

I am new to reporting services.
I have to call the reporting service(some else did this) from the web application that I have created using VB.NET . Not sure how to do it .. was reading few articles on the web .

Any good atricles out there ?

I have created web reference to http://server/ReportServer/ReportService.asmx in my web app. The report expects one parameter .

Below is the code I was starting to write to call the reporting service

Dim rs As New RSWebReference.ReportingService

rs.Credentials = System.Net.CredentialCache.DefaultCredentials

Dim result As Byte

Dim encoding As String

Dim mimetype As String

Dim parameters(2) As Parametervalue()

For some reason I cannot do ParameterValue() it says undefined. I am using Microsoft .NET Framework 1.1 . do I have to use ASP.net2.0 for using reporting services?

ANy way i can get this working

Thanks in advance.

Add an import statement that refers to the ReportService.asmx to the top of your page.

Ex:

Imports <name of your reference>

|||

details, thanks well