473,399 Members | 3,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Intergrating SQL Server Reporting Services into an ASP.NET app


I'm trying to integrate SQL Server Reporting Services reports into an
ASP.NET app (SRS 2000, ASP.NET 1.1). I know how to do this using direct URL
addressing, but this exposes in the query string parameters that should not
be exposed. Each user is associated with a school, and should see only that
school's data. When the user logs in, I retrieve the SchoolID associated
with that user, and that SchoolID is used as a parameter in all stored
procedures to return only that school's data. It is this SchoolID that needs
to be passed to the report. It doesn't matter if users see the SchoolID, but
they must not be able to change the SchoolID, as they can if it forms part
of the URL.

From the documentation and from previous discussions in the SRS newsgroup,
it appears that there are four possible solutions to this:

1) Wait for SRS 2005 which I understand is due in November.

2) Use the web service instead of URL access and write a lot of code to
provide functionality you get built-in when using URL access.

3) Use URL access through a form POST method, as suggested in SRS Books
Online
(http://msdn.microsoft.com/library/en...intro_35pi.asp)

4) Require users to log in again when accessing reports, despite having
already logged in to the ASP.NET app. The report would prompt the user for
user name and password, and pass these to the stored procedures instead of
the SchoolID. This would avoid having to pass the SchoolID from the ASP.NET
app to the reports, but I'm not sure that the users will accept the
inconvenience. (The passwords are of course stored in encrypted form, so
I'll need to add code to the reports to encrypt the password supplied by the
user, but that's a separate issue.)

My questions are:

1) Can anyone confirm that the next version really does solve this problem?

2) Any pointers to resources on using the web service, particularly on how
to control rendering and how to reproduce the functionality of the toolbar
you get when using URL access, would be welcome. (I already know about SRS
Books Online and the articles reachable from the MSDN SQL Server Developer
Center).

3) Can I use the POST method as suggested in SRS Books Online from within an
ASP.NET app? I thought an ASP.NET page could only post back to itself, is
that not so?

Please don't feel that you have to have answers to all of these questions
before responding - suggestions or advice regarding any part of the problem
would be most welcome.

--
Brendan Reynolds
Nov 19 '05 #1
8 3087
Brendan Reynolds wrote:

5). Do the users call the report with their own credentials? If yes you
could read the username via USER!UserID and pass that to the database where
you hopefully have a table with mapping SchoolID <-> Username.

regards

frank
Nov 19 '05 #2
Rob
hi brendan

here's the solution I used (with a little bit of verbage to describe my
scenario):

1. I've built an ASP.NET site (in addition to the regular SSRS interface for
reports).
2. This addition site looks almost like the browser interface for this
discussion group (ie. Treeview control on the left which groups 'like'
reports and an iframe right half which brings up the report criteria form
associated with the selected report, from the Treeview control on the left).
3. on 'View Report' click from the iframed report(s) criteria page, I do the
following in ASP.NET:

Dim popupScript As String = "<script language='javascript'>"
& _
"var newwin =
window.open('ReportViewer.aspx?id=myreportid&qs=my querystring',
'ReportViewer', 'menubar=no, toolbar=no, resizable=no');
newwin.window.moveTo(0,0);
newwin.window.resizeTo(screen.availWidth,screen.av ailHeight);
newwin.focus();</script>"
Page.RegisterStartupScript("PopupScript", popupScript)

4. This opens up ReportViewer.aspx which iframes the call to SSRS. The
benefits of this is different report interfaces can be built on differents
sites AND there are no issue with this approach as far as 'cross-site
scripting'. For instance, my financial group has the own SSRS ASP.NET
interface, as well as other groups... They ALL point in the pop-up to the
SSRS site and get a previewed report (with report parameter fields if they
want to make changes). Also, ReportViewer.aspx changes the iframe src value
to what was passed to it from the reportcriteria .aspx.

5. Since the way the pop-up is created, there's no URL Address info and the
ReportViewer.aspx masks the URL by replacing the title.

Rob

"Brendan Reynolds" wrote:

I'm trying to integrate SQL Server Reporting Services reports into an
ASP.NET app (SRS 2000, ASP.NET 1.1). I know how to do this using direct URL
addressing, but this exposes in the query string parameters that should not
be exposed. Each user is associated with a school, and should see only that
school's data. When the user logs in, I retrieve the SchoolID associated
with that user, and that SchoolID is used as a parameter in all stored
procedures to return only that school's data. It is this SchoolID that needs
to be passed to the report. It doesn't matter if users see the SchoolID, but
they must not be able to change the SchoolID, as they can if it forms part
of the URL.

From the documentation and from previous discussions in the SRS newsgroup,
it appears that there are four possible solutions to this:

1) Wait for SRS 2005 which I understand is due in November.

2) Use the web service instead of URL access and write a lot of code to
provide functionality you get built-in when using URL access.

