Wednesday, March 7, 2012
Quick Question
Currently using a frame based design where I have a treeview of all the
reports available and a click on the individual report should open the
reportviewer control in another frame.
Currently facing issues passing the exact URL.
here is how my base URL
newNode.NavigateUrl = "http://server-name/reportserver?" & cirep.Path &
"
Trying passing target but without much luck. Anyway knows how to do it
?
Thanx.
Q2 I know that using frames is generally not preferred.
is there a better way to achieve what i am trying to accomplish with a
treeview or a menu on the Left side and the reportviewer showing up on
the right side ?
Thx
RaviSince frames really aren't supported by the gui in visual studio, I
generally just put the nav and the data on the same page. Network speeds
what they are, it shouldn't be an issue.
Mike G.
"RemoteDeploy" <bofobofo@.yahoo.com> wrote in message
news:1109019748.507926.276380@.c13g2000cwb.googlegroups.com...
> hello I am trying to use the reportviewer control in a custom web app.
> Currently using a frame based design where I have a treeview of all the
> reports available and a click on the individual report should open the
> reportviewer control in another frame.
> Currently facing issues passing the exact URL.
> here is how my base URL
> newNode.NavigateUrl = "http://server-name/reportserver?" & cirep.Path &
> "
> Trying passing target but without much luck. Anyway knows how to do it
> ?
> Thanx.
> Q2 I know that using frames is generally not preferred.
> is there a better way to achieve what i am trying to accomplish with a
> treeview or a menu on the Left side and the reportviewer showing up on
> the right side ?
> Thx
> Ravi
>|||you mean something like using a table or
using different dataregions or rectangles ?|||I mean just putting the report viewer control in an html table.
Mike G.
"RemoteDeploy" <bofobofo@.yahoo.com> wrote in message
news:1109025325.041436.297720@.g14g2000cwa.googlegroups.com...
> you mean something like using a table or
> using different dataregions or rectangles ?
>|||Hello Mike,
Thanks for the info. This is what I am trying to do.
I want a treeview as the navigation on the left and the reportviewer
next to it.
But the issue i am facing is that when I use a treeview, I set the
values to the treeviewnode.navigateUrl and I click on the link to a
report, it is rendering on the whole page.
But When I use a dropdown menu I could make it render to a certain
region like a cell in a Html table. good thing about the dropdown menu
is that there is OnClick Event which I dont seem to have in the
treeview control I downloaded from the Asp.net web controls.
Any hints on how to go about ?
Thankx very much
Ravi|||(Hmmm. I thought I replied to this yesterday, but I don't see it now.
Sorry if this is a dup response.)
I'm not sure I understand how you are rendering the report. Are you
redirecting to a url, using the render method...? Also, do you know about
the report viewer control?
Mike G.
"RemoteDeploy" <bofobofo@.yahoo.com> wrote in message
news:1109038650.929162.40500@.c13g2000cwb.googlegroups.com...
> Hello Mike,
> Thanks for the info. This is what I am trying to do.
> I want a treeview as the navigation on the left and the reportviewer
> next to it.
> But the issue i am facing is that when I use a treeview, I set the
> values to the treeviewnode.navigateUrl and I click on the link to a
> report, it is rendering on the whole page.
> But When I use a dropdown menu I could make it render to a certain
> region like a cell in a Html table. good thing about the dropdown menu
> is that there is OnClick Event which I dont seem to have in the
> treeview control I downloaded from the Asp.net web controls.
> Any hints on how to go about ?
> Thankx very much
> Ravi
>|||I am using the reportviewer control. It may sound stupid but my exact
problem has been how do I tie the reportviewer control to a node in the
treeview.
I am using the treenode.navigateUrl property to set the url, which is
causing it to render it all over the screen.
I dont have this problem when I use a dropdown menu of reports and a Go
button. I use the Onclick event of the go button to set the properties
to the reportviewer control.
Thx
Ravi|||Ok, so you're passing the url of the report to the treeview control?
Instead, the navigateurl should be to the same page (like a postback) and
set the querystring to be the value of the report you're trying to view
(navigateurl = samepage.aspx?report=" & reportvar). (of course, instead of
a querystring you could use the viewstate object or a session object or
.... ) On the load event of the page, check if there is a value in the
querystring, and if so set the property of the reportviewer.
Was that vague enough?
Mike G.
"RemoteDeploy" <bofobofo@.yahoo.com> wrote in message
news:1109087785.988437.208740@.o13g2000cwo.googlegroups.com...
>I am using the reportviewer control. It may sound stupid but my exact
> problem has been how do I tie the reportviewer control to a node in the
> treeview.
> I am using the treenode.navigateUrl property to set the url, which is
> causing it to render it all over the screen.
> I dont have this problem when I use a dropdown menu of reports and a Go
> button. I use the Onclick event of the go button to set the properties
> to the reportviewer control.
> Thx
> Ravi
>|||Hey Mike,
here is the URL i am passing to the navigateUrl property of the
Treenodes.
This posts the report to the same page. But it doesnt render in the
reportviewer control object I have in a html table in the same page,
which i am trying to achieve.
http://servername/reportserver?/folder/report1&rs:Command=Render&rc:zoom=75&rc:toolbar=true
thx
ravi|||Maybe I don't understand: How are you rendering the report? It sounds like
you are either redirecting the user to the report page or using the render
method of the web service?
Do you know about the asp.net report viewer control?
Mike
"RemoteDeploy" <bofobofo@.yahoo.com> wrote in message
news:1109038650.929162.40500@.c13g2000cwb.googlegroups.com...
> Hello Mike,
> Thanks for the info. This is what I am trying to do.
> I want a treeview as the navigation on the left and the reportviewer
> next to it.
> But the issue i am facing is that when I use a treeview, I set the
> values to the treeviewnode.navigateUrl and I click on the link to a
> report, it is rendering on the whole page.
> But When I use a dropdown menu I could make it render to a certain
> region like a cell in a Html table. good thing about the dropdown menu
> is that there is OnClick Event which I dont seem to have in the
> treeview control I downloaded from the Asp.net web controls.
> Any hints on how to go about ?
> Thankx very much
> Ravi
>|||This is more of an asp.net question than reporting services, but the url
you're passing to the treeview tells it where to navigate. You're telling
it to navigate away from your page and to the report page. Instead, the
link should be closer to:
http://server/path/nameofcurrentpage.aspx?report=report1
you then have to have code on nameofcurrentpage.aspx that retrieves the
value from the querystring and changes the property of the report viewer
control appropriately.
For more info, look for docs on querystrings in asp.net.
Mike G.
"RemoteDeploy" <bofobofo@.yahoo.com> wrote in message
news:1109090642.640699.254080@.l41g2000cwc.googlegroups.com...
> Hey Mike,
> here is the URL i am passing to the navigateUrl property of the
> Treenodes.
> This posts the report to the same page. But it doesnt render in the
> reportviewer control object I have in a html table in the same page,
> which i am trying to achieve.
> http://servername/reportserver?/folder/report1&rs:Command=Render&rc:zoom=75&rc:toolbar=true
> thx
> ravi
>|||You can do what you want using a combination of a modified ReportViewer
control and the rc:ReplacementRoot parameter. You can see where we came up
with this idea here:
http://groups-beta.google.com/group/microsoft.public.sqlserver.reportingsvcs/browse_thread/thread/fc71a51d020123ed/a295a0d77da59b6c?q=replacementroot&_done=%2Fgroup%2Fmicrosoft.public.sqlserver.reportingsvcs%2Fsearch%3Fgroup%3Dmicrosoft.public.sqlserver.reportingsvcs%26q%3Dreplacementroot%26qt_g%3D1%26&_doneTitle=Back+to+Search&&d#a295a0d77da59b6c
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"RemoteDeploy" <bofobofo@.yahoo.com> wrote in message
news:1109019748.507926.276380@.c13g2000cwb.googlegroups.com...
> hello I am trying to use the reportviewer control in a custom web app.
> Currently using a frame based design where I have a treeview of all the
> reports available and a click on the individual report should open the
> reportviewer control in another frame.
> Currently facing issues passing the exact URL.
> here is how my base URL
> newNode.NavigateUrl = "http://server-name/reportserver?" & cirep.Path &
> "
> Trying passing target but without much luck. Anyway knows how to do it
> ?
> Thanx.
> Q2 I know that using frames is generally not preferred.
> is there a better way to achieve what i am trying to accomplish with a
> treeview or a menu on the Left side and the reportviewer showing up on
> the right side ?
> Thx
> Ravi
>|||Hello jeff,
I have modified the reportviewer code adding your code and created the
new dll.
I also added the rc:ReplacementRoot = MyIframe in the Build URl string
method.
Do I need to do that ?
But when I actually ran the app with the new reportviewer DLL (removed
the old and added new reference to reportviewer, just to be sure) it is
still opening the drillthrough reports in a different Browser window.
And I dont see the rc:replacementroot part in the URL of the
drillthrough.
Am i missing anything ?
Thanks
Ravi|||Sorry it took so long to get back to you. I answered these questions in
another thread.
By the way, there's not a need to start all these new threads for the same
issue! Now others will have a difficult time finding the answer to your
question, since you started so many different threads on this same issue.
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"RemoteDeploy" <bofobofo@.yahoo.com> wrote in message
news:1109276158.622182.138890@.f14g2000cwb.googlegroups.com...
> Hello jeff,
> I have modified the reportviewer code adding your code and created the
> new dll.
> I also added the rc:ReplacementRoot = MyIframe in the Build URl string
> method.
> Do I need to do that ?
> But when I actually ran the app with the new reportviewer DLL (removed
> the old and added new reference to reportviewer, just to be sure) it is
> still opening the drillthrough reports in a different Browser window.
> And I dont see the rc:replacementroot part in the URL of the
> drillthrough.
> Am i missing anything ?
> Thanks
> Ravi
>
Monday, February 20, 2012
Questions on use of SQL Server 2005 functionality in Gridview Paging
I have a webpage that displays 4000 or more records in a GridView control powered by a SqlDataSource. It's very slow. I'm reading the following article on custom paging: http://aspnet.4guysfromrolla.com/articles/031506-1.aspx. This article uses an ObjectDataSource, and some functionality new to Sql Server 2005 to implement custom paging.
There is a stored procedure called GetEmployeesSubestByDepartmentIDSorted that looks like this:
ALTER PROCEDURE dbo.GetEmployeesSubsetByDepartmentIDSorted
(
@.DepartmentID int,
@.sortExpression nvarchar(50),
@.startRowIndex int,
@.maximumRows int
)
AS
IF @.DepartmentID IS NULL
-- If @.DepartmentID is null, then we want to get all employees
EXEC dbo.GetEmployeesSubsetSorted @.sortExpression, @.startRowIndex, @.maximumRows
ELSE
BEGIN
-- Otherwise we want to get just those employees in the specified department
IF LEN(@.sortExpression) = 0
SET @.sortExpression = 'EmployeeID'-- Since @.startRowIndex is zero-based in the data Web control, but one-based w/ROW_NUMBER(), increment
SET @.startRowIndex = @.startRowIndex + 1-- Issue query
DECLARE @.sql nvarchar(4000)
SET @.sql = 'SELECT EmployeeID, LastName, FirstName, DepartmentID, Salary,
HireDate, DepartmentName
FROM
(SELECT EmployeeID, LastName, FirstName, e.DepartmentID, Salary,
HireDate, d.Name as DepartmentName,
ROW_NUMBER() OVER(ORDER BY ' + @.sortExpression + ') as RowNum
FROM Employees e
INNER JOIN Departments d ON
e.DepartmentID = d.DepartmentID
WHERE e.DepartmentID = ' + CONVERT(nvarchar(10), @.DepartmentID) + '
) as EmpInfo
WHERE RowNum BETWEEN ' + CONVERT(nvarchar(10), @.startRowIndex) +
' AND (' + CONVERT(nvarchar(10), @.startRowIndex) + ' + '
+ CONVERT(nvarchar(10), @.maximumRows) + ') - 1'
-- Execute the SQL query
EXEC sp_executesql @.sql
END
The part that's bold is the part I don't understand. Can someone shed some light on this for me? What is this doing and why?
Diane
"ROW_NUMBER() OVER(ORDER BY ' + @.sortExpression + ') as RowNum" part is generating the row number by sorting the data on sortExpression and fetching the data from employee and department. It also doing the paging on the backend side based on the row#
Check this for easy understanding:http://www.davidhayden.com/blog/dave/archive/2005/12/30/2652.aspx
|||
Thank you, I have a better understanding of this, but I'm still not sure how to use it. I want to return all the fields in the table. Will this work?
SET @.sql = 'SELECT <full fields list>
FROM (SELECT <full field list>, ROW_NUMBER() OVER(ORDER BY ' + @.sortExpression + ') as RowNum FROM <table> WHERE <condition>)
as tblinfo
WHERE RowNum BETWEEN ' + CONVERT(nvarchar(10), @.startRowIndex) + ' AND (' + CONVERT(nvarchar(10), @.startRowIndex) + ' + ' + CONVERT(nvarchar(10), @.maximumRows) + ') - 1'
Is this creating a table in a table? The article didn't explain why there's a select statement inside the from?
Diane
|||This is the subquery. There are # of aricle on the same subject.
http://www.aspfree.com/c/a/MS-SQL-Server/Subqueries-and-Query-Expressions/
|||
Thank you. I got the query and sub query to work. Now my problem is that it will return the expected data when I preview it, but the gridview shows no data.
Diane