Kendo Spreadsheet

0 Answers 19 Views
Spreadsheet
brajesh
Top achievements
Rank 1
Iron
brajesh asked on 16 Jun 2022, 06:07 AM

Hello,

 

Can  i iterate this code through the loop in kendo spreadsheet

 sheet.range("AV2").formula("sum(AJ2:AU2)").background("#FFFF00").color("#ffffff");
    sheet.range("AV3").formula("sum(AJ3:AU3)").background("#FFFF00").color("#ffffff");
    sheet.range("AV4").formula("sum(AJ4:AU4)").background("#FFFF00").color("#ffffff");
    sheet.range("AV5").formula("sum(AJ5:AU5)").background("#FFFF00").color("#ffffff");
    sheet.range("AV6").formula("sum(AJ6:AU6)").background("#FFFF00").color("#ffffff");
    sheet.range("AV7").formula("sum(AJ7:AU7)").background("#FFFF00").color("#ffffff");
    sheet.range("AV8").formula("sum(AJ8:AU8)").background("#FFFF00").color("#ffffff");
    sheet.range("AV9").formula("sum(AJ9:AU9)").background("#FFFF00").color("#ffffff");
    sheet.range("AV10").formula("sum(AJ10:AU10)").background("#FFFF00").color("#ffffff");
    sheet.range("AV11").formula("sum(AJ11:AU11)").background("#FFFF00").color("#ffffff");
    sheet.range("AV12").formula("sum(AJ12:AU12)").background("#FFFF00").color("#ffffff");
    sheet.range("AV13").formula("sum(AJ13:AU13)").background("#FFFF00").color("#ffffff");
    sheet.range("AV14").formula("sum(AJ14:AU14)").background("#FFFF00").color("#ffffff");
    sheet.range("AV15").formula("sum(AJ15:AU15)").background("#FFFF00").color("#ffffff");
    sheet.range("AV16").formula("sum(AJ16:AU16)").background("#FFFF00").color("#ffffff");
    sheet.range("AV17").formula("sum(AJ17:AU17)").background("#FFFF00").color("#ffffff");
    sheet.range("AV18").formula("sum(AJ18:AU18)").background("#FFFF00").color("#ffffff");
    sheet.range("AV19").formula("sum(AJ19:AU19)").background("#FFFF00").color("#ffffff");
    sheet.range("AV20").formula("sum(AJ20:AU20)").background("#FFFF00").color("#ffffff");
    sheet.range("AV21").formula("sum(AJ21:AU21)").background("#FFFF00").color("#ffffff");
    sheet.range("AV22").formula("sum(AJ22:AU22)").background("#FFFF00").color("#ffffff");
    sheet.range("AV23").formula("sum(AJ23:AU23)").background("#FFFF00").color("#ffffff");

and what is the validate solution for this loop iterate based on row data available in spreadsheet

Veselin Tsvetanov
Telerik team
commented on 20 Jun 2022, 09:21 AM

Hi Brajesh,

In fact, you won't need a loop to set the above for a range of cells in a single column. All the above calls could be reduced to a single one by using the R1C1 notation in the Spreadsheet:

sheet.range("AV2:AV23").formula("sum(R[0]C[-12]:R[0]C[-1])").background("#FFFF00").color("#ffffff");

Here is a Dojo sample implementing the above:

https://dojo.telerik.com/ovUlAnAY/2

No answers yet. Maybe you can help?

Tags
Spreadsheet
Asked by
brajesh
Top achievements
Rank 1
Iron
Share this question
or