3) Use URL access through a form POST method, as suggested in SRS Books
Online
(http://msdn.microsoft.com/library/en...intro_35pi.asp)

4) Require users to log in again when accessing reports, despite having
already logged in to the ASP.NET app. The report would prompt the user for
user name and password, and pass these to the stored procedures instead of
the SchoolID. This would avoid having to pass the SchoolID from the ASP.NET
app to the reports, but I'm not sure that the users will accept the
inconvenience. (The passwords are of course stored in encrypted form, so
I'll need to add code to the reports to encrypt the password supplied by the
user, but that's a separate issue.)

My questions are:

1) Can anyone confirm that the next version really does solve this problem?

2) Any pointers to resources on using the web service, particularly on how
to control rendering and how to reproduce the functionality of the toolbar
you get when using URL access, would be welcome. (I already know about SRS
Books Online and the articles reachable from the MSDN SQL Server Developer
Center).

3) Can I use the POST method as suggested in SRS Books Online from within an
ASP.NET app? I thought an ASP.NET page could only post back to itself, is
that not so?

Please don't feel that you have to have answers to all of these questions
before responding - suggestions or advice regarding any part of the problem
would be most welcome.

--
Brendan Reynolds

Nov 19 '05 #3
They don't, but I could change that. Thanks for the suggestion, I'll look
into it.

--
Brendan Reynolds
"Frank Matthiesen" <fm@xax.de> wrote in message
news:3m*************@individual.net...
Brendan Reynolds wrote:

5). Do the users call the report with their own credentials? If yes you
could read the username via USER!UserID and pass that to the database
where you hopefully have a table with mapping SchoolID <-> Username.

regards

frank

Nov 19 '05 #4
Thanks Rob. That looks promising. Unfortunately, my client-side scripting
skills are almost non-existent, and I'm having a hard time getting to grips
with this. Here's what I've done so far ...

I have an ASP.NET page with a listbox that displays available reports and a
literal control for the iframe. Here's the relevant part of the page's HTML
....

<TR>
<TD style="HEIGHT: 251px" vAlign="top" width="50%">
<asp:ListBox id="lstReports" runat="server" Width="100%"
Height="295px" AutoPostBack="True">
</asp:ListBox>
</TD>
<TD style="HEIGHT: 251px" vAlign="top" width="50%">
<asp:Literal id="MyLiteral" runat="server">
<IFRAME id="MyIFrame"></IFRAME>
</asp:Literal>
</TD>
</TR>

I've translated your code into C#, which is what my page is using, and put
it in the SelectedIndexChanged event procedure of my listbox ...

private void lstReports_SelectedIndexChanged(object sender, System.EventArgs
e)
{
string popupScript = @"<script language='javascript'> "
+ @"var newwin = window.open('ReportViewer.aspx?"
+ @"id=myreportid&qs=myquerystring', 'ReportViewer', "
+ @"'menubar=no, toolbar=no, resizable=no'); "
+ @"newwin.window.moveTo(0,0); newwin.window.resizeTo"
+ @"(screen.availWidth, screen.availHeight);"
+ @"newwin.focus();<script>";
this.RegisterStartupScript("PopupScript", popupScript);
}

My first question is - what do I need to change to load 'ReportViewer.aspx'
into the iframe?

--
Brendan Reynolds (MVP)
"Rob" <Ro*@discussions.microsoft.com> wrote in message
news:B4**********************************@microsof t.com...
hi brendan

here's the solution I used (with a little bit of verbage to describe my
scenario):

1. I've built an ASP.NET site (in addition to the regular SSRS interface
for
reports).
2. This addition site looks almost like the browser interface for this
discussion group (ie. Treeview control on the left which groups 'like'
reports and an iframe right half which brings up the report criteria form
associated with the selected report, from the Treeview control on the
left).
3. on 'View Report' click from the iframed report(s) criteria page, I do
the
following in ASP.NET:

Dim popupScript As String = "<script
language='javascript'>"
& _
"var newwin =
window.open('ReportViewer.aspx?id=myreportid&qs=my querystring',
'ReportViewer', 'menubar=no, toolbar=no, resizable=no');
newwin.window.moveTo(0,0);
newwin.window.resizeTo(screen.availWidth,screen.av ailHeight);
newwin.focus();</script>"
Page.RegisterStartupScript("PopupScript", popupScript)

4. This opens up ReportViewer.aspx which iframes the call to SSRS. The
benefits of this is different report interfaces can be built on differents
sites AND there are no issue with this approach as far as 'cross-site
scripting'. For instance, my financial group has the own SSRS ASP.NET
interface, as well as other groups... They ALL point in the pop-up to the
SSRS site and get a previewed report (with report parameter fields if they
want to make changes). Also, ReportViewer.aspx changes the iframe src
value
to what was passed to it from the reportcriteria .aspx.

5. Since the way the pop-up is created, there's no URL Address info and
the
ReportViewer.aspx masks the URL by replacing the title.

Rob

"Brendan Reynolds" wrote:

I'm trying to integrate SQL Server Reporting Services reports into an
ASP.NET app (SRS 2000, ASP.NET 1.1). I know how to do this using direct
URL
addressing, but this exposes in the query string parameters that should
not
be exposed. Each user is associated with a school, and should see only
that
school's data. When the user logs in, I retrieve the SchoolID associated
with that user, and that SchoolID is used as a parameter in all stored
procedures to return only that school's data. It is this SchoolID that
needs
to be passed to the report. It doesn't matter if users see the SchoolID,
but
they must not be able to change the SchoolID, as they can if it forms
part
of the URL.

