You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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!
Activity
Habush commentedon Dec 25, 2017
Ooops..turns out the issue was that I included
.dbextension in the name of the database paramter to theSQLiteToExcelconstructor. Hence, removing the extension and just using the db name resolved the issue.Anyways, thanks for developing this library!
androidmads commentedon Dec 26, 2017
Thanks Bro for Contribution
ArunkumarAndanshetti commentedon Feb 26, 2018
Sir how to update database through the importing excel sheet
mughalgpkn commentedon Aug 30, 2024
Hi dear jcenter is closed and now your library is not working kindly help