All Projects → androidmads → Sqlite2xl

androidmads / Sqlite2xl

Licence: mit
Library to Convert SQLite to Excel and Vice-Versa

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Sqlite2xl

Transformalize
Configurable Extract, Transform, and Load
Stars: ✭ 125 (-8.09%)
Mutual labels:  excel, sqlite
Pytablewriter
pytablewriter is a Python library to write a table in various formats: CSV / Elasticsearch / HTML / JavaScript / JSON / LaTeX / LDJSON / LTSV / Markdown / MediaWiki / NumPy / Excel / Pandas / Python / reStructuredText / SQLite / TOML / TSV.
Stars: ✭ 422 (+210.29%)
Mutual labels:  excel, sqlite
winmerge2011
Fork of WinMerge which has a different set of features
Stars: ✭ 36 (-73.53%)
Mutual labels:  sqlite, excel
Sqlitebiter
A CLI tool to convert CSV / Excel / HTML / JSON / Jupyter Notebook / LDJSON / LTSV / Markdown / SQLite / SSV / TSV / Google-Sheets to a SQLite database file.
Stars: ✭ 601 (+341.91%)
Mutual labels:  excel, sqlite
dbd
dbd is a database prototyping tool that enables data analysts and engineers to quickly load and transform data in SQL databases.
Stars: ✭ 30 (-77.94%)
Mutual labels:  sqlite, excel
Tbls
tbls is a CI-Friendly tool for document a database, written in Go.
Stars: ✭ 940 (+591.18%)
Mutual labels:  excel, sqlite
Bchs
source code for BCHS website
Stars: ✭ 126 (-7.35%)
Mutual labels:  sqlite
Xlsx
Fast and reliable way to work with Microsoft Excel™ [xlsx] files in Golang
Stars: ✭ 132 (-2.94%)
Mutual labels:  excel
Directus
Open-Source Data Platform 🐰 — Directus wraps any SQL database with a real-time GraphQL+REST API and an intuitive app for non-technical users.
Stars: ✭ 13,190 (+9598.53%)
Mutual labels:  sqlite
Hy.common.report
报表、Excel操作类库。Java转Excel、Excel转Java
Stars: ✭ 124 (-8.82%)
Mutual labels:  excel
Oreilly intermediate sql for data
Resources for the O'Reilly Online Training "Intermediate SQL For Data Analysis"
Stars: ✭ 136 (+0%)
Mutual labels:  sqlite
Npoi
A .NET library for reading and writing Microsoft Office binary and OOXML file formats.
Stars: ✭ 1,751 (+1187.5%)
Mutual labels:  excel
Goose
A database migration tool. Supports SQL migrations and Go functions.
Stars: ✭ 2,112 (+1452.94%)
Mutual labels:  sqlite
Appdatareader
A library for reading Shared Preferences and Database values within the application.
Stars: ✭ 126 (-7.35%)
Mutual labels:  sqlite
Chyrp Lite
An ultra-lightweight blogging engine, written in PHP.
Stars: ✭ 131 (-3.68%)
Mutual labels:  sqlite
X Spreadsheet
A web-based JavaScript(canvas) spreadsheet
Stars: ✭ 12,046 (+8757.35%)
Mutual labels:  excel
Functional Data Grid
Data grids in functional style with ReactJS
Stars: ✭ 125 (-8.09%)
Mutual labels:  excel
Rrinlog
Replacing Elasticsearch with Rust and SQLite
Stars: ✭ 129 (-5.15%)
Mutual labels:  sqlite
Pylightxl
A light weight, zero dependency, minimal functionality excel read/writer python library
Stars: ✭ 134 (-1.47%)
Mutual labels:  excel
Kangaroo
SQL client and admin tool for popular databases
Stars: ✭ 127 (-6.62%)
Mutual labels:  sqlite

SQLiteToExcel

This is a Light weight Library to Convert SQLite Database to Excel and Convert Excel to SQLite.

Featured In

Android Arsenal

Sample App

The sample app in the repository is available on Google Play:

Get it on Google Play

Features

1.0.3

Added Pull Request from https://github.com/cleathley

  1. Added the ability to provide a custom formatter to the export.
  2. Added the ability to exclude columns from the export.
  3. Added pretty name mapping to export

1.0.2

  1. Added support to add new column from excel while importing, if the column is not exists.