From the documentation and from previous discussions in the SRS
newsgroup,
it appears that there are four possible solutions to this:

1) Wait for SRS 2005 which I understand is due in November.

2) Use the web service instead of URL access and write a lot of code to
provide functionality you get built-in when using URL access.

3) Use URL access through a form POST method, as suggested in SRS Books
Online
(http://msdn.microsoft.com/library/en...intro_35pi.asp)

4) Require users to log in again when accessing reports, despite having
already logged in to the ASP.NET app. The report would prompt the user
for
user name and password, and pass these to the stored procedures instead
of
the SchoolID. This would avoid having to pass the SchoolID from the
ASP.NET
app to the reports, but I'm not sure that the users will accept the
inconvenience. (The passwords are of course stored in encrypted form, so
I'll need to add code to the reports to encrypt the password supplied by
the
user, but that's a separate issue.)

My questions are:

1) Can anyone confirm that the next version really does solve this
problem?

2) Any pointers to resources on using the web service, particularly on
how
to control rendering and how to reproduce the functionality of the
toolbar
you get when using URL access, would be welcome. (I already know about
SRS
Books Online and the articles reachable from the MSDN SQL Server
Developer
Center).

3) Can I use the POST method as suggested in SRS Books Online from within
an
ASP.NET app? I thought an ASP.NET page could only post back to itself, is
that not so?

Please don't feel that you have to have answers to all of these questions
before responding - suggestions or advice regarding any part of the
problem
would be most welcome.

--
Brendan Reynolds

Nov 19 '05 #5
As an aside, we happen to use an implementation in which users do in
fact have to authenticate a second time in order to request a report.
It has had but a minor impact on users in our experience, generating no
complaints. I wouldn't rule out that possibility for fear of user
backlash.

Brendan Reynolds wrote:
Thanks Rob. That looks promising. Unfortunately, my client-side scripting
skills are almost non-existent, and I'm having a hard time getting to grips
with this. Here's what I've done so far ...

I have an ASP.NET page with a listbox that displays available reports and a
literal control for the iframe. Here's the relevant part of the page's HTML
...

<TR>
<TD style="HEIGHT: 251px" vAlign="top" width="50%">
<asp:ListBox id="lstReports" runat="server" Width="100%"
Height="295px" AutoPostBack="True">
</asp:ListBox>
</TD>
<TD style="HEIGHT: 251px" vAlign="top" width="50%">
<asp:Literal id="MyLiteral" runat="server">
<IFRAME id="MyIFrame"></IFRAME>
</asp:Literal>
</TD>
</TR>

I've translated your code into C#, which is what my page is using, and put
it in the SelectedIndexChanged event procedure of my listbox ...

private void lstReports_SelectedIndexChanged(object sender, System.EventArgs
e)
{
string popupScript = @"<script language='javascript'> "
+ @"var newwin = window.open('ReportViewer.aspx?"
+ @"id=myreportid&qs=myquerystring', 'ReportViewer', "
+ @"'menubar=no, toolbar=no, resizable=no'); "
+ @"newwin.window.moveTo(0,0); newwin.window.resizeTo"
+ @"(screen.availWidth, screen.availHeight);"
+ @"newwin.focus();<script>";
this.RegisterStartupScript("PopupScript", popupScript);
}

My first question is - what do I need to change to load 'ReportViewer.aspx'
into the iframe?

--
Brendan Reynolds (MVP)
"Rob" <Ro*@discussions.microsoft.com> wrote in message
news:B4**********************************@microsof t.com...
hi brendan

here's the solution I used (with a little bit of verbage to describe my
scenario):

1. I've built an ASP.NET site (in addition to the regular SSRS interface
for
reports).
2. This addition site looks almost like the browser interface for this
discussion group (ie. Treeview control on the left which groups 'like'
reports and an iframe right half which brings up the report criteria form
associated with the selected report, from the Treeview control on the
left).
3. on 'View Report' click from the iframed report(s) criteria page, I do
the
following in ASP.NET:

Dim popupScript As String = "<script
language='javascript'>"
& _
"var newwin =
window.open('ReportViewer.aspx?id=myreportid&qs=my querystring',
'ReportViewer', 'menubar=no, toolbar=no, resizable=no');
newwin.window.moveTo(0,0);
newwin.window.resizeTo(screen.availWidth,screen.av ailHeight);
newwin.focus();</script>"
Page.RegisterStartupScript("PopupScript", popupScript)

4. This opens up ReportViewer.aspx which iframes the call to SSRS. The
benefits of this is different report interfaces can be built on differents
sites AND there are no issue with this approach as far as 'cross-site
scripting'. For instance, my financial group has the own SSRS ASP.NET
interface, as well as other groups... They ALL point in the pop-up to the
SSRS site and get a previewed report (with report parameter fields if they
want to make changes). Also, ReportViewer.aspx changes the iframe src
value
to what was passed to it from the reportcriteria .aspx.

5. Since the way the pop-up is created, there's no URL Address info and
the
ReportViewer.aspx masks the URL by replacing the title.

Rob

