Display cumulative value of each column in balloon text - iccube

I built a cumulative line graph using context.cumulativeCol() in the Value field and I am interested in displaying the cumulated value of the current column in the ballon text.
This is what I have, which only shows the value of the column:
I tried to change the default value [[Row]], [[Column]]: [[Value]] from the Ballon Text field and tried to use something like context.cumulativeCol() but I could not achieve my goal.
If it is possible, how am I supposed to do it?

I've just tried to put:
return "Cumulative: " + context.cumulativeCol();
to the balloon function and it worked fine in the latest version. Perhaps you are trying to return a number instead of a string from the balloon function?

Related

Rounding binding expressions appmaker

I'm trying to format the output of an expression as a percentage to be shown in a table. With a normal cell, appmaker lets you select the dropdown to #formatNumber. I can't figure out how to do this with a longer expression:
#datasource.item.ROI_Percent * (365/(#datasource.item.Sale_Date - #datasource.item.PO_Date))
I've tried throwing the whole thing in parens and adding #formatNumber but that doesn't seem to work. Is there another function I'm missing? I want this to be a rounded percentage (704%)
Thanks
Once you break away from a single bound output, App Maker can no longer determine the result type and thus doesn't allow you to use their helper functions. You'll have to use plain old javascript.
Here's one way to format as a percentage:
(#datasource.item.ROI_Percent * (365/(#datasource.item.Sale_Date - #datasource.item.PO_Date))).toLocaleString("en", {style: "percent"})

AvalonEdit reordering of document lines

We have currently started to evaluate AvalonEdit. We want to use it for a custom language. One of our requirements is to reorder and also to sort document lines by a certain criteria. How can this be accomplished?
Thanks in advance!
AvalonEdit provides the ICSharpCode.AvalonEdit.Document.DocumentLine class but this class just provides meta data on the line's length, starting and ending offset and so on.
In my opinion, there are 2 ways to accomplish your problem
Loop through all lines using TextEditor.LineCount and save the Line into a DocumentLine using TextEditor.Document.GetLineByNumber(int number). Furthermore you can use TextEditor.Document.GetText(DocumentLine.Offset, DocumentLine.Length to get the line's text
Use TextEditor.Text.Split('\n') to get all lines as a string array.
I'd recommend you using the DocumentLine method. Even if you have to use the GetText method in order to get the line's text the meta data on the lines is very nice.
To get all DocumentLines you can use a loop
List<DocumentLine> DocumentLines = new List<DocumentLine>(TextEditor.LineCount - 1);
for (int i = 1; i < TextEditor.LineCount; i++)
{
DocumentLines.Add(TextEditor.Document.GetLineByNumber(i));
}

PHPExcel format dates occuring this week

PHPExcel conditional formatting has some helpful conditions and operators...
I applied a condition like so:
$aCondition = new PHPExcel_Style_Conditional();
$aCondition->setConditionType(PHPExcel_Style_Conditional::CONDITION_EXPRESSION)
->setOperatorType(PHPExcel_Style_Conditional::OPERATOR_EQUAL)
->addCondition('AND(($B2<>$B3),$B2<>"")');
$aCondition->getStyle()->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
$aCondition->getStyle()->getNumberFormat()->setFormatCode($dateFormat);
$conditionalStyles = $sheet->getStyle('B2')->getConditionalStyles();
array_push($conditionalStyles, $aCondition);
$sheet->getStyle('$'.$letter.'2:$'.$letter.'10000')->setConditionalStyles($conditionalStyles);
However, when I get to the excel document... it marks the cell yellow even though it should not be... but if I then go to the cell and press enter... the cell then loses its yellow... and then the conditional formatting works correctly...
I apply formatting for that cell's rows like so:
$sheet->getStyle('M2:M9999')
->getNumberFormat()
->setFormatCode("dd/mm/yyyy");
I found this little doozy:
PHPExcel_Shared_Date::PHPToExcel( strtotime( "03/25/2014" ) )
As soon as you apply this, the issue goes away.. This is because the formatcode is just a mask... the underlying data has to be of a special Excel date type.

Fusion charts -Pie chart going wrong on zero values

I am using fusion chart for rendering pie chart. In some scenario all the values passing to the graph string will be zero. That is returning the chart in a wrong way instead of showing no data to display.
the following is the graph tag I am using.
Int PendingAmount =0;
Int PaidAmount =0;
"<graph showNames=\"1\" bgAlpha=\"0,0\" numberPrefix=\"Rs. \" decimalPrecision=\"0\"><set name=\"Paid\" value=\"" + PendingAmount + "\" color=\"A4CFD7\"/> <set name=\"Pending\" value=\"" + PaidAmount + "\" color=\"58A1C7\" /></graph>";
This is how the graph is displayed.
I had the similar problem with fusion charts. I would first suggest you to use their latest build. They may have solved this problem.
In my case, I was manually checking for no values or zero values and was in turn, replacing the chart with a simple html text like No data to show.
If you define only the chart element like , then you will get "No Data to Display" error message.
If you define at least one set element, then you wont get "No data to display" error message as there is data to display, but this time zero data and hence zero pie(only the chart canvas) will be rendered.
Hope this helps!

QTP - getting value of element

I am beginning with QTP and just cannot find out how to get value of element. For example when I just want to compare the number of results found by google. I tried to select the element with object spy and use Val(Element) to assign the value into variable..but it doesnt work. Could anyone help with this? BTW, I am not sure whether selecting the text (element) to compare with Object spy is correct.
Thanks!
You should use GetROProperty in order to get the text and then parse it for the value.
Looking at a Google results page I see that the result is in a paragraph with id=resultStats in the 3rd bold tag.
<p id="resultStats"> Results <b>1</b> - <b>10</b> of about
<b>2,920,000</b>
for <b>qtp</b>. (<b>0.22</b> seconds)</p>
So the following script gets the number (as a string with commas).
Browser("micclass:=Browser")
.Page("micclass:=Page")
.WebElement("html id:=resultStats")
.WebElement("html tag:=b","index:=2").GetROProperty("innertext")

Resources