开发者

SQL 2005 Report Designer - Using specific table cells as data in charts

开发者 https://www.devze.com 2023-03-12 17:17 出处:网络
I have various reports built in MS SQL 2005 Report Designer, displaying various sums and counts of different data. Now I need to implement different types of charts in these reports (Bar graphs, Pie c

I have various reports built in MS SQL 2005 Report Designer, displaying various sums and counts of different data. Now I need to implement different types of charts in these reports (Bar graphs, Pie charts), using the data from the summed cells (subtotals and grand totals for groups).

I don't see any ways to specify a table cell as input for a chart's data in the chart properties, it gives me errors saying it's not part of the "data region." I can't find any info on how to create data regions, and I assume I don't want to use "data output" because that only deals with exporting xml?

Can anyone give me some direction on how to easily link t开发者_如何学Goable group subtotals to chart input data?

Thanks


Different report items (tables, chart, etc) don't have to derive from the one dataset. Just use different datasets for the different report items. Let's say your main report table uses a dataset that shows the invoices sent by different branches, which you sum at the branch level:

SELECT Branch, InvoiceNumber, InvoiceDate, InvoiceAmount
FROM Invoices
ORDER BY Branch, InvoiceNumber

Simply create another dataset for the pie chart being the summary information:

SELECT Branch, SUM(InvoiceAmount) AS BranchSum
FROM Invoices
GROUP BY Branch


you want to create a expression calling on the dataset

=Sum(Fields!InvoiceAmount.value, "DataSet1")

If you want to call on the same Field just use AS in the select statement.

Select Invoices.InvoiceAmount AS InvoiceAmt

InvoiceAmt will then be a useable field equal to invoiceamount

0

精彩评论

暂无评论...
验证码 换一张
取 消