"Brendan Reynolds" wrote:

I'm trying to integrate SQL Server Reporting Services reports into an
ASP.NET app (SRS 2000, ASP.NET 1.1). I know how to do this using direct
URL
addressing, but this exposes in the query string parameters that should
not
be exposed. Each user is associated with a school, and should see only
that
school's data. When the user logs in, I retrieve the SchoolID associated
with that user, and that SchoolID is used as a parameter in all stored
procedures to return only that school's data. It is this SchoolID that
needs
to be passed to the report. It doesn't matter if users see the SchoolID,
but
they must not be able to change the SchoolID, as they can if it forms
part
of the URL.

From the documentation and from previous discussions in the SRS
newsgroup,
it appears that there are four possible solutions to this:

1) Wait for SRS 2005 which I understand is due in November.

2) Use the web service instead of URL access and write a lot of code to
provide functionality you get built-in when using URL access.

3) Use URL access through a form POST method, as suggested in SRS Books
Online
(http://msdn.microsoft.com/library/en...intro_35pi.asp)

4) Require users to log in again when accessing reports, despite having
already logged in to the ASP.NET app. The report would prompt the user
for
user name and password, and pass these to the stored procedures instead
of
the SchoolID. This would avoid having to pass the SchoolID from the
ASP.NET
app to the reports, but I'm not sure that the users will accept the
inconvenience. (The passwords are of course stored in encrypted form, so
I'll need to add code to the reports to encrypt the password supplied by
the
user, but that's a separate issue.)

My questions are:

1) Can anyone confirm that the next version really does solve this
problem?

2) Any pointers to resources on using the web service, particularly on
how
to control rendering and how to reproduce the functionality of the
toolbar
you get when using URL access, would be welcome. (I already know about
SRS
Books Online and the articles reachable from the MSDN SQL Server
Developer
Center).

3) Can I use the POST method as suggested in SRS Books Online from within
an
ASP.NET app? I thought an ASP.NET page could only post back to itself, is
that not so?

Please don't feel that you have to have answers to all of these questions
before responding - suggestions or advice regarding any part of the
problem
would be most welcome.

--
Brendan Reynolds


Nov 19 '05 #6
Rob
hi

(hopefully, this sample code will make it thru to the forum)

ReportViewer.codebehind (relevant part)...

Private Sub ViewReport(ByVal key As String, ByVal reporttype As String)
Dim iReportViewer As HtmlControl =
CType(Me.FindControl("iReportViewer"), HtmlControl)
Dim rptid As String = Request.QueryString("id")
Dim qs As String = Request.QueryString("qs")
Select Case rptid
Case (this is my report number, ie. "id")
Case (whatever the report # is....)
Case 808 ' my Build Schedule Report
If qs = "All" Then ' they f'd up using All, can't be quoted...
iReportViewer.Attributes("src") =
"http://localhost/ReportServer?%2f8_Build_Schedule%2frptBuildSchedul e_8&BMP=All&rs:Command=Render"
Else
iReportViewer.Attributes("src") =
"http://localhost/ReportServer?%2f8_Build_Schedule%2frptBuildSchedul e_8&BMP='" + qs + "'&rs:Command=Render"
End If
iReportViewer.Attributes("width") = "100%"
iReportViewer.Attributes("height") = "100%"
Case Else
' your exception code
End Select
End Sub

Shell of what you need for ReportViewer.aspx

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="ReportViewer.aspx.vb" Inherits="Robs.ReportViewer"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>My Little Report Viewer - House or Horror</title>
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<iframe runat="server" id="iReportViewer" style="BACKGROUND-COLOR:
#990000" name="doc" frameBorder="no"
width="100%" scrolling="auto" height="100%"></iframe>
</body>
</HTML>

That's it...

If you have AD for authentication, it'll take what you have (if SSRS
configured). When I play at home, it puts an 'in my face' login (since I'm
not running AD at home).

Good Luck - Rob

"Brendan Reynolds" wrote:
Thanks Rob. That looks promising. Unfortunately, my client-side scripting
skills are almost non-existent, and I'm having a hard time getting to grips
with this. Here's what I've done so far ...

I have an ASP.NET page with a listbox that displays available reports and a
literal control for the iframe. Here's the relevant part of the page's HTML
....

<TR>
<TD style="HEIGHT: 251px" vAlign="top" width="50%">
<asp:ListBox id="lstReports" runat="server" Width="100%"
Height="295px" AutoPostBack="True">
</asp:ListBox>
</TD>
<TD style="HEIGHT: 251px" vAlign="top" width="50%">
<asp:Literal id="MyLiteral" runat="server">
<IFRAME id="MyIFrame"></IFRAME>
</asp:Literal>
</TD>
</TR>

I've translated your code into C#, which is what my page is using, and put
it in the SelectedIndexChanged event procedure of my listbox ...

private void lstReports_SelectedIndexChanged(object sender, System.EventArgs
e)
{
string popupScript = @"<script language='javascript'> "
+ @"var newwin = window.open('ReportViewer.aspx?"
+ @"id=myreportid&qs=myquerystring', 'ReportViewer', "
+ @"'menubar=no, toolbar=no, resizable=no'); "
+ @"newwin.window.moveTo(0,0); newwin.window.resizeTo"
+ @"(screen.availWidth, screen.availHeight);"
+ @"newwin.focus();<script>";
this.RegisterStartupScript("PopupScript", popupScript);
}

