reporting services poblem whit query

  • Hi all,

    i have de following script:

    create procedure spTotalPrestamosTipoUsuarioDependencias @Dependencia varchar(50) ,@TipoUsuario varchar(50), @FechaIni varchar(10), @FechaFin varchar(10), @Tipo varchar(30)

    as

    if @Tipo = 'Todos'

    begin

    select count(*) as TotalPrestamosTipoUsuario, @FechaIni as FechaInicial, @FechaFin as FechaFinal

    from dbo.Servicios S, dbo.Usuarios U, dbo.TiposUsuarios T

    where S.IDUsuario = U.IDUsuario

    and U.IDTipoUsuario = T.IDTipoUsuario

    and S.FechaEntrega between convert (datetime,@FechaIni,103) and convert (datetime,@FechaFin,103)

    end

    if @Tipo = 'Usuarios'

    begin

    select count(*) as TotalPrestamosTipoUsuario, @FechaIni as FechaInicial, @FechaFin as FechaFinal

    from dbo.Servicios S, dbo.Usuarios U, dbo.TiposUsuarios T

    where S.IDUsuario = U.IDUsuario

    and U.IDTipoUsuario = T.IDTipoUsuario

    and T.TipoUsuario = @TipoUsuario

    and S.FechaEntrega between convert (datetime,@FechaIni,103) and convert (datetime,@FechaFin,103)

    end

    if @Tipo = 'Dependencias'

    begin

    select count(*) as TotalPrestamoDependencia, @FechaIni as FechaInicial, @FechaFin as FechaFinal

    from dbo.Servicios S, dbo.Usuarios U, UsuariosDependencias UD, Dependencias D

    where S.IDUsuario = U.IDUsuario

    and U.IDUsuario = UD.IDUsuario

    and D.IDDependencia = UD.IDDependencia

    and D.Dependencia = @Dependencia

    and S.FechaEntrega between convert (datetime,@FechaIni,103) and convert (datetime,@FechaFin,103)

    end

    if @Tipo = 'Todas'

    begin

    select count(*) as TotalPrestamoDependencia, @FechaIni as FechaInicial, @FechaFin as FechaFinal

    from dbo.Servicios S, dbo.Usuarios U, UsuariosDependencias UD, Dependencias D

    where S.IDUsuario = U.IDUsuario

    and U.IDUsuario = UD.IDUsuario

    and D.IDDependencia = UD.IDDependencia

    and S.FechaEntrega between convert (datetime,@FechaIni,103) and convert (datetime,@FechaFin,103)

    end

    in sql server i exectue the procedure and show me the following result:

    exec spTotalPrestamosTipoUsuarioDependencias 'Biología','','01/01/2001','01/01/2008','Dependencias'

    TotalPrestamoDependencia FechaInicial FechaFinal

    364 01/01/200101/01/2008

    but in the aspx the report doesnt show me the "TotalPrestamoDependencia"

    i have something wrong in the script side?

    thank you very much

  • Can you post the .NET code as well? There doesn't appear to be a problem with the SQL.

  • its a web app in c#, i put the reportviewer and i asociate the report, if you need any other code plz tell me:

    i have 3 dropdown list:

    TipoEstadistica (dropdownlist3):

    it have Dependencias, Usuarios, Todos, Todas.

    Dependencia (dd2):

    it have "Biología", "Quimica" ...

    TipoDeUsuario (dd1):

    it have "Estudiantes de pregrado", "Estudiantes de postgrado"

    when the user clic to Dependencias it appear the dd2 and he select the value that goes to @Dependencia

    when the user clic to Usuarios it apear the dd1 and he select the value that goes to @TipoUsuario

    FechaInicial: its a session variable call "Temporal"

    FechaFinal: its a session variable call "Temporal1"

    the code of the report viewer is:

    <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt"

    Height="18px" Visible="False" Width="564px">

    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"

    SelectMethod="GetData" TypeName="DSEstadisticaPrestamosUsuariosDependenciasTableAdapters.spTotalPrestamosTipoUsuarioDependenciasTableAdapter">

    <asp:ControlParameter ControlID="DropDownList2" Name="Dependencia" PropertyName="SelectedValue"

    Type="String" />

    <asp:ControlParameter ControlID="DropDownList1" Name="TipoUsuario" PropertyName="SelectedValue"

    Type="String" />

    <asp:ControlParameter ControlID="DropDownList3" Name="Tipo" PropertyName="SelectedValue"

    Type="String" />

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply