Can't print from rdlc.

  • Thread starter Thread starter Herb
  • Start date Start date
H

Herb

I'm using a ReportViewer in ASP.NET. From the development environment it
works fine. When published and I try to open the page with the ReportViewer I
get the error:

An internal error occurred on the report server. See the error log for more
details.

Do I have something configured wrong? I do not knw where to find the error
log to review it.
 
Greetings,

If you are embeddng the rdlc that could be a source of your problem. If
you are embedding try changing that to "Copy Always" and then set your
path in the print routine. There is good documentation in the VS2005
help on the ReportViewer control and on printing from an rdlc. Look up
ReportViewer

Rich
 
Hi stullhe,

In addition to the RDLC template file's copy/deploy issue Rich has
mentioned, I would suggest you check the deployment of the Reportviewer
control on the target server machine first.

For both VS 2005/.NET 2.0 and VS 2008 .NET 3.5, the reportViewer control is
included as an additional components(installed with visual studio), not
built-in .net framework system component. If you want to deploy application
which use Reportviewer control on a machine which doesn't have visual
studio installed. You need to install the reportviewer control on that
machine also. The following MSDN reference has mentioned this, Visual
studio has provided the reportviewer control redistributable package for
you:

#Deploying Reports and ReportViewer Controls
http://msdn.microsoft.com/en-us/library/ms251723(VS.80).aspx

#Deploying Reports and ReportViewer Controls
http://msdn.microsoft.com/en-us/library/ms251723.aspx

Here are more information about Reportviewer control:

#ReportViewer Controls (Visual Studio)
http://msdn.microsoft.com/en-us/library/ms251671.aspx

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
 
Do I need to run my report as a ServerReport? Currently it is a LocalReport
referring to a dataset. I'm not sure where to check the embedding vs. "Copy
To"
 
Steven, Thanks for your reply. My ASP.NET web page runs from our web server
(WEB01) and SQL Server 2005 is on our development server (DATASVR02).

IIS uses Windows Authentication (no Anonymous) for the page. In the
connection string I use a specific uid for the SQL connection. This uid also
has RSExecRole membership on both ReportServer and RportServerTempDB.

As I have mentioned to (Rich P) the report is defined as LocalReport, not
ServerReport.

I'm sure I'm missing something easy.

The error I get refers to "see the error log for details." Where do I find
this error log so I can further investigate?

Thanks

--
stullhe104


Steven Cheng said:
Hi stullhe,

In addition to the RDLC template file's copy/deploy issue Rich has
mentioned, I would suggest you check the deployment of the Reportviewer
control on the target server machine first.

For both VS 2005/.NET 2.0 and VS 2008 .NET 3.5, the reportViewer control is
included as an additional components(installed with visual studio), not
built-in .net framework system component. If you want to deploy application
which use Reportviewer control on a machine which doesn't have visual
studio installed. You need to install the reportviewer control on that
machine also. The following MSDN reference has mentioned this, Visual
studio has provided the reportviewer control redistributable package for
you:

#Deploying Reports and ReportViewer Controls
http://msdn.microsoft.com/en-us/library/ms251723(VS.80).aspx

#Deploying Reports and ReportViewer Controls
http://msdn.microsoft.com/en-us/library/ms251723.aspx

Here are more information about Reportviewer control:

#ReportViewer Controls (Visual Studio)
http://msdn.microsoft.com/en-us/library/ms251671.aspx

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
 
Thanks for your reply stullhe,

Based on your new description, I have some question here.

Are you using server-side report or client report? For server report, you
should already have an report created and deployed on the SQL Server
reporting service server(can be visited via webbrowser and url). And your
reportViewer control just set the mode to "ServerReport" mode and reference
that report via link.

For local report, it doesn't require anything from backend SQL Server
reporting service(though the data records still may come from sql server
database). the report template (rdlc) is deployed with your ASP.NET web
application. There is nothing to do with the SSRS reportServer here.

Anyway, both of the two ways, since you're using reportviewer control to
display the report, you need to make sure that the reportviewer control has
been correctly deployed on the target server. Have you verified this? If
the deployment server hasn't previously installed the ReporViewer control,
you need to first install it.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
From: =?Utf-8?B?SGVyYg==?= <[email protected]>
References: <[email protected]>
Subject: RE: Can't print from rdlc.
Date: Fri, 11 Jul 2008 06:24:28 -0700
 