My first question is - what do I need to change to load 'ReportViewer.aspx'
into the iframe?

--
Brendan Reynolds (MVP)
"Rob" <Ro*@discussions.microsoft.com> wrote in message
news:B4**********************************@microsof t.com...
hi brendan

here's the solution I used (with a little bit of verbage to describe my
scenario):

1. I've built an ASP.NET site (in addition to the regular SSRS interface
for
reports).
2. This addition site looks almost like the browser interface for this
discussion group (ie. Treeview control on the left which groups 'like'
reports and an iframe right half which brings up the report criteria form
associated with the selected report, from the Treeview control on the
left).
3. on 'View Report' click from the iframed report(s) criteria page, I do
the
following in ASP.NET:

Dim popupScript As String = "<script
language='javascript'>"
& _
"var newwin =
window.open('ReportViewer.aspx?id=myreportid&qs=my querystring',
'ReportViewer', 'menubar=no, toolbar=no, resizable=no');
newwin.window.moveTo(0,0);
newwin.window.resizeTo(screen.availWidth,screen.av ailHeight);
newwin.focus();</script>"
Page.RegisterStartupScript("PopupScript", popupScript)

4. This opens up ReportViewer.aspx which iframes the call to SSRS. The
benefits of this is different report interfaces can be built on differents
sites AND there are no issue with this approach as far as 'cross-site
scripting'. For instance, my financial group has the own SSRS ASP.NET
interface, as well as other groups... They ALL point in the pop-up to the
SSRS site and get a previewed report (with report parameter fields if they
want to make changes). Also, ReportViewer.aspx changes the iframe src
value
to what was passed to it from the reportcriteria .aspx.

5. Since the way the pop-up is created, there's no URL Address info and
the
ReportViewer.aspx masks the URL by replacing the title.

Rob

"Brendan Reynolds" wrote:

I'm trying to integrate SQL Server Reporting Services reports into an
ASP.NET app (SRS 2000, ASP.NET 1.1). I know how to do this using direct
URL
addressing, but this exposes in the query string parameters that should
not
be exposed. Each user is associated with a school, and should see only
that
school's data. When the user logs in, I retrieve the SchoolID associated
with that user, and that SchoolID is used as a parameter in all stored
procedures to return only that school's data. It is this SchoolID that
needs
to be passed to the report. It doesn't matter if users see the SchoolID,
but
they must not be able to change the SchoolID, as they can if it forms
part
of the URL.

From the documentation and from previous discussions in the SRS
newsgroup,
it appears that there are four possible solutions to this:

1) Wait for SRS 2005 which I understand is due in November.

2) Use the web service instead of URL access and write a lot of code to
provide functionality you get built-in when using URL access.

3) Use URL access through a form POST method, as suggested in SRS Books
Online
(http://msdn.microsoft.com/library/en...intro_35pi.asp)

4) Require users to log in again when accessing reports, despite having
already logged in to the ASP.NET app. The report would prompt the user
for
user name and password, and pass these to the stored procedures instead
of
the SchoolID. This would avoid having to pass the SchoolID from the
ASP.NET
app to the reports, but I'm not sure that the users will accept the
inconvenience. (The passwords are of course stored in encrypted form, so
I'll need to add code to the reports to encrypt the password supplied by
the
user, but that's a separate issue.)

My questions are:

1) Can anyone confirm that the next version really does solve this
problem?

2) Any pointers to resources on using the web service, particularly on
how
to control rendering and how to reproduce the functionality of the
toolbar
you get when using URL access, would be welcome. (I already know about
SRS
Books Online and the articles reachable from the MSDN SQL Server
Developer
Center).

3) Can I use the POST method as suggested in SRS Books Online from within
an
ASP.NET app? I thought an ASP.NET page could only post back to itself, is
that not so?

Please don't feel that you have to have answers to all of these questions
before responding - suggestions or advice regarding any part of the
problem
would be most welcome.

--
Brendan Reynolds


Nov 19 '05 #7
Thanks Ernie. What about the encryption? The passwords are stored in
encrypted form in the database, so I can't just let the report prompt for
the password as an ordinary report parameter - it has to prompt for it, then
encrypt it, then assign that encrypted value to the report parameter. I know
how to do the encryption, what I don't know is how to 'intercept' the
parameter?

--
Brendan Reynolds

"Ernie Gutierrez" <eg********@ttwireless.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
As an aside, we happen to use an implementation in which users do in
fact have to authenticate a second time in order to request a report.
It has had but a minor impact on users in our experience, generating no
complaints. I wouldn't rule out that possibility for fear of user
backlash.

Brendan Reynolds wrote:
Thanks Rob. That looks promising. Unfortunately, my client-side scripting
skills are almost non-existent, and I'm having a hard time getting to
grips
with this. Here's what I've done so far ...

I have an ASP.NET page with a listbox that displays available reports and
a
literal control for the iframe. Here's the relevant part of the page's
HTML
...

