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

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 table 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

Related

How to manipulate dataset to get information from different tables?

Currently my data is set up as a union of two tables. The red rows are Table 1 and the blue rows are Table 2. I am doing my union in SQL Server and am connecting this into Tableau. I am using Excel right now to depict what I am seeing (left pivot table) more easily and what I want to see (right made-up pivot table).
The current pivot table is showing when filtered on a particular Plant/Project/Product, those are the components that go into the Product and those are the months in which the Products are due to the customer. The values in the bottom row are the quantity of the Product that is due to the customer. For example- in June, a quantity of 1 of the 150-100020-1000 product is due to the customer. The quantities are showing up under a null component because that field isn’t in Table 2, as you can see in the blue rows.
I want those bottom row values to appear under literally any one of those components that are listed. In this case, it’s only showing one set of Plant/Project/Product, but I would want the formula/code to pick up on that too when it’s evaluating what to output. In the example on the right side made-up pivot table, I have the quantities showing up under the component #100, but it can be under any of them as long as the Plant/Project/Product is equal in both tables. I also don't want the blank/null dates from Table 1 to show up, but they are tied to the components so I can't filter them out easily.
I've tried several types of joins and temporarily tables to get this working and keep coming up blank. How can I set up my dataset to get the view I want to see in Tableau?
Dataset and Current View + View I Want
Your problem is you don't have a Component against a Qty. Hence for what you want somehow you need to create a Component. Perhaps this is possible using a FIXED calc, which would create this field across all records. If the value of Component doesn't matter create this calculation:
{MIN([Component])}
This should put 100 against each record.
If you also need to keep the existing Component value, when it exists, try a formula such as:
IFNULL([Component],{MIN([Component])})
Note I haven't tested any of this.

Report with 2 datasets and column groups

I need to create a report that is using 2 datasets. One (yellow) is bringing product data, the other (green) is bringing company and quantity data. They can both be linked using a unique ID field.
One product may be used by up to 8 organisations and each organisation may have multiple departments.
Can someone explain how I can build a report to give the excel output as shown in the image.
I am familiar with lookup in SSRS, but not sure how to use this where groupings are required from the second dataset.

SSRS report show static headers on the left and group by ID

I have the following DataSet on a SSRS report:
SELECT
VariationCode.Code
,VariationCoding.Comment
,VariationCoding.SubmissionDate
,VariationCoding.Id
FROM
VariationCode
INNER JOIN VariationCoding
ON VariationCode.Id = VariationCoding.VariationCodeId
WHERE VariationId = #VariationId
I am showing static headers on the left and data on the right which works fine but I'm struggling to group the results by ID and show them as a separate table per grouping.
Grouping the row by parent using VariationCoding.Id shows one table with no grouping at all. I suspect having the headers on the left is the problem since most solutions I've seen have the headers on top.
How can I show static headers on the left and group the results by VariationCoding.Id in such a way that each result will be displayed in a separate table?
group the results by ID and show them as a separate table per grouping.
You may want try Page break option, from Group Properties, screenshot for your reference.
I ended up using a list control to solve the problem as described on Microsoft docs -
https://learn.microsoft.com/en-us/sql/reporting-services/report-design/create-invoices-and-forms-with-lists-report-builder-and-ssrs
A list data region repeats with each group or row in the Reporting
Services paginated report dataset. A list can be used to create
free-form reports or forms, such as invoices, or in conjunction with
other data regions. You can define lists that contain any number of
report items.
By creating a table with static columns on the left and nesting it inside the list control, I was able to bind the table data columns to the list data source and this grouped my custom table per record.

Creating a Batch Report

