Insert formatting throughout the worksheet

Posted by: grazielleconceicao on 5 April 2022, 5:30 pm EST

    • Post Options:
    • Link

    Posted 5 April 2022, 5:30 pm EST

    How to insert setFormatter for all the rows of the worksheet and informing a specific column?

    I used it this way, but it didn’t work:

    Obs: I’m used framework ReactJS.

    
    	const sheetActive = spread.getActiveSheet();
    
    	for(let i = 0; i < 32; i++){
    		sheetActive.setFormatter(-1, i, 'R$* #.##');
    	}
    
    
  • Posted 6 April 2022, 4:44 am EST

    Hi,

    For this, you may first need to get the range and then may call the fo5rmatter method. Please refer to the following code snippet and let me know if you face any issues.

    
      /*change the formatter for column C*/
            sheet.suspendPaint();
            sheet.getRange(0,2,sheet.getRowCount(),1).formatter("0.00");
            sheet.resumePaint();
    
    

    sample: https://jscodemine.grapecity.com/share/RKHFZp5DgUClIpEuSsYp4w/

    Regards,

    Avinash

  • Posted 6 April 2022, 11:39 am EST

    Hello.

    This is resolved my problem.

    Thanks!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels