SQL Server Reporting Services - http 401

 
Vista:

http 401

Publicado por Alfredo (1 intervención) el 11/04/2011 18:37:34
He creados dos projectos con el mismo código con VS 2005, el primero de tipo Web application project y el segundo de tipo Web Site Project, en ambos he implementado un control ReportViwer para visualizar un reporte que esta en SQL Reporting Service 2005. Cuando ejecuto el projecto web el reporte se muestra correctamente, sin embargo cuando pruebo con el projecto tipo Web Site, me da error HTTP 401, el codigo es igual en ambos, Qué puede ser. aqui les muestro mi código HTML y el VB

<%@ 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" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>

<!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>Página sin título</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table>
<tr><td>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /></td>
</tr>
<tr><td>
<asp:Panel ID="Panel1" runat="server" Visible="false" >
<rsweb:ReportViewer ID="ReportViewer1" runat="server">
</rsweb:ReportViewer>
</asp:Panel>

</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>



Imports Microsoft.Reporting.WebForms
Partial Class _Default
Inherits System.Web.UI.Page
Protected sargumento() As String
Protected svalor() As String

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim litotalarg, liindice As Integer
Dim lsProvincia As String = "8"
Dim lsFecIni As String = "20110401"
Dim lsFecFin As String = "20111001"
Dim ls_nrepo As String = "LatasPorDevolver"
Dim lsArgumentosFinal As String = "&provincia=" + lsProvincia + "&pFecini=" + lsFecIni.ToString + "&pFecfin=" + lsFecFin.ToString
Dim urlReportes As String = ConfigurationManager.AppSettings.Get("UrlReportes")
Dim lsReporte As String = urlReportes + "/" + ls_nrepo
If lsArgumentosFinal <> "" Then
lsArgumentosFinal = Mid(lsArgumentosFinal, 2, lsArgumentosFinal.Length - 1)
End If

ReportViewer1.ProcessingMode = ProcessingMode.Remote

ReportViewer1.ServerReport.ReportServerUrl = New Uri(ConfigurationManager.AppSettings.Get("ServerUrl"))
ReportViewer1.ServerReport.ReportPath = lsReporte

Me.SepararArgumentos(lsArgumentosFinal)
litotalarg = Me.sargumento.Length - 1
Dim parameters(litotalarg) As ReportParameter
For liindice = 0 To litotalarg
SepararValores(Me.sargumento(liindice))
parameters(liindice) = New ReportParameter(svalor(0), svalor(1))
Next

ReportViewer1.ServerReport.SetParameters(parameters)


'Se habilita la entrada de parametros
With ReportViewer1
.ShowBackButton = True
.PromptAreaCollapsed = True
.ShowDocumentMapButton = True
.ShowExportControls = True
.ShowFindControls = True
.ShowPageNavigationControls = True
.ShowParameterPrompts = True
.ShowPrintButton = True
.ShowPromptAreaButton = True
.ShowRefreshButton = True
.ShowReportBody = True
.ShowToolBar = True
.ShowZoomControl = True
End With
ReportViewer1.ServerReport.Refresh()
Me.Panel1.Visible = True
End Sub
Protected Sub SepararArgumentos(ByVal vsargumentos As String)
sargumento = Split(vsargumentos, "&", -1, 1)
End Sub
Protected Sub SepararValores(ByVal vsargumentos As String)
svalor = Split(vsargumentos, "=", -1, 1)
End Sub
End Class
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder