SSRS - add textbox data to a chart - reporting-services

I've created a report in SSRS. The report has a chart in where points are plotted on a scatter chart. My issue now is that we need a line of best fit, which is not directly supported by SSRS.
In order to work it out (as there are a lot of calculations involved to get it from the data we've got) I've had to use custom code. As such, the values are now contained in text boxes (txtDate1, txtValue1, txtDate2, txtValue2).
Does anyone know how I'd be able to get these into my chart (so a point at the locations described in [txtDate1][txtValue1] and [txtDate2][txtValue2])? Or would I have to go back to SQL to figure this out in there?

Related

Dynamically sized charts in SSRS 2008R2

I'm stuck on an issue where I want my bar chart to grow vertically based on the number of groups display in my graph.
I have a shared dataset looking at a SharePoint list then I have a dataset
in my report referencing this but applying some filters based on date ranges. I've then set that as the dataset for my graph which works neatly but there's a widely varying number of potential grouping categories to be displayed. I was looking at this article here which is a neat way to do it, but I don't want a manually set parameter, I just want it to grow based on whatever shows up. One thought I had was in the DynamicHeight expression was to check the number of "CategoryGroups" that show up but I can't see a way of getting to the chart object in the VB expression editor.
I saw an example of doing group by in SQL in the dataset editor but I don't get that option looking at a SharePoint list. Is there a way in DynamicHeight expression editor to reference report objects?
Similar to the article, you can use a distinct count of the group items in a expression in order to dynamically size your chart.
The expression could look like:
= (2 + CountDistinct(Fields!item.Value, "DataSet1")) & ” cm”
Which is (minimum size + size for each group item) in cm (or any unit you prefer)

Broken SSRS Linechart

I am creating a line chart in SSRS. The problem is: I need to display all the date range so I set the horizontal axis as Scalar. However, the line chart will not able to connect each data point in the sequential order.
Anybody had similar issues?
You could try to sort the data beforehand in your dateset or try sorting it via the sorting tab in the properties for your respective grouping.

SSRS chart should look like my excel chart

I am doing an SSRS report which needs to have a chart that looks like this
Excel chart
and so far on my ssrs report I have this
SSRS chart
how could I make my ssrs chart the same on my excel chart?
Thank you in advance
First thing is to put all your data together. You want to compare different years with the same date. You'll need to change your date field to just use the month and day:
=FORMAT(FIELDS!YourDateField.Value, "MM-dd")
For the axis label, use the Day of the Week:
=FORMAT(FIELDS!YourDateField.Value, "dw")
For your markers, go to Series Properties->Markers tab and set Marker Type to Auto to let SSRS assign a different type to each. If each year is a different series, you can assign them individually.
You can right-click on an Axis and go to properties to format them to look more like the Excel version.
There's a bit more differences but mostly formatting.

Jaspersoft Studio : issues while drawing graph

I am new to JasperReports / Jaspersoft Studio and struggling a bit with Charts. The experts may find it very primitive and it is possible that I could be missing some very basic stuff here.. Here is a brief of what I am trying to do
1) Data source is csv with following fields
Sr_No, URI, total_time_taken, no_of_requests, avg_time_per_req, most_expensive_req, timestamp_of_exp_req
2) The csv has around 40,000 lines in it
3) I want to create a report which has all the 40,000 lines in it (A simple columnar report based on all the fields, sorted by no_of_requests in descending order). This is piece of cake in JasperStudio !
4) Next, I want a summary page with "top 10" URIs in a pie chart where value of the pie series is no_of_requests and key is URI (Pretty straight forward)
I have created a report in JasperStudio with data source as csv. I have selected all the fields and applied no filter to my query for the primary dataset (i.e. the default dataset that I get while creating the report). This helps me print all the 40,000 lines in the "Details" band of the report...so the first part is taken care off.
For summary page I need a pie chart where my challenge is to get "top 10" records from the entire dataset. Thankfully my "top" criteria is based on no_of_requests field and my data is already sorted based on that field. Still, I need a subset of the data to draw a meaningful chart. To achieve this, I tried to create a new dataset with just two fields, the URI (which is the key for the Pie) and no_of_requests (which is the value). I also applied filter expression "($V{REPORT_COUNT} > new Integer(10)) ? false : true" to the my new dataset so that I get "top 10" records from my already sorted data. I verified that the filter is working correctly by running it in "Data Preview" tab of "Dataset and Query" dialogue. I have chosen the new dataset as the "Dataset" for my Pie chart..
When I run the report (in preview mode of JasperStudio), I get 40,00 0 lines printed corrected (in the Details band) but the summary is empty. It draws no pie chart.
I tried same with a Bar Chart, but result is the same. The summary in that case shows just X and Y axis with no data points. The graph is empty.
Am I missing something?
Any help in this regards will be highly appreciated.
I have created two variables which I am gonna use in my pie chart to select the Top N Values from the Dataset. To achieve This I have used $V{REPORT_COUNT} Variable as follows
IF($V{REPORT_COUNT}<=N,$F{Your_Field},"") - If the Variable is a String IF($V{REPORT_COUNT}<=N,$F{Your_Variable},0) - If the Variable is Integer.
Substitute N with your desired number.If you need top 10 values then N=10
Now I have used these two Variables to create my Pie Chart.
I have written a blog for the same as I could not upload images here.
Please do check the same for detailed solution.
http://www.rajeshsirsikar.com/selecting-top-n-values-from-a-csv-datasource-jaspersoft-studio/

Conditional background color in line charts

I am currently trying to convert our charts over from PQ Systems Chartrunner to SSRS 2008 charts. I am currently working with a line chart in SSRS 2008 and am trying to get the background color to change for the different sigmas. I am able to calculate and chart the standard deviation sigma lines, but I have not been able to change the color of the background between the lines.
What I have so far in SSRS:
In the Chartrunner chart, the Red/Yellow/Green zones:
Is there a way to do this in SSRS 2008?
Yes, you need to look at using Strip Lines in your report:
Highlight data by adding Strip Lines.
This is a decent link, too:
Axis Strip Lines in SSRS.
Because you can make these expression based, the bands can be determined at run time. It should work in your case as you always have a set number of bands, just different values when you run the report.
Here's a simple example, based off the following dataset:
Most important thing to note is that I've included the limit rows max, mid, and min in the dataset; these makes the Strip Lines easier to create.
Create a simple chart:
Select the Y Chart Axis and expand the StripLines collection:
You can see that I've set IntervalOffset and StripWidth, based on the fields in my dataset. End result:
So you can see it's possible to do this dynamically as required. It's a simplified example but the concept is readily transferable; you should be able to adapt it to your requirements.