<TR>
<TD style="HEIGHT: 251px" vAlign="top" width="50%">
<asp:ListBox id="lstReports" runat="server" Width="100%"
Height="295px" AutoPostBack="True">
</asp:ListBox>
</TD>
<TD style="HEIGHT: 251px" vAlign="top" width="50%">
<asp:Literal id="MyLiteral" runat="server">
<IFRAME id="MyIFrame"></IFRAME>
</asp:Literal>
</TD>
</TR>

I've translated your code into C#, which is what my page is using, and
put
it in the SelectedIndexChanged event procedure of my listbox ...

private void lstReports_SelectedIndexChanged(object sender,
System.EventArgs
e)
{
string popupScript = @"<script language='javascript'> "
+ @"var newwin = window.open('ReportViewer.aspx?"
+ @"id=myreportid&qs=myquerystring', 'ReportViewer', "
+ @"'menubar=no, toolbar=no, resizable=no'); "
+ @"newwin.window.moveTo(0,0); newwin.window.resizeTo"
+ @"(screen.availWidth, screen.availHeight);"
+ @"newwin.focus();<script>";
this.RegisterStartupScript("PopupScript", popupScript);
}

My first question is - what do I need to change to load
'ReportViewer.aspx'
into the iframe?

--
Brendan Reynolds (MVP)
"Rob" <Ro*@discussions.microsoft.com> wrote in message
news:B4**********************************@microsof t.com...
> hi brendan
>
> here's the solution I used (with a little bit of verbage to describe my
> scenario):
>
> 1. I've built an ASP.NET site (in addition to the regular SSRS
> interface
> for
> reports).
> 2. This addition site looks almost like the browser interface for this
> discussion group (ie. Treeview control on the left which groups 'like'
> reports and an iframe right half which brings up the report criteria
> form
> associated with the selected report, from the Treeview control on the
> left).
> 3. on 'View Report' click from the iframed report(s) criteria page, I
> do
> the
> following in ASP.NET:
>
> Dim popupScript As String = "<script
> language='javascript'>"
> & _
> "var newwin =
> window.open('ReportViewer.aspx?id=myreportid&qs=my querystring',
> 'ReportViewer', 'menubar=no, toolbar=no, resizable=no');
> newwin.window.moveTo(0,0);
> newwin.window.resizeTo(screen.availWidth,screen.av ailHeight);
> newwin.focus();</script>"
> Page.RegisterStartupScript("PopupScript", popupScript)
>
> 4. This opens up ReportViewer.aspx which iframes the call to SSRS. The
> benefits of this is different report interfaces can be built on
> differents
> sites AND there are no issue with this approach as far as 'cross-site
> scripting'. For instance, my financial group has the own SSRS ASP.NET
> interface, as well as other groups... They ALL point in the pop-up to
> the
> SSRS site and get a previewed report (with report parameter fields if
> they
> want to make changes). Also, ReportViewer.aspx changes the iframe src
> value
> to what was passed to it from the reportcriteria .aspx.
>
> 5. Since the way the pop-up is created, there's no URL Address info and
> the
> ReportViewer.aspx masks the URL by replacing the title.
>
> Rob
>
> "Brendan Reynolds" wrote:
>
>>
>> I'm trying to integrate SQL Server Reporting Services reports into an
>> ASP.NET app (SRS 2000, ASP.NET 1.1). I know how to do this using
>> direct
>> URL
>> addressing, but this exposes in the query string parameters that
>> should
>> not
>> be exposed. Each user is associated with a school, and should see only
>> that
>> school's data. When the user logs in, I retrieve the SchoolID
>> associated
>> with that user, and that SchoolID is used as a parameter in all stored
>> procedures to return only that school's data. It is this SchoolID that
>> needs
>> to be passed to the report. It doesn't matter if users see the
>> SchoolID,
>> but
>> they must not be able to change the SchoolID, as they can if it forms
>> part
>> of the URL.
>>
>> From the documentation and from previous discussions in the SRS
>> newsgroup,
>> it appears that there are four possible solutions to this:
>>
>> 1) Wait for SRS 2005 which I understand is due in November.
>>
>> 2) Use the web service instead of URL access and write a lot of code
>> to
>> provide functionality you get built-in when using URL access.
>>
>> 3) Use URL access through a form POST method, as suggested in SRS
>> Books
>> Online
>> (http://msdn.microsoft.com/library/en...intro_35pi.asp)
>>
>> 4) Require users to log in again when accessing reports, despite
>> having
>> already logged in to the ASP.NET app. The report would prompt the user
>> for
>> user name and password, and pass these to the stored procedures
>> instead
>> of
>> the SchoolID. This would avoid having to pass the SchoolID from the
>> ASP.NET
>> app to the reports, but I'm not sure that the users will accept the
>> inconvenience. (The passwords are of course stored in encrypted form,
>> so
>> I'll need to add code to the reports to encrypt the password supplied
>> by
>> the
>> user, but that's a separate issue.)
>>
>> My questions are:
>>
>> 1) Can anyone confirm that the next version really does solve this
>> problem?
>>
>> 2) Any pointers to resources on using the web service, particularly on
>> how
>> to control rendering and how to reproduce the functionality of the
>> toolbar
>> you get when using URL access, would be welcome. (I already know about
>> SRS
>> Books Online and the articles reachable from the MSDN SQL Server
>> Developer
>> Center).
>>
>> 3) Can I use the POST method as suggested in SRS Books Online from
>> within
>> an
>> ASP.NET app? I thought an ASP.NET page could only post back to itself,
>> is
>> that not so?
>>
>> Please don't feel that you have to have answers to all of these
>> questions
>> before responding - suggestions or advice regarding any part of the
>> problem
>> would be most welcome.
>>
>> --
>> Brendan Reynolds
>>
>>
>>