1.0.1

  1. Added Functionality to Import Excel into SQLite Database.
  2. Added Functionality to Export Blob into Image.
  3. Added Functionality to Export List of tables specified.

How to Download

add the following library in your app level gradle file

implementation 'com.ajts.androidmads.SQLite2Excel:library:1.0.4'

How to Use

The steps to use this Library

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Export SQLite to Excel

This line is used to save the exported file in default location.
SqliteToExcel sqliteToExcel = new SqliteToExcel(this, "helloworld.db");
This line is used to save the exported file in used preferred location.
SqliteToExcel sqliteToExcel = new SqliteToExcel(this, "helloworld.db", directory_path);
This code snippet is used to Export a single table in a database to Excel Sheet
sqliteToExcel.exportSingleTable("table1", "table1.xls", new SQLiteToExcel.ExportListener() {
     @Override
     public void onStart() {

     }
     @Override
     public void onCompleted(String filePath) {
     
     }
     @Override
     public void onError(Exception e) {

     }
});
This following code snippet is used to Export a list of table in a database to Excel Sheet
sqliteToExcel.exportSpecificTables(tablesList, "table1.xls", new SQLiteToExcel.ExportListener() {
     @Override
     public void onStart() {

     }
     @Override
     public void onCompleted(String filePath) {
     
     }
     @Override
     public void onError(Exception e) {

     }
});
This code snippet is used to Export a every table in a database to Excel Sheet
sqliteToExcel.exportAllTables("table1.xls", new SQLiteToExcel.ExportListener() {
     @Override
     public void onStart() {

     }
     @Override
     public void onCompleted(String filePath) {
     
     }
     @Override
     public void onError(Exception e) {

     }
});
This code snippet shows how to exclude columns from the export (the resulting export file may not be able to be imported)
ArrayList<String> columnsToExclude = new ArrayList<String>();
columnsToExclude.add("income_id");
sqliteToExcel.setExcludeColumns(columnsToExclude);
...
sqliteToExcel.export...
This code snippet shows how to pretty names (either sheet names or column names (the resulting export file may not be able to be imported)
HashMap<String, String> prettyNameMapping = new HashMap<String, String>();
prettyNameMapping.put("income_date", "Date");
sqliteToExcel.setPrettyNameMapping(prettyNameMapping);
...
sqliteToExcel.export...
This code snippet shows how to format the value for a column on export (if you want to convert ID's or whatnot to be better displayed)
sqliteToExcel.setCustomFormatter(new SQLiteToExcel.ExportCustomFormatter() {
    @Override
    public String process(String columnName, String value) {
        switch(columnName) {
            case "income_type_id":
                int v = Integer.parseInt(value);
                switch(v) {
                    case 10:
                        value = "Sale";
                        break;
                    ...
                    default:
                        value = "Unknown";
                        break;
                }
                break;
        }
        return value;
    }
});

Import Excel into Database

The following snippet is used to initialize the library for Importing Excel

ExcelToSQLite excelToSQLite = new ExcelToSQLite(getApplicationContext(), "helloworld.db");

or To drop table while importing the Excel, use the following

ExcelToSQLite excelToSQLite = new ExcelToSQLite(getApplicationContext(), "helloworld.db", true);
The following code is used to Import Excel from Assets
excelToSQLite.importFromAsset("assetFileName.xls", new ExcelToSQLite.ImportListener() {
	@Override
	public void onStart() {

	}

	@Override
	public void onCompleted(String dbName) {

	}

	@Override
	public void onError(Exception e) {

	}
});
The following code is used to Import Excel from user directory
excelToSQLite.importFromFile(directory_path, new ExcelToSQLite.ImportListener() {
	@Override
	public void onStart() {

	}

	@Override
	public void onCompleted(String dbName) {

	}

	@Override
	public void onError(Exception e) {

	}
});

Proguard for SQLite2XL

-dontwarn org.apache.poi.**

Using SQLite2XL

Mail me with your Google Play URL and I'll add your app to the list :)

Icon Developed By App
AJTechsoft Invoicer
CubanApps Facturas Rápidas

Wiki

Please visit the wiki for a complete guide on SQLite2XL.

Quick Solution

License

MIT License

Copyright (c) 2017 AndroidMad / Mushtaq M A

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].