Showing posts with label viewer. Show all posts
Showing posts with label viewer. Show all posts

Tuesday, March 20, 2012

Associating Report Viewer (without UI) with Data Set

Hello all - I am looking to use the ReportViewer Control to automatically print out some client based reports.

I started with the "Print a report from a console app" sample from http://www.gotreportviewer.com/.

I have managed to convert an existing server based report from an RDL to an RDLC, and added it to my Console Project with VB.NET. In addition, I created a new Data Set within this project that returns the data from the original stored procedure that was used for the RDL file. I believe I have also successfully passed in the correct parameters to the sproc, but now I need to associate this new Data Set with the RDLC report. The RDLC has a simple table control that has a few fields from the new Data Set. When the report is rendered, I receive an exception indicating the following:

{"A data source instance has not been supplied for the data source "Production_stpProductionByDay"."}

It would seem that I need to programmatically associate my Data Set with the report, but I cannot seem to figure out the correct syntax.

Here is my Run method:

m_PhaseID = 1

m_ShiftID = 1

m_DateTime = Now()

Dim report As LocalReport = New LocalReport()

Dim parReport(2) As ReportParameter

Dim parDay As New ReportParameter("Day", m_DateTime)

Dim parPhaseID As New ReportParameter("PhaseID", m_PhaseID)

Dim parShiftID As New ReportParameter("ShiftID", m_ShiftID)

parReport(0) = parDay

parReport(1) = parPhaseID

parReport(2) = parShiftID

report.ReportPath = "C:\Documents and Settings\Kruse\My Documents\Visual Studio 2005\Projects\ShellyReportPrint\ShellyReportPrint\Production.rdlc"

report.SetParameters(parReport)

Export(report)

m_currentPageIndex = 0

Print()

Any help would be greatly appreciated! Thanks..

I have yet to find a solution for this issue... has anyone else implemented something similar?

If not, I guess I will have to wait until TechEd 2K6!

Saturday, February 25, 2012

AspNetSessionExpiredException - Your results may vary?

I have a custom reporting application that displays Sql Server Reporting Services reports on an ASP.NET page using Microsoft's report viewer control. The SSRS reports are local reports (they have an rdlc extension).

When a report is left inactive for a lengthy period of time it generates anAspNetSessionExpiredException when the user attempts to move to a new page. The thing that is surprising is that the formatted exception display is contained within the report viewer. The report document map remains visible as does the report toolbar. In the right pane where the report normally appears I see a standard, raw, ASP.NET exception display.

I'm surprised that the report viewer is "catching" the exception and displaying it within the report viewer. Standard events in the page that hosts the report viewer (PreInit, Init, PageLoad) are never invoked.

I have graceful error handling defined in a base page class but it does me no good because the exception never reaches the page code-behind. Puzzling.

Do any of you ASP.NET developers know if it is possible to catch theAspNetSessionExpiredExceptionso that I can handle it in my application code rather than having SSRS display a very ugly, very raw exception message.

I've included the exception message below.

Thanks.

BlackCatBone

...

Server Error in '/templatedemo' Application.

------------------------

ASP.NET session has expired

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Microsoft.Reporting.WebForms.AspNetSessionExpiredException: ASP.NET session has expired

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[AspNetSessionExpiredException: ASP.NET session has expired]

Microsoft.Reporting.WebForms.ReportDataOperation..ctor() +683

Microsoft.Reporting.WebForms.HttpHandler.GetHandler() +553

Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) +10

System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154

System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

------------------------

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

I am having exactly the same problem. If anyone knows the solution to this it would be fabulous to here from you.

|||

I had the same problem and I found the solution in this posthttp://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=170875&SiteID=1. See Brian Hartman's post regarding sessionState. I used his suggestion of using the out-of-process session state as StateServer mode and it fixed the issue for me. Good luck.

Sunday, February 19, 2012

ASP.NET-Report Viewer-Internet

