Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple excel download using single button click #178

Open
hariharan409 opened this issue Mar 21, 2023 · 1 comment
Open

Multiple excel download using single button click #178

hariharan409 opened this issue Mar 21, 2023 · 1 comment

Comments

@hariharan409
Copy link

I have read your documentation. I am trying to download multiple excel files in single element click. Is this possible in this library?. Also having requirement to zip all these files. Please let me know the details. These details not mentioning in your documentation.

@hariharan409
Copy link
Author

I Can download multiple excel files by using UseRef and trigger click manually. below FYR

                    <Tooltip title="Daily log,Morning shift & Evening shift templates download" placement="bottom"><Button onClick={() => formTemplateDownload()} style={{ backgroundColor: '#04588e', color: 'white', paddingTop: '2px', paddingBottom: '2px', paddingLeft: '20px', paddingRight: '20px' }}>Download Templates</Button></Tooltip>
                    <ExcelFile filename={`${loggedInVesselName}_DailyLogTemplate`} element={<Tooltip title="Export Daily Log Template" placement="bottom"><Button ref={dailyLogRef} style={{ backgroundColor: '#04588e', color: 'white', paddingTop: '2px', paddingBottom: '2px', paddingLeft: '20px', paddingRight: '20px',display: "none" }}>Daily Log</Button></Tooltip>}>
                        <ExcelSheet dataSet={generatedData} name="Daily Log" />
                    </ExcelFile>
                    <ExcelFile filename={`${loggedInVesselName}_MorningShiftTemplate`} element={<Tooltip title="Export Morning Shift Template" placement="bottom"><Button ref={morningShiftRef} style={{ backgroundColor: '#04588e', color: 'white', paddingTop: '2px', paddingBottom: '2px', paddingLeft: '20px', paddingRight: '20px',display: "none" }}>Morning Shift</Button></Tooltip>}>
                        <ExcelSheet dataSet={morningShiftLogGeneratedData} name="Morning Shift Log" />
                    </ExcelFile>
                    <ExcelFile filename={`${loggedInVesselName}_EveningShiftTemplate`} element={<Tooltip title="Export Evening Shift Template" placement="bottom"><Button ref={eveningShiftRef} style={{ backgroundColor: '#04588e', color: 'white', paddingTop: '2px', paddingBottom: '2px', paddingLeft: '20px', paddingRight: '20px',display: "none" }}>Evening Shift</Button></Tooltip>}>
                        <ExcelSheet dataSet={eveningShiftLogGeneratedData} name="Evening Shift Log" />
                    </ExcelFile>

                    const formTemplateDownload = () => {
                       dailyLogRef.current.click();
                      morningShiftRef.current.click();
                      eveningShiftRef.current.click();
                  }

Now I need to zip these files. Thanks and revert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant