@corbe30/fortune-excel
v1.0.6
Published
An Excel import/export import library for FortuneSheet
Downloads
256
Maintainers
Readme
FortuneExcel
FortuneExcel is an import/export library for FortuneSheet. It only supports .xlsx files (not .xls).
Features
Supports the following spreadsheet features in import/export:
- Cell style
- Cell border
- Cell format, such as number format, date, percentage, etc.
- Formula
Usage
For best results, import and export a single sheet at a time. Although you can force FortuneExcel to handle multiple sheets, certain configurations may break.
- Install the package:
npm i @corbe30/fortune-excel
- Add import/export toolbar item in fortune-sheet
<ImportHelper />
is a hidden component and only required when usingimportToolBarItem()
.
import { importToolBarItem, ImportHelper, exportToolBarItem } from "fortune-excel";
function App() {
const workbookRef = useRef();
const [key, setKey] = useState(0);
const [sheets, setSheets] = useState(data);
return (
<>
<ImportHelper setKey={setKey} setSheets={setSheets} sheetRef={workbookRef1} />
<Workbook
key={key}
data={sheets}
ref={workbookRef}
customToolbarItems={[exportToolBarItem(workbookRef), importToolBarItem()]}
/>
</>
);
}