Skip to content

Cannot open exported file in excel. #7

Closed

Description

@Habush

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

Activity

  1. Habush commented on Dec 25, 2017

    @Habush
    Author

    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!

  2. androidmads commented on Dec 26, 2017

    @androidmads
    Owner

    Thanks Bro for Contribution

  3. ArunkumarAndanshetti commented on Feb 26, 2018

    @ArunkumarAndanshetti

    Sir how to update database through the importing excel sheet

  4. mughalgpkn commented on Aug 30, 2024

    @mughalgpkn

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions