-2

I am looking forward to update the excel cell in colour based on the data received from an external source. The data is getting updated as expected in a cell. I want to change the colour of the cell based on the received data.

Assume the selected cell is A3. The data comes in a internal of 3 seconds. Assume data that comes is 10 15 12 18 20. For these data I want the colour to be red green red green green.

Red indicates that the value is less than the previous value and green indicates that the value has increases as compared to previous value.

I have used conditional formatting, but did not find a feature to compare previous value in same cell

Programmer
  • 329
  • 2
  • 6
  • 25
  • 1
    `rapidjson` is a C++ library. Please update the question tags. – David Collins Jan 28 '19 at 09:19
  • I have written a sample code and compiled with g++ – Programmer Jan 28 '19 at 09:20
  • what else can be done to loop and get the count? printf("%s\n", d[0]["Data1"].GetString()); and printf("%s\n", d[1]["Data1"].GetString()); gives the desired output. I just want to count and assign it to variable i. Rest all are working fine. – Programmer Jan 28 '19 at 09:21
  • @David Collins Also can you please give me the changes to be done if I have to write it for C? – Programmer Jan 28 '19 at 09:25
  • Possible duplicate of [get array data from json file using rapidjson](https://stackoverflow.com/questions/26857349/get-array-data-from-json-file-using-rapidjson) – Duck Dodgers Jan 28 '19 at 09:25
  • Also maybe you can look at [this](https://stackoverflow.com/questions/32303257/looping-over-an-array-in-rapidjson-and-getting-the-object-elements) – Duck Dodgers Jan 28 '19 at 09:26

1 Answers1

1

Suppose V is a JSON object which has a key-value object. You can retrieve data like this.

const rapidjson::Value& V;
for (Value::ConstMemberIterator iter = V.MemberBegin(); iter != V.MemberEnd(); ++iter){
    printf("%s\t", iter->name.GetString());
    printf("%s\t", iter->value.GetString());
}

(ref.)

Mayur
  • 2,583
  • 16
  • 28