How to put all the answers to an equation in one "alert" using "for"? - html

I am making a program in which I ask for a range of 2 numbers and it resolves all the equations with the numbers of the range. The problem is that I know how to put them inside the "for", but I want all the answers outside of the "for" in one "alert"
I have tried to accumulate the answers doing var1=var1+ result + \n but I still need to put what is "x" related to the answer "y". And doing what I did only shows you the results of "y"

Related

SSRS 2013 - Changing colour of cell dependent of outcome of expression within cell

I've asked a similar question recently (See below) however I'm now struggling with a similar scenario.
I have a cell with an expression which is a formula to calculate a % difference, and then depending on the value the percentage difference, I want the cell to change colour. if it's over 1% red, if it's under 1%, green.
The current expression which works to calculate the percentage is;
=(Sum(Fields!P1RateAmount.Value) - Sum(Fields!P1Amount.Value)) / (SUM(Fields!P1Amount.Value)) * 100
I'm presuming I need to wrap a IIF around it, but when I have tried it hasn't worked
If anyone could help me with this I'd be very grateful
Also for context, the formula can't be done in SQL to get a number as I'm using collapsing columns and the percentage formula I'm using in SQL brings back the first row when used within SSRS, and doesn't take into account the full sum
Previous Question asked as referred to above
The expression for the BackgroundColor property of your text box would be:
=IIF( (Sum(Fields!P1RateAmount.Value) - Sum(Fields!P1Amount.Value)) / SUM(Fields!P1Amount.Value) * 100 > 1, "#fff5fa", "MintCream")
I prefer a light shade of green or red but you can substitute the colors with Red and Green if you want to hit them over the head with it.
Just for anyone who may be looking at something similar, the following worked for me
=Switch(
me.value <=-1 OR me.value >=1, "Red"
,me.value >-1 OR me.value <1, "Green"
)
I think this is because the cell already had an expression of
=(Sum(Fields!P1RateAmount.Value) - Sum(Fields!P1Amount.Value)) / (SUM(Fields!P1Amount.Value)) * 100
to get number, the 'IIF' and then referencing the cells wouldn't work. However me.value would look at the value of the cell rather than working the formula, thus bringing back the desired colour

Missing bar/value on SSRS bar chart

I'm having trouble with a missing bar on an SSRS bar chart. I've done a bunch of searches online to try to find solutions, but nothing I've tried seems to fix it, and I'm getting frustrated.
I have the following data (this is a screenshot of the query results run directly from the dataset in SSRS):
And no matter what I do, the "Test" grade will not show up in the Chart:
Actually, the original list of Grades didn't include "Unsatisfactory", and the "Test" grade still didn't appear. I added the 4th grade to see if it would change which bar didn't appear, or to see if it was locked to a limited number of bars or something, but, as you can see, it included the new Grade, but it still leaves out "Test".
I've tried the following things, with no success:
Made sure there were NO chart or dataset filters set and the chart is not in a table or anything else that has filters (it's not filtering that Grade out by anything I can find)
Chart Axis Interval: =1
Chart Axis AllowLabelRotation = Rotate30 (in case the labels were too long or something...?)
Changed the size of the chart (in case there wasn't enough room for 4 bars)
Changed the label font size (in case the labels were too long or something...?)
Changed the name of the "Test" Grade from "Letter" (in case that was a reserved word or something), and also tried setting it to my name instead of "Test"
There's probably more that I've tried, but that's all I can remember at the moment.
Here's a screenshot of my chart settings -- the Expression is =((Fields!TotalStudentsPerGrade.Value / Fields!TotalStudentsInClass.Value) * 100) to get the percent:
Well, I don't understand why it's working now, but apparently, even though I checked that the query was returning all of those values and there were no filters anyhow, somehow something was ignoring one of the students that had that "test" score. I added the "test" score to another student to see if it would show 2 when it wouldn't show 1, and it only showed 1. Again, I tested the query and the "test" grade was showing in the dataset results, so I don't understand why the chart wouldn't have just shown it.
In any case, it's resolved, though I don't understand why it was broken in the first place.

SSRS RDLC character appears partially hidden in report

I'm new to SSRS reports, and I didn't write this report, I'm just trying to fix it; and I've had no luck searching for anyone else suffering from this (too many false-positive matches).
Part of the data for a field is being rendered in a way that leaves half of the first character invisible. Perhaps the best thing to do is to show a screenshot of the problem (see the data in the final column):
StackOverflow says I don't have enough reputation to embed the image; but it's here:
http://i.stack.imgur.com/1YtcB.png
The "8" character is being chopped in half. I don't understand why the data isn't forced inside the 2pt padding, or why it doesn't split the date value between the date and time.
By the way, I suspect there is little value asking why the penultimate column looks OK: the columns are different widths, and the penultimate column is an expression returning a DateTime whereas the final column has to handle the possibility of the DateTime being null.
The RDLC file is here (requires you to download the file; suggestions of a better alternative are welcome): http://www.filedropper.com/markerprogresssummarybycomponent
It looks like it's attempting to fit as much of the date/time on the same line without wrapping as possible, which doesn't necessarily fit in that cell.
2 Suggestions:
Increase the width/padding of the cells that are cutting off text so the
entire date/time fits
If it's not a problem to have the time shown on the next line, you could force it to wrap at the time part, thus eliminating the issue:
=Replace("8/6/2015 12:35:02 PM", " ", chr(10), 1, 1)

overlapping issues SSRS

Every expression is left align, I don't know why some labels are overlap and have more space.
see pic 2, label cancer within 5 years is overlap with expression.
see pic 3, output for unresponsive state has more space than output 1
How do I fix those problems?
It seems likely to me that SSRS is adjusting the size of some surrounding object and that is causing these fields to get bumped. I would check into the surrounding objects and make sure that their CanGrow and CanShrink Attributes are set to false. I would also recommend putting the expression in the same text box as the description (i.e., copying and pasting the expression into the "Cancer within 5 years: " textbox.

Access UI chart text legend sorted as number

I have searched for a solution but I can't find one suitable on this problem.
I have a chart in access where the Y-axis is text but starts with a number, so up along the y-axis i get this:
I know why, but I don't know how to fix it.
They all have an ID which is fine. I can chose to put the ID on the Y-axis, but then the kW range can't be visualized.
How is this changed?
Changing the text to number is not possible as it needs to be like "a-b kW".
Thanks in advance.
For those who might get this problem, I found out why.
When selecting the data, it chose to use the "Total" function, and "Avg" because that is what the values are. (The picture below says "Group By" but it was automaticly set to "Avg". I just forgot to change it when i snipped for stack.
That results in:
But if i remove the "Total" function i get this:
So, removing the "Total" function works here...
In your query, can you sort by ID, but not display it (e.g., in the query designer, sort 'descending/ascending' on the ID field, but clear the 'display' check box)?
As an aside, I've always had a tough time with Access charts... on my last project, the customer wanted a rather complex bar chart, and I ended-up drawing and resizing rectangle objects to get the look that the customer wanted.