Nov 19 '05 #8

Thanks Rob. That almost works. I can display a report in the IFrame without
exposing the SchoolID to the user. Unfortunately, as soon as the user
chooses to export to PDF or Excel, Internet Explorer opens a new window,
with the SchoolID in the URL. Did I overlook something in your explanation
that would have avoided this?

--
Brendan Reynolds (MVP)

"Rob" <Ro*@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
hi

(hopefully, this sample code will make it thru to the forum)

ReportViewer.codebehind (relevant part)...

Private Sub ViewReport(ByVal key As String, ByVal reporttype As String)
Dim iReportViewer As HtmlControl =
CType(Me.FindControl("iReportViewer"), HtmlControl)
Dim rptid As String = Request.QueryString("id")
Dim qs As String = Request.QueryString("qs")
Select Case rptid
Case (this is my report number, ie. "id")
Case (whatever the report # is....)
Case 808 ' my Build Schedule Report
If qs = "All" Then ' they f'd up using All, can't be
quoted...
iReportViewer.Attributes("src") =
"http://localhost/ReportServer?%2f8_Build_Schedule%2frptBuildSchedul e_8&BMP=All&rs:Command=Render"
Else
iReportViewer.Attributes("src") =
"http://localhost/ReportServer?%2f8_Build_Schedule%2frptBuildSchedul e_8&BMP='"
+ qs + "'&rs:Command=Render"
End If
iReportViewer.Attributes("width") = "100%"
iReportViewer.Attributes("height") = "100%"
Case Else
' your exception code
End Select
End Sub

Shell of what you need for ReportViewer.aspx

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="ReportViewer.aspx.vb" Inherits="Robs.ReportViewer"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>My Little Report Viewer - House or Horror</title>
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<iframe runat="server" id="iReportViewer" style="BACKGROUND-COLOR:
#990000" name="doc" frameBorder="no"
width="100%" scrolling="auto" height="100%"></iframe>
</body>
</HTML>

That's it...

If you have AD for authentication, it'll take what you have (if SSRS
configured). When I play at home, it puts an 'in my face' login (since I'm
not running AD at home).

Good Luck - Rob

"Brendan Reynolds" wrote:
Thanks Rob. That looks promising. Unfortunately, my client-side scripting
skills are almost non-existent, and I'm having a hard time getting to
grips
with this. Here's what I've done so far ...

I have an ASP.NET page with a listbox that displays available reports and
a
literal control for the iframe. Here's the relevant part of the page's
HTML
....

<TR>
<TD style="HEIGHT: 251px" vAlign="top" width="50%">
<asp:ListBox id="lstReports" runat="server" Width="100%"
Height="295px" AutoPostBack="True">
</asp:ListBox>
</TD>
<TD style="HEIGHT: 251px" vAlign="top" width="50%">
<asp:Literal id="MyLiteral" runat="server">
<IFRAME id="MyIFrame"></IFRAME>
</asp:Literal>
</TD>
</TR>

I've translated your code into C#, which is what my page is using, and
put
it in the SelectedIndexChanged event procedure of my listbox ...

private void lstReports_SelectedIndexChanged(object sender,
System.EventArgs
e)
{
string popupScript = @"<script language='javascript'> "
+ @"var newwin = window.open('ReportViewer.aspx?"
+ @"id=myreportid&qs=myquerystring', 'ReportViewer', "
+ @"'menubar=no, toolbar=no, resizable=no'); "
+ @"newwin.window.moveTo(0,0); newwin.window.resizeTo"
+ @"(screen.availWidth, screen.availHeight);"
+ @"newwin.focus();<script>";
this.RegisterStartupScript("PopupScript", popupScript);
}

My first question is - what do I need to change to load
'ReportViewer.aspx'
into the iframe?