Hi,
I am planning to use Report viewer web control in my web application and
going to use forms authenthication. What roles need to assign in RS and what
are the other settings need to be done.
Thanks & Rgds,
AruThe roles settings are no different between forms authentication and Windows
authentication. The settings for forms authentication are described here:
http://msdn.microsoft.com/library/?url=/library/en-us/dnsql2k/html/ufairs.asp?frame=true#ufairs
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"Aru" <Aru@.discussions.microsoft.com> wrote in message
news:5B452DEB-E608-4814-B15B-5842E016B9F4@.microsoft.com...
> Hi,
> I am planning to use Report viewer web control in my web application and
> going to use forms authenthication. What roles need to assign in RS and
> what
> are the other settings need to be done.
> Thanks & Rgds,
> Aru

Monday, February 13, 2012

ASP.NET reportviewer control %width and %height

I'm using the report viewer control on an ASP.net webpage. I'm trying to set
height and width of the control using %. I cannot see any report content on
my screen. (rs 2005) Is this a bug and if so is there a workaround?
ThanksYou too huh? Width = 100% seems to work fine. It's the height that seems
to cause the problem.
"David" <David@.discussions.microsoft.com> wrote in message
news:13BE747E-29F4-473A-88C9-30EF684F4680@.microsoft.com...
> I'm using the report viewer control on an ASP.net webpage. I'm trying to
> set
> height and width of the control using %. I cannot see any report content
> on
> my screen. (rs 2005) Is this a bug and if so is there a workaround?
> Thanks

ASP.NET Report Viewer Version 9.0 problem.

