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

Cannot open exported file in excel. #7

Closed
Habush opened this issue Dec 18, 2017 · 4 comments
Closed

Cannot open exported file in excel. #7

Habush opened this issue Dec 18, 2017 · 4 comments

Comments

@Habush
Copy link

Habush commented Dec 18, 2017

I am using this library to export a SQLite database to an excel readable file. I use Room Persistance Library as an abstraction over SQLite database to write to the database, but I think that shouldn't matter (I may be wrong). I am using the following code to export the database:

         sqLiteToExcel = new SQLiteToExcel(getActivity().getApplicationContext(), "testdb.db", path);
         sqLiteToExcel.exportAllTables("test.xls", new SQLiteToExcel.ExportListener() {
            @Override
            public void onStart() {

            }

            @Override
            public void onCompleted(String filePath) {
                Toast.makeText(getActivity(), "Successfully exported database", Toast.LENGTH_LONG).show();
            }

            @Override
            public void onError(Exception e) {
                Toast.makeText(getActivity(), "Error in exporting database: " + e.getMessage(), Toast.LENGTH_LONG).show();       Log.d(TAG, e.getStackTrace()[0].toString());
            }
        });

However, when I try to open the file using MS Excel, it gives me The file cannot be opened because it is corrupt error. What is wrong here? How can I solve this?

Thanks in advance

@Habush
Copy link
Author

Habush commented Dec 25, 2017

Ooops..turns out the issue was that I included .db extension in the name of the database paramter to the SQLiteToExcel constructor. Hence, removing the extension and just using the db name resolved the issue.
Anyways, thanks for developing this library!

@androidmads
Copy link
Owner

Thanks Bro for Contribution

@ArunkumarAndanshetti
Copy link

ArunkumarAndanshetti commented Feb 26, 2018

Sir how to update database through the importing excel sheet

@mughalgpkn
Copy link

Hi dear jcenter is closed and now your library is not working kindly help

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

4 participants