ASP.Net ReportingServices & CPU Usage

B

Blasting Cap

I have a report (stored procedure) that I have set up in SQL 2005
Reporting Services. In a web app, I put a Reportviewer control on the
page, and call the report. After a lot of trial & error, it appears to
work.

Sort of.

What happens is when I open it on that tab (I am using AJAX Tab panels,
which had been working fine without this behavior prior to finally
getting the reportviewer working), and the report displays, the "e" on
Internet explorer at the top of the tab now flickers, like the page is
reloading. It also runs the CPU up to 100% on the computer and although
I can go from tab to tab in it (I am using AJAX tab panels in the page),
it will take like up to a minute to go to the next tab. I'm not doing
anything really data-intensive on those tabs, and they had been
functioning fine prior to putting in the report viewer (i.e. they
weren't flickering & clocking the CPU).

I eventually have to kill the page to do anything, because it has the
system up to 100%.

Any idea why reportviewer might make this act this way?

Thanks for the help,
 
C

Cowboy \(Gregory A. Beamer\)

How much data are you churning in RS? The way to tell is look at how much
data is actaully returned from the sproc.

As much as possible, try to filter down your data and do calcs in the sproc,
not in RS. If you return large data sets to RS, you will churn the machine.
 
B

Blasting Cap

That's just it - the data isn't that much.

I'm calling a stored procedure with 5 parameters, and it returns 1588
rows in Query Analyzer, and runs in 5 seconds there. The only
difference in QA and the Reportviewer is that I am subtotaling & grand
totaling 3 columns.

If I try to run this from within the ReportViewer, when launching that
web page, it will run the CPU up to 100% until I kill it. Pages are
extremely sluggish, and it'll take a minute or two to just go between
tabs on those 3 pages. I'm doing a Gridview on one tab, that returns
about 50 records, and a dropdown box on the second tab that returns
about 25 records, and then this one that I'm doing in the Reportviewer.

If I take out the reportviewer, the other two pages work as they should,
in next to no time at all.

Once I add back the reportviewer, the "e" on the Internet Explorer tab
flickers and I can watch the CPU usage on the computer go to 100% and
stay there until I kill the procedure. I can close it out using the X
on internet explorer, but it takes several minutes for the web browser
to detect that I've killed the window.

This is behavior beyond strange.


BC
 
C

Cowboy \(Gregory A. Beamer\)

Try returning the aggregates from the stored procedure and see how that
changes things. It could be that your total calculations are causing issue.

I will have to mull over other possibilities.
 
B

Bruce L-C [MVP]

What happens when you run the report from the web interface using Report
Manager. This will tell you if it is a report issue or an integration issue
with ReportViewer. My guess is that you are telling reportviewer over and
over again to get the report.
 
B

Blasting Cap

Just for giggles, I did another report, basically taking a product
listing, that would return about 100 records, that had some numeric
fields on it, but I didn't do any summing or totalling.


This report performs the same way when I call it from the reportviewer.

If I go to the website, http://mycomputer/reports$sql2005, and run it,
it takes about 5 seconds to display & you don't get the "flickering" of
the "e" on Internet Explorer like you do when I try to run the same
report from within the report viewer.

How am I telling the reportviewer over & over again to get the report?

The fact that I have no totaling in the report tells me that it's not
the returning of the data that is the problem.

The code that calls the report:

<cc1:TabPanel ID="TabPanel3" runat="server" HeaderText="TabPanel3">
<ContentTemplate>
<rsweb:reportviewer id="ReportViewer1"
runat="server" font-names="Verdana" font-size="8pt"
height="90%" width="90%"
ProcessingMode="Remote">
<ServerReport ReportServerUrl="http://mycomputer/ReportServer$SQL2005/"
ReportPath="/BA10listing"></ServerReport>
</rsweb:reportviewer>
</ContentTemplate>
</cc1:TabPanel>

BC
 
B

Bruce L-C [MVP]

I have only used the winform version of the reportviewer control (I assume
you are using the reportviewer control that ships with VS 2005). Somewhere
you have to be responding to an event where you tell the control what report
to render. If you do this over and over again you could be causing it to
thrash.
 
B

Bruce L-C [MVP]

Try the reportviewer control on a simple web page and see if the same thing
happens. I.e. no tabs, just a single simple web page.
 
B

Blasting Cap

I tried it in the following ways:

- I took an AJAX enabled web page, and added the reportviewer to it.
Brought up the report, did the same thing - the "flickering" of the "e"
on Internet explorer, acting like the page is loading.

I figured then that it could be that AJAX itself was causing the problem.

- I went in & created just a regular old ASP.NET page. (HTML follows).
It performed exactly the same way as the others, pegging the CPU at
100% until I killed it.

The report itself was a "nothing" report - returned 100 or so records,
no sums, no totals, no formatting.

HTML of the regular aspx page is:

<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="Default.aspx.vb" Inherits="_Default" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>

<body>
<form id="form1" runat="server">
<div><rsweb:ReportViewer ID="ReportViewer1" runat="server"
Font-Names="Verdana" Font-Size="8pt" Height="400px"
ProcessingMode="Remote" Width="400px">
<ServerReport ReportPath="/BA10listing"
ReportServerUrl="http://mycomputer/ReportServer$SQL2005/" />
</rsweb:ReportViewer>

</div>
</form>
</body>
</html>


I've looked at the properties of it, too.

Under BEHAVIOR:
Enabled = True
EnableTheming = True
EnableViewState = True
Visible = True

Under MISC:
AsyncRendering = True
ExportContentDisposition = OnlyHTMLInline
under LocalReport
EnableExternal Images = False
EnableHyperlinks = False
Processingmode = Remote

Under SERVERREPORT - everything's in there - the report name, the
reportserverURL, that both work.

Under TOOLBAR:
DocumentMapCollapsed = False
ShowbackButton = False
ShowDocumentMapButton = True
ShowExportControls = True
ShowFindControls = True
ShowPageNavigationControls = True
ShowPrintButton = True
ShowPromptAreaButton = True
Show RefreshButton = True
ShowZoomControl = True

I don't see anything that "obviously" would make it refresh/hang like it
does.

Using VS 2005, Windows XP. It performs the same way whether I connect
to the local box(my computer) with both SQL 2000 & SQL 2005 on it, or to
a remote box with both on it too.

Any help, suggestions appreciated.

Thanks,

BC
 
B

Bruce L-C [MVP]

Again, note that I have only used this with Winform control not webform
control. A couple of things to try. Try turning async off. Next, don't have
the report hardcoded. Instead, put a button that sets the report name and
other information (just as a test)
 
B

Blasting Cap

I tried turning off Async, and it didn't make any difference.

On the page (plain old dot net aspx page), what I've found out is that
it will load and act normally, but as soon as the page has been
rendered, it starts the clocking behavior. When you try to move the
scrollbars on the report, etc. it takes a long time to get them to
respond. And when they do, they immediately go back to maxing out the
CPU.

I tried the suggestion of putting a button that sets the report name,
and it didn't make any difference. Code is below.

What happened was that when I ran the page, with the
reportviewer1.visible = false, only the button rendered and the web page
was fine - it wasn't hanging the CPU. I hit the button, and it performs
exactly as I indicated earlier. It displays the report, and it pegs the
CPU at 100% and stays that way until I kill the page.

Here's the code in the codefile:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
Me.ReportViewer1.Visible = False
End If
ReportViewer1.ServerReport.ReportPath = ""

End Sub

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
ReportViewer1.Visible = True
ReportViewer1.ServerReport.ReportPath = "/BA10listing"

End Sub

The code in the aspx part of the page:

<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="Default.aspx.vb" Inherits="_Default" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>

<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" />
<rsweb:ReportViewer ID="ReportViewer1" runat="server"
Font-Names="Verdana" Font-Size="8pt" Height="400px"
ProcessingMode="Remote" Width="400px" AsyncRendering="False"
ShowDocumentMapButton="False">
<ServerReport ReportPath="/BA10listing"
ReportServerUrl="http://mycomputer/ReportServer$SQL2005/" />
</rsweb:ReportViewer>
&nbsp;

</div>
</form>
</body>
</html>


..... so you can see there's a lot going on here. The report returns
~100 records or so, no calculations, no summation, no grand totals.
Basically a "nothing" report, just listing product info data. Both the
IIS and the reportserver are on my computer.

In SQL Reporting Services in the web browser, this report displays fine,
no problems. It's only when I call it from the Reportviewer inside a
web page that it hangs.

Any ideas? Anyone?

BC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top