--
Brendan Reynolds (MVP)
"Rob" <Ro*@discussions.microsoft.com> wrote in message
news:B4**********************************@microsof t.com...
> hi brendan
>
> here's the solution I used (with a little bit of verbage to describe my
> scenario):
>
> 1. I've built an ASP.NET site (in addition to the regular SSRS
> interface
> for
> reports).
> 2. This addition site looks almost like the browser interface for this
> discussion group (ie. Treeview control on the left which groups 'like'
> reports and an iframe right half which brings up the report criteria
> form
> associated with the selected report, from the Treeview control on the
> left).
> 3. on 'View Report' click from the iframed report(s) criteria page, I
> do
> the
> following in ASP.NET:
>
> Dim popupScript As String = "<script
> language='javascript'>"
> & _
> "var newwin =
> window.open('ReportViewer.aspx?id=myreportid&qs=my querystring',
> 'ReportViewer', 'menubar=no, toolbar=no, resizable=no');
> newwin.window.moveTo(0,0);
> newwin.window.resizeTo(screen.availWidth,screen.av ailHeight);
> newwin.focus();</script>"
> Page.RegisterStartupScript("PopupScript", popupScript)
>
> 4. This opens up ReportViewer.aspx which iframes the call to SSRS. The
> benefits of this is different report interfaces can be built on
> differents
> sites AND there are no issue with this approach as far as 'cross-site
> scripting'. For instance, my financial group has the own SSRS ASP.NET
> interface, as well as other groups... They ALL point in the pop-up to
> the
> SSRS site and get a previewed report (with report parameter fields if
> they
> want to make changes). Also, ReportViewer.aspx changes the iframe src
> value
> to what was passed to it from the reportcriteria .aspx.
>
> 5. Since the way the pop-up is created, there's no URL Address info and
> the
> ReportViewer.aspx masks the URL by replacing the title.
>
> Rob
>
> "Brendan Reynolds" wrote:
>
>>
>> I'm trying to integrate SQL Server Reporting Services reports into an
>> ASP.NET app (SRS 2000, ASP.NET 1.1). I know how to do this using
>> direct
>> URL
>> addressing, but this exposes in the query string parameters that
>> should
>> not
>> be exposed. Each user is associated with a school, and should see only
>> that
>> school's data. When the user logs in, I retrieve the SchoolID
>> associated
>> with that user, and that SchoolID is used as a parameter in all stored
>> procedures to return only that school's data. It is this SchoolID that
>> needs
>> to be passed to the report. It doesn't matter if users see the
>> SchoolID,
>> but
>> they must not be able to change the SchoolID, as they can if it forms
>> part
>> of the URL.
>>
>> From the documentation and from previous discussions in the SRS
>> newsgroup,
>> it appears that there are four possible solutions to this:
>>
>> 1) Wait for SRS 2005 which I understand is due in November.
>>
>> 2) Use the web service instead of URL access and write a lot of code
>> to
>> provide functionality you get built-in when using URL access.
>>
>> 3) Use URL access through a form POST method, as suggested in SRS
>> Books
>> Online
>> (http://msdn.microsoft.com/library/en...intro_35pi.asp)
>>
>> 4) Require users to log in again when accessing reports, despite
>> having
>> already logged in to the ASP.NET app. The report would prompt the user
>> for
>> user name and password, and pass these to the stored procedures
>> instead
>> of
>> the SchoolID. This would avoid having to pass the SchoolID from the
>> ASP.NET
>> app to the reports, but I'm not sure that the users will accept the
>> inconvenience. (The passwords are of course stored in encrypted form,
>> so
>> I'll need to add code to the reports to encrypt the password supplied
>> by
>> the
>> user, but that's a separate issue.)
>>
>> My questions are:
>>
>> 1) Can anyone confirm that the next version really does solve this
>> problem?
>>
>> 2) Any pointers to resources on using the web service, particularly on
>> how
>> to control rendering and how to reproduce the functionality of the
>> toolbar
>> you get when using URL access, would be welcome. (I already know about
>> SRS
>> Books Online and the articles reachable from the MSDN SQL Server
>> Developer
>> Center).
>>
>> 3) Can I use the POST method as suggested in SRS Books Online from
>> within
>> an
>> ASP.NET app? I thought an ASP.NET page could only post back to itself,
>> is
>> that not so?
>>
>> Please don't feel that you have to have answers to all of these
>> questions
>> before responding - suggestions or advice regarding any part of the
>> problem
>> would be most welcome.
>>
>> --
>> Brendan Reynolds
>>
>>
>>


Nov 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: GeekMarine1972 | last post by:
We are planning to deploy the MS Reporting Services. Unfortunately, there isn't much guidance on how to effectively size a server. Here are my questions: 1) In an environment with 1 reporting...
8
by: Woody Splawn | last post by:
I am asking this question here because I asked this question in the Reporting Services Newsgroup and did not get an answer. Does anyone know if Reporting Services is intended to work in a...
1
by: LeAnne | last post by:
I've got SQL Server 2000 Developer edition. Now, where can i get the SQL Server 2000 Reporting Serives from for Win XP Pro?? I can't seem to find a link or any page where I could download this...
16
by: Jeremy S. | last post by:
I'm about to install VS.NET 2005 and SQL Server 2005 on a new/clean development machine (XP Pro/SP2 etc). Is the order of installation important (i.e., which product should I install first)? ...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
1
by: yhafeez1 | last post by:
We are in the process of doing a side by side installation of the SQL server 2000 and SQL server 2005 on the same server. To install the Reporting services feature of SQL server 2005 requires IIS....
3
by: =?Utf-8?B?Sm9uIEphY29icw==?= | last post by:
We use SQL Server 2000 We user VS 2005 How can we use SQL Server reporting Services? Thanks,
0
by: fperri | last post by:
Hi, I am trying to configure reporting services which I just added to an already existing installation of SQL Server 2005. When I am in the reporting services configuration manager and I am trying...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.