androidmads / SQLite2XL

Library to Convert SQLite to Excel and Vice-Versa
MIT License
166 stars 58 forks source link

Excel to sqlite import not working #20

Open sakaravinth opened 5 years ago

sakaravinth commented 5 years ago

Expected behavior

Import data from excel to sqlite

Actual behavior

message coming as imported but data is notthere in table

Steps to reproduce the issue

SQLiteOpenHelper helper = new DataAccessLayer.DatabaseHelper(DashboardActivity.this); final SQLiteDatabase db = helper.getWritableDatabase(); // if you want to add column in excel and import into DB, you must drop the table ExcelToSQLite excelToSQLite = new ExcelToSQLite(getApplicationContext(), DatabaseConstants.DATABASE_NAME, true); // Import EXCEL FILE to SQLite excelToSQLite.importFromFile(Environment.getExternalStorageDirectory().getAbsolutePath()+"/tblvanMST.xls", new ExcelToSQLite.ImportListener() { @Override public void onStart() {

        }

        @Override
        public void onCompleted(String dbName) {
            CommonUtils.showToast("Excel imported into " + dbName, DashboardActivity.this, coordinatorLayout_dashboard);
        }

        @Override
        public void onError(Exception e) {
            CommonUtils.showToast("Excel imported Error " + e.getMessage(), DashboardActivity.this, coordinatorLayout_dashboard);

        }
    });
    db.close();