jueves, 5 de julio de 2007

Establecer el ReportPath del ReportViewer en C#

Una vez tengamos configurado nuestro formulario .aspx donde insertamos el ReportViewer para ver nuestros reportes en internet tendriamos que resolver el ReportPath.
http://localhost/Reportes es el administrador de nuestros reportes.
http://localhost/Servidor-Reportes Servidor de los reportes

Debemos tener claro el directorio donde generamos nuestros reportes en este caso seria:Nuestro directorio /Informes.

ReportViewer1.ServerReport.ReportPath = "/Informes/NuevoInforme"

Mira este ejemplo:

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Microsoft.Reporting.WebForms;
using Microsoft.Reporting;
using System.Net.Security;
using Microsoft.Web.UI;
//Establece Referencia al proyecto UtilidadReportingServices
using UtilReportingServices;
namespace formularios{
///
/// Summary description for Informes.
///

public partial class MostrarInformes: System.Web.UI.Page
{
protected void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
//Establecer la dirccion URL del Servidor de Reportes
ReportViewer1.ServerReport.ReportServerUrl =
new Uri("http://localhost/Servidor-Reportes");
//Establecer el Path donde se encuentran los reportes
ReportViewer1.ServerReport.ReportPath = "/Informes/NuevoInforme";
//Estabalcer las Credenciales
ReportViewerCredentials credencial = new ReportViewerCredentials("usuario", "password", "dominio");
ReportViewer1.ServerReport.ReportServerCredentials = credencial;
//Establaecer el Parametro Descontador para el informe
ReportParameter[] miParametro = new ReportParameter[1];
miParametro[0] = new ReportParameter("Variable");
ReportViewer1.ServerReport.SetParameters(miParametro);
//Propiedades del ReportViewer
ReportViewer1.ShowParameterPrompts = false;
ReportViewer1.ShowFindControls = false;
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
}
#endregion
}
}

martes, 3 de julio de 2007

Usando ReportViewer

Para visualizar nuestros Reportes podemos utilizar ReportViewer.

-<-form id="Form1" method="post" runat="server"->-
-<-rsweb:reportviewer id="ReportViewer1" runat="server" ProcessingMode="Remote" Font-Names="Verdana" Font-Size="8pt" Width="800px" Height="490px"->-
-<-ServerReport ReportServerUrl="http://localhost/Servidor-Reportes"/->-
-<-/rsweb:reportviewer->-
-<-/form->-

http://msdn2.microsoft.com/es-es/library/ms251671(VS.80).aspx


De esta manera podemos ver nuestros reportes en ASP.NET

jueves, 28 de junio de 2007

Reporting Services 2005

SQL Server 2005 tiene una herramienta que nos permite realizar reportes y que facilita las tareas a los usuarios a la hora de consultar datos, extractos de cuentas, conciliaciones, transacciones ejecutadas, inventarios, etc.
Reporting Services 2005 permite creear reportes que se pueden ver atraves de aplicaciones .NET y que son implementadas en Visual Studio 2005.