Coder Social home page Coder Social logo

Comments (3)

Rui-Sun avatar Rui-Sun commented on September 13, 2024

https://www.visactor.io/vtable/guide/export/excel
image
目前已经提供了导出格式化接口,调用table.getCellOriginValue(col,row)可获取原始数据;如果需要匹配excel数据,需要返回值符合exceljs value规则 https://github.com/exceljs/exceljs/tree/master?tab=readme-ov-file#value-types

from vtable.

xiaochong444 avatar xiaochong444 commented on September 13, 2024

@

https://www.visactor.io/vtable/guide/export/excel image 目前已经提供了导出格式化接口,调用table.getCellOriginValue(col,row)可获取原始数据;如果需要匹配excel数据,需要返回值符合exceljs value规则 https://github.com/exceljs/exceljs/tree/master?tab=readme-ov-file#value-types

现在返回的只是值,格式化需要用到exceljs的numFmt ,感觉现在设计的导出格式化问题有点不对吧,应该是改显示格式,不是改单元格的值

from vtable.

xiaochong444 avatar xiaochong444 commented on September 13, 2024

https://www.visactor.io/vtable/guide/export/excel image 目前已经提供了导出格式化接口,调用table.getCellOriginValue(col,row)可获取原始数据;如果需要匹配excel数据,需要返回值符合exceljs value规则 https://github.com/exceljs/exceljs/tree/master?tab=readme-ov-file#value-types
格式化应该是像这样,单元格的值还是原始值,显示格式传excel支持的格式,不然导出来全是文本
ws.getCell('B1').value = 0.016;
ws.getCell('B1').numFmt = '0.00%';

from vtable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.