Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Populate chart using sql query

$
0
0

Hello,

I have some sql queries that I run in a database. This queries uses the "Sum case" method.

I'm trying to create a rdlc file in order to report a pie chart.

But I don't know how can I configure the Chart on the rdlc file to get the data.

My queries are like this:

            Dim Pesquisa As String = "SELECT Origem," _& "      SUM(CASE WHEN Qualidade_Passagem = 'Otimo' THEN +1 ELSE 0 END) AS Otimo ," _& "      SUM(CASE WHEN Qualidade_Passagem = 'Bom' THEN +1 ELSE 0 END) AS Bom ," _& "      SUM(CASE WHEN Qualidade_Passagem = 'Regular' THEN +1 ELSE 0 END) AS Regular," _& "      SUM(CASE WHEN Qualidade_Passagem = 'Ruim' THEN +1 ELSE 0 END) AS Ruim" _& "      FROM Atendimentos where Data Between '" & Datainicial.Date.ToString("MM/dd/yyyy") & "'  and  '" & Datafinal.Date.ToString("MM/dd/yyyy") & "'" _& "      GROUP BY Origem" _& "       ORDER BY 1"

But I can't insert this query in the right place...

How can I do that?


Valdirnm


Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>