I recently migrated my development server from Windows Server 2003 \ IIS 6 \
.NET Framework 2 and SQL 2005 to Windows Server 2008 \ IIS 7 \ .NET Framework
3.5 and SQL 2005 SP2. SQL install also includes Reporting Services. On my dev
workstation I have upgraded to from vs2005 to vs2008 and installed the
correct AjaxToolKit 3.5 dll.
I have a web project that uses SQL reporting services and Report Viewer 8.0
which used to work ok before the migration. I have replaced the Report Viewer
8.0 control within my web project to the new vs2008 Report Viewer 9.0 and
replaced all references (web.config etc) from 8.0 to 9.0. I have also
installed the Report Viewer 9.0 download on my development server &
workstation and rebooted.
When I now run my project the report viewer control does not render my
report (or even display the default icons for the report control such as
print icon etc).
I get a client side javascript error in IE7 stating â'Error: this.Controller
is null or not an objectâ'. If I try the site on FireFox the report displays
â'404 File or Directory not foundâ' within the report viewer.
Im running the report within a user control. Please find code for the uc
containing the report viewer and associated data objects below...
<%@. Control Language="C#" AutoEventWireup="true"
CodeFile="Reporting_MainSite.ascx.cs" Inherits="NPApplets_Reporting_MainSite"
%>
<%@. Register Assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0,
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana"
Font-Size="8pt" Height="325px" Width="100%" BackColor="#95B7F3">
<LocalReport ReportPath="Report_SiteTraffic.rdlc"
EnableExternalImages="True">
<DataSources>
<rsweb:ReportDataSource DataSourceId="ObjectDataSource1"
Name="DataSet1_Report_LastMonth" />
<rsweb:ReportDataSource DataSourceId="ObjectDataSource2"
Name="DataSet2_Report_Last12Months" />
<rsweb:ReportDataSource DataSourceId="ObjectDataSource3"
Name="DataSet3_Report_Last12MonthsUBS" />
<rsweb:ReportDataSource DataSourceId="ObjectDataSource4"
Name="DataSet4_Report_SinceLaunch" />
</DataSources>
</LocalReport>
</rsweb:ReportViewer>
<asp:ObjectDataSource ID="ObjectDataSource4" runat="server"
SelectMethod="GetData"
TypeName="DataSet4TableAdapters.Report_SinceLaunchTableAdapter"
OldValuesParameterFormatString="original_{0}">
<SelectParameters>
<asp:ControlParameter ControlID="lbWondersiteToReportOn"
Name="Wondersite_FullName"
PropertyName="Text" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="ObjectDataSource3" runat="server"
SelectMethod="GetData"
TypeName="DataSet3TableAdapters.Report_Last12MonthsUBSTableAdapter"
OldValuesParameterFormatString="original_{0}">
<SelectParameters>
<asp:ControlParameter ControlID="lbWondersiteToReportOn"
Name="Wondersite_FullName"
PropertyName="Text" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="ObjectDataSource2" runat="server"
SelectMethod="GetData"
TypeName="DataSet2TableAdapters.Report_Last12MonthsTableAdapter"
OldValuesParameterFormatString="original_{0}" >
<SelectParameters>
<asp:ControlParameter ControlID="lbWondersiteToReportOn"
Name="Wondersite_FullName"
PropertyName="Text" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
SelectMethod="GetData"
TypeName="DataSet1TableAdapters.Report_LastMonthTableAdapter"
OldValuesParameterFormatString="original_{0}" >
<SelectParameters>
<asp:ControlParameter ControlID="lbWondersiteToReportOn"
Name="Wondersite_FullName"
PropertyName="Text" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:Label ID="lbWondersiteToReportOn" runat="server"
Visible="False"></asp:Label>
Within VS2008 designer the Report Viewer control shows the controls icons
correctly (print icon etc).
I have 4 data objects that my report uses. If I try and modify the data
source objects via the Smart Tag > Configure Data Source I get the following
error...
"The type 'DataSet4TableAdapters.Report_SinceLaunchTableAdapter' could not
be loaded. If the type is located in the App_Code folder, please check that
it compiles. If the type is located in a compiled assembly, pleaee check that
the assembly is referenced by the project.
The type "DataSet4TableAdapetrs.Report_SinceLaunchTableAdapter' could not be
foundâ'"
I have checked my DataSet.xsd files located in my App_Code directory and
everything compiles ok.
Im now stumped as what to try next. Any help, advice or pointers would be
very much appreciated.
Thanks in advance,
Paul.Managed to track down a fix...
Open Internet Information Services (IIS) Manager and select your Web
application.
Under IIS area, double-click on Handler Mappings icon.
At the Action pane on your right, click on Add Managed Handler.
At the Add Managed Handler dialog, enter the following:
Request path: Reserved.ReportViewerWebControl.axd
Type: Microsoft.Reporting.WebForms.HttpHandler
Name: Reserved-ReportViewerWebControl-axd
Click OK.
http://otkfounder.blogspot.com/2007/11/solving-reportviewer-rendering-issue-on.html
Paul.
"Paul Hale" wrote:
> I recently migrated my development server from Windows Server 2003 \ IIS 6 \
> .NET Framework 2 and SQL 2005 to Windows Server 2008 \ IIS 7 \ .NET Framework
> 3.5 and SQL 2005 SP2. SQL install also includes Reporting Services. On my dev
> workstation I have upgraded to from vs2005 to vs2008 and installed the
> correct AjaxToolKit 3.5 dll.
> I have a web project that uses SQL reporting services and Report Viewer 8.0
> which used to work ok before the migration. I have replaced the Report Viewer
> 8.0 control within my web project to the new vs2008 Report Viewer 9.0 and
> replaced all references (web.config etc) from 8.0 to 9.0. I have also
> installed the Report Viewer 9.0 download on my development server &
> workstation and rebooted.
> When I now run my project the report viewer control does not render my
> report (or even display the default icons for the report control such as
> print icon etc).
> I get a client side javascript error in IE7 stating â'Error: this.Controller
> is null or not an objectâ'. If I try the site on FireFox the report displays
> â'404 File or Directory not foundâ' within the report viewer.
> Im running the report within a user control. Please find code for the uc
> containing the report viewer and associated data objects below...
> <%@. Control Language="C#" AutoEventWireup="true"
> CodeFile="Reporting_MainSite.ascx.cs" Inherits="NPApplets_Reporting_MainSite"
> %>
> <%@. Register Assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0,
> Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"
> Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
> <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana"
> Font-Size="8pt" Height="325px" Width="100%" BackColor="#95B7F3">
> <LocalReport ReportPath="Report_SiteTraffic.rdlc"
> EnableExternalImages="True">
> <DataSources>
> <rsweb:ReportDataSource DataSourceId="ObjectDataSource1"
> Name="DataSet1_Report_LastMonth" />
> <rsweb:ReportDataSource DataSourceId="ObjectDataSource2"
> Name="DataSet2_Report_Last12Months" />
> <rsweb:ReportDataSource DataSourceId="ObjectDataSource3"
> Name="DataSet3_Report_Last12MonthsUBS" />
> <rsweb:ReportDataSource DataSourceId="ObjectDataSource4"
> Name="DataSet4_Report_SinceLaunch" />
> </DataSources>
> </LocalReport>
> </rsweb:ReportViewer>
> <asp:ObjectDataSource ID="ObjectDataSource4" runat="server"
> SelectMethod="GetData"
> TypeName="DataSet4TableAdapters.Report_SinceLaunchTableAdapter"
> OldValuesParameterFormatString="original_{0}">
> <SelectParameters>
> <asp:ControlParameter ControlID="lbWondersiteToReportOn"
> Name="Wondersite_FullName"
> PropertyName="Text" Type="String" />
> </SelectParameters>
> </asp:ObjectDataSource>
> <asp:ObjectDataSource ID="ObjectDataSource3" runat="server"
> SelectMethod="GetData"
> TypeName="DataSet3TableAdapters.Report_Last12MonthsUBSTableAdapter"
> OldValuesParameterFormatString="original_{0}">
> <SelectParameters>
> <asp:ControlParameter ControlID="lbWondersiteToReportOn"
> Name="Wondersite_FullName"
> PropertyName="Text" Type="String" />
> </SelectParameters>
> </asp:ObjectDataSource>
> <asp:ObjectDataSource ID="ObjectDataSource2" runat="server"
> SelectMethod="GetData"
> TypeName="DataSet2TableAdapters.Report_Last12MonthsTableAdapter"
> OldValuesParameterFormatString="original_{0}" >
> <SelectParameters>
> <asp:ControlParameter ControlID="lbWondersiteToReportOn"
> Name="Wondersite_FullName"
> PropertyName="Text" Type="String" />
> </SelectParameters>
> </asp:ObjectDataSource>
> <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
> SelectMethod="GetData"
> TypeName="DataSet1TableAdapters.Report_LastMonthTableAdapter"
> OldValuesParameterFormatString="original_{0}" >
> <SelectParameters>
> <asp:ControlParameter ControlID="lbWondersiteToReportOn"
> Name="Wondersite_FullName"
> PropertyName="Text" Type="String" />
> </SelectParameters>
> </asp:ObjectDataSource>
> <asp:Label ID="lbWondersiteToReportOn" runat="server"
> Visible="False"></asp:Label>
> Within VS2008 designer the Report Viewer control shows the controls icons
> correctly (print icon etc).
> I have 4 data objects that my report uses. If I try and modify the data
> source objects via the Smart Tag > Configure Data Source I get the following
> error...
> "The type 'DataSet4TableAdapters.Report_SinceLaunchTableAdapter' could not
> be loaded. If the type is located in the App_Code folder, please check that
> it compiles. If the type is located in a compiled assembly, pleaee check that
> the assembly is referenced by the project.
> The type "DataSet4TableAdapetrs.Report_SinceLaunchTableAdapter' could not be
> foundâ'"
> I have checked my DataSet.xsd files located in my App_Code directory and
> everything compiles ok.
> Im now stumped as what to try next. Any help, advice or pointers would be
> very much appreciated.
> Thanks in advance,
> Paul.
>

Sunday, February 12, 2012

ASP.NET and HTML Viewer

Hi everyone,
I have an ASP.NET application that uses the HTML Viewer. I have a problem,
because the windows user that request the report to the Report Server is the
windows user of the web client. I would like that the windows user who
request the report to the Report Server be ASP.NET user, because I don't know
(and I can't know it) windows accounts of the users and I can't assign roles
in the Report Manager for the users.
Thanks in advance.what you need to do is set up forms authentication on the report server,
requires a bit of work, but is that or using soap access intead of HTML
Viewer ...
one really important bit which really trashed my investigation about wheter
to use forms authentication or soap access is that u can put some code in
your logon page of your asp.net application to make it log on the user on the
report server (trough soap access) then save the cookie on the client, so the
client will be authenticated on the report server without even knowing ...
if I had known that I wouldnt have gone trough the soap access trail ...
"Javier Catala" wrote:
> Hi everyone,
> I have an ASP.NET application that uses the HTML Viewer. I have a problem,
> because the windows user that request the report to the Report Server is the
> windows user of the web client. I would like that the windows user who
> request the report to the Report Server be ASP.NET user, because I don't know
> (and I can't know it) windows accounts of the users and I can't assign roles
> in the Report Manager for the users.
> Thanks in advance.