Visual Studio 2005 Report Viewer: Stacked chart RRS feed

  • Question

  • Hi... I really need help T.T

    I have a problem with stacked bar: my sql query doesnt show me anything. I executed it in my database and it return me values but when i execute this sql query through visual studio reports, only show a line. Why is that? can someone show an example of how it should be the sql query?

    Thanks so much

    Just in case, this is my sql query

    ALTER FUNCTION [dbo].[datosGrafico](@mes int)
    RETURNS int
     -- Declaración de la variable a retornar
     DECLARE @cantidad int;

     -- Contar los registros que se tienen del RP
     SET @cantidad = (SELECT sum(D.cant_total)
         FROM RPpro.dbo.Detalle_ret_RP D, RPpro.dbo.Retiro_RP R
          D.id_categoria = 1 AND
          D.id_ret_RP = R.id_ret_RP AND
          D.medida = 'Kg' AND
          YEAR(R.fecha_solicitud) = YEAR(Getdate()) AND
          MONTH(R.fecha_solicitud) = @mes
         GROUP BY D.id_categoria);

     -- Retornar el resultado de la función
     IF (@cantidad IS NULL) SET @cantidad = 0;

     RETURN @cantidad;

    Friday, February 27, 2009 1:00 PM