My ASP.NET web page contains the rdlc file. This is a client report.

I have verified the ReportViewer on the data server, the web serevr and the
local machine.

Do you know which log the error message refers to? I would like to see what
the error log is reporting. It may help.
 
Thanks for your reply Stullhe,

As for Visual Studio ReportViewer client report(RDLC based), it doesn't
have any service log files. The error message is more likely indicating
some error related to SSRS reportserver. Have you checked whether there is
SQL Server Reporting service deployed on that server and in the same IIS
site where your ASP.NET application deployed? As far as I know, reporting
service server-side has log files under SQL Server instance directory. For
other logs, you can check the windows eventlog for application.

Also, if you have any other server, I suggest you try testing the
application on some other server to see whether it is specific to that
particular server machine.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.


--------------------
Thread-Topic: Can't print from rdlc.
thread-index: Acjmc21bAUSoPq7rQUi1pc1JsdxNew==
X-WBNR-Posting-Host: 207.46.19.197
From: =?Utf-8?B?SGVyYg==?= <[email protected]>
Subject: RE: Can't print from rdlc.
Date: Tue, 15 Jul 2008 05:08:01 -0700
 
Perhaps the issue has become muddled. My question is this:

I have an ASP.NET/VB.NET web page which contains an RDLC file. The RDLC is
based upon a local dataset. It is also defined as a LocalReport.

When I open the form which includes the ReportViewer object I get an error
on the Published version of the page. The development version works fine. The
error that I get is:

An internal error occurred on the report server. See the error log for more
details.

I have run the ReportViewer.exe (version 2.0.50727.817) on the web server,
the sql server and the local machine. SQL Server Reporting Services
(MSSQLSERVER) is "Started" in Services on the SQL Server. This service does
not exist on the web server.

Is there something I need to do in IIS? or on the SQL Server to fix this
issue?

Thanks,
 
New developments.

I'm not sure what changed, but now instead of getting the error mentioned
before, not I get a "Server Error in '/MyProg' Application." The error refers
to "Unable to cast object of type 'System.Net.FileWebRequest' to type
'System.Net.HttpWebRequest'.

At least this gives me more information to investigate.
 
Hi Herb,

Go To Project/Properties window. Got To the Publish tab. In the middle
of this window you will see a few buttons. Click on "Application Files"
Here you should see

Microsoft.ReportViewer.Common.dll/Include/Required
Microsoft.ReportViewer.ProcessingObjectModel.dll/Include/Required
Microsoft.ReportViewer.Webform(or WinForm if a winform
application)/Include/Required

If you don't see all three of these there - then you are missing a
reference - need to go to the References tab and check these.

Then you see a "Prerequisites..." button. Makre sure .Net 2.0 is
checked and also Microsoft Visual Studio 2005 Report Viewer is checked.

Finally, go to the Solution Explorer window of your project and click on
your rdlc file. Look at the properties sheet below which will appear
when you click on your rdlc. Select Buil Action = "Content" and Copy
To Output Directory = "Copy Always"

HTH
Rich
 
Thanks for the reply. I am familiar with the properties interface you
mention, but this is a website so I am not sure the same Properties interface
is there.

I can access the Property Pages which has a References section. That section
refers to the Microsoft.ReportViewer.Common and Webform, but not the
ProcessingObjectModel. Although ProcessingObjectModel is in the GAC, I can't
seem to add a reference to it.

For some reason System.Windows.Forms is in my references. Not sure why.

Thanks,
 
P.S. I can add the Microsoft.ReportViewer.ProcessingObjectModel in the
web.config, but this seems to have no affect.
 
While you are in the Project/Properties window -- did you check the
properties of your rdlc to make sure it is set to "Content" and "Copy
Always" ?

Hopefully, you didn't check that, and that can fix your problem
(hopefully).

Truth is - I only have used the rdlc's on winform apps (successfully and
able to deploy using "Click Once" - which sort of uses a virtual dir on
the Server). If the above doesn't fix your problem - then have a look
at MSDN

http://msdn.microsoft.com/en-us/library/bb885185.aspx



Rich
 
Thanks for your followup Stullhe,

As you said, the error message now became the following one:

================
"Server Error in '/MyProg' Application." The error refers to "Unable to
cast object of type 'System.Net.FileWebRequest' to type
'System.Net.HttpWebRequest'.
================