I am trying to create a batch report of multiple invoices using SSRS 2008 R2.
I have created the initial invoice report and have it set up with a parameter; the parameter uses an InvoiceID to populate the data within the invoice report.
I have created another report using lists, inside the list contains the information that was in my original invoice report but using a different parameter (BatchID). The problem I am running into with this is that instead of creating a single invoice for each invoiceID it is creating an invoice for each line item within each invoice. i.e.~ Instead of incorporating multiple items based on the InvoiceID (as the original report did) it is creating a report for each of the items.
What would be the best way of running a batch of these invoices? Am I going about this the wrong way or am I on the right track but missing something?
Thanks in advance!
SELECT i.InvoiceId, i.InvoiceNumber, i.BillTo_Line1, i.BillTo_Line2, i.BillTo_City, i.BillTo_StateOrProvince, i.BillTo_PostalCode, i.CustomerIdName,
i.ce_OutstandingBalance, i.ce_BillToDate, i.ce_BillFromDate, i.TotalAmount, id.ProductIdName, id.ce_customeridName, id.ce_CustomerProductName,
id.InvoiceDetailId, id.BaseAmount, id.PricePerUnit, id.ce_rate
FROM
Invoice AS i RIGHT OUTER JOIN
InvoiceDetail AS id ON i.InvoiceId = id.InvoiceId
Once I enter the invoiceID I get my report
My intent is to be able to run the report against multiple invoicesid numbers without having to select the invoice number itself. I have another table that collects the invoiceid's based on a batchid that they are run in.
So far I have attempted to create a subreport with the original report and Create a separate report that uses a list and attempt to group by InvoiceID for each batchid. Though with each of these I have so far been unsuccessful.
I am new to SSRS and have been pouring over documentation from MSDN about SSRS and the different abilities.
For this sort of repeating list, it's a matter of understanding how a list/grouping works.
Lists, Tables and Matrixes are all the same underlying object - the Tablix.
A List is a Tablix with one detail row (i.e. one Tablix row for each row in the Dataset), one textbox in that row, and a Rectangle in that textbox. The Rectangle can have various embedded elements like more textboxes and as such provides a repeating free-form item for each row in the Dataset.
You can see this when you create a List in the designer:
I assume your report query takes a BatchID and returns a number of invoices and their invoice details. I've taken some liberties with your data and created a simplified sample Dataset:
You want the Rectangle to repeat for every InvoiceNo. Currently the Row Group has no grouping item - change this to InvoiceNo under the Group properties and expand the Rectangle as required.
You can start adding in elements such as textboxes for the Invoice level items, something like:
Note that the left side of the Tablix has changed from lines to a bracket - this is because a grouping item was added to the Row Group.
This will repeat once for each InvoiceNo. Now we want to add the line items - you can do this by dragging a new Table into the Rectangle. Since we have a Row Group in place this table will only display items in that group:
When run for the sample data, this gives an ugly but functional repeating invoice report:
This could be tidied up as required, and page groups inserted between Group items in the Group properties as required.
Hopefully this at least gives you a rough idea of how you might go about your task.

Using single slicer to control two pivot tables with different data source in Excel

I have a problem with slicer in Excel file. In my Excel file I have two worksheets. In the first one, there is a pivot table taking data from OLAP cube and in the second I have a pivot table taking data from another Excel file. I'd like to have one slicer called "Organization" to filter data in both tables. Is it possible?
Kind regards
No - it seems not. Slicers are meant to be used on pivot tables that share the same data source it seems. You should be able to conglomerate your data into one source and create two pivot tables with a shared slicer though.
From Microsoft: http://office.microsoft.com/en-us/excel-help/use-slicers-to-filter-pivottable-data-HA010359466.aspx
Make a slicer available for use in another PivotTable
1.Click the slicer that you want to share in another PivotTable. This displays the Slicer Tools, adding an Options tab.
2.On the Options tab, in the Slicer group, click PivotTable Connections.
3.In the PivotTable Connections dialog box, select the check box of the PivotTables in which you want the slicer to be available.
Or you could just create one pivot table.
Or you could have a look at this:
Making all pivot tables on one sheet mimic each other in terms of rows expanding and collapsing
Good Luck.

Resources