I'm a bit confused at this since "WebRequest" component is used for network
access and FileWebRequest is the FTP components, has your application or
pages used it? I think the web project context here may have made the
troubleshooting quite difficult. Would you consider the following steps to
isolate the issue:

1. Put aside the current problem project. Create a new empty ASP.NET web
site project and add a page to use a local report in reportviewer(not
necessaily the same report as in the problem project) and deploy it to
target server to see whether it works.

2. If a very simple local report also fails, try using a server report(if
you have any SQL Server reporting service report available for test) to see
whether you can get reportviewer control(webform) working on that target
server machine.

Also, it's important that during the test, make the page/project as simple
as possible so as not to involve other potential problems.

Sincerely,

Steven Cheng
Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

-------------------
 
Thanks for the help, but I don't see a way to do what you are suggesting. I
know just what you mean from a Windows standpoint, but not a Web one.
 
Steven, thanks for the suggestion. I have created a new project and
everyrthing works! But I am a little confused.

My older project and my new project have different Properties Pages! The new
one has a page of tabs labelled; Application, Compile, References, etc. The
old one has a treeView on the left with values of; References, Build,
Accessibilty, etc.

With the new project I can select Build...Publish MyNewApp... and select
"All files in the source project folder" from the Copy section. If I do this,
my new app works.

Is the difference in Properties/Property Pages because the projects were
created differently? I may have created the older project as a "Create...Web
Site" from the Start Page instead of "Create...Project" (of type ASP.NET
Application).

In any case, I will create a new project and recreate my application. I will
keep you informed.

--
stullhe104


Steven Cheng said:
Thanks for your followup Stullhe,

As you said, the error message now became the following one:

================
"Server Error in '/MyProg' Application." The error refers to "Unable to
cast object of type 'System.Net.FileWebRequest' to type
'System.Net.HttpWebRequest'.
================

I'm a bit confused at this since "WebRequest" component is used for network
access and FileWebRequest is the FTP components, has your application or
pages used it? I think the web project context here may have made the
troubleshooting quite difficult. Would you consider the following steps to
isolate the issue:

1. Put aside the current problem project. Create a new empty ASP.NET web
site project and add a page to use a local report in reportviewer(not
necessaily the same report as in the problem project) and deploy it to
target server to see whether it works.

2. If a very simple local report also fails, try using a server report(if
you have any SQL Server reporting service report available for test) to see
whether you can get reportviewer control(webform) working on that target
server machine.

Also, it's important that during the test, make the page/project as simple
as possible so as not to involve other potential problems.

Sincerely,

Steven Cheng
Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

-------------------
Subject: RE: Can't print from rdlc.
Date: Thu, 17 Jul 2008 10:43:02 -0700
 
after recreating my web app I find that it is the complexity of my report
which may be the problem.

I will open a new issue based upon that problem, as this one seems to be
resolved.

--
stullhe104


Steven Cheng said:
Thanks for your followup Stullhe,

As you said, the error message now became the following one:

================
"Server Error in '/MyProg' Application." The error refers to "Unable to
cast object of type 'System.Net.FileWebRequest' to type
'System.Net.HttpWebRequest'.
================

I'm a bit confused at this since "WebRequest" component is used for network
access and FileWebRequest is the FTP components, has your application or
pages used it? I think the web project context here may have made the
troubleshooting quite difficult. Would you consider the following steps to
isolate the issue:

1. Put aside the current problem project. Create a new empty ASP.NET web
site project and add a page to use a local report in reportviewer(not
necessaily the same report as in the problem project) and deploy it to
target server to see whether it works.

2. If a very simple local report also fails, try using a server report(if
you have any SQL Server reporting service report available for test) to see
whether you can get reportviewer control(webform) working on that target
server machine.

Also, it's important that during the test, make the page/project as simple
as possible so as not to involve other potential problems.

Sincerely,

Steven Cheng
Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

-------------------
Subject: RE: Can't print from rdlc.
Date: Thu, 17 Jul 2008 10:43:02 -0700
 
Thanks for your followup Stullhe,

yes, that's the way we find it. I'm glad that we've got progress here.
Sure, please feel free to post here for any further issues.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
-------------------------------------------------------------------------
Subject: RE: Can't print from rdlc.
Date: Fri, 18 Jul 2008 12:15:00 -0700
 
Back
Top