× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



It is not free - but at $200 (or $300 for the professional version that I use) I find PHP Grid unbeatable. The simple type of display that is shown in the Python example you referenced requires only three lines of code. Like so:

require_once("../conf.php"); // Include main phpgrid configuration and routines

// Identify table and required columns and default sort column
$dg = new C_DataGrid("select customerNumber, customerName, city, state, country
from customers", "customerNumber", "customers");

$dg -> display(); // And show the data to the world!

To add editing, add one more line. To add export to XML, CSV, PDF, etc. add one line. Enable searching add a line. Etc. etc. Column sorting is standard even in the basic table.



Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Jan 10, 2018, at 2:15 PM, Richard Schoen <Richard.Schoen@xxxxxxxxxxxxxxx> wrote:

Nice !

Regards,


Richard Schoen
Director of Document Management
e. richard.schoen@xxxxxxxxxxxxxxx
p. 952.486.6802
w. helpsystems.com
------------------------------

message: 5
date: Wed, 10 Jan 2018 17:49:21 +0000
from: "Kevin Adler" <kadler@xxxxxxxxxx>
subject: RE: Convert a database file to Html format - Python perhaps ?

Super easy in Python. If you're using the OPS Python, you can use
prettytable: [1]https://pypi.python.org/pypi/PrettyTable

To install, just run from a PASE shell: pip3 install ptable

#!/usr/bin/env python3

import ibm_db_dbi as db2
from prettytable import from_db_cursor

query = "select * from qiws.qcustcdt"

conn = db2.connect()
cur = conn.cursor()
cur.execute(query)

table = from_db_cursor(cur)

with open("file.html", "w") as file:
file.write("""<!DOCTYPE HTML>
<html lang="en-US">
<head>
<title>Table to HTML</title>
<head>
<body>
{}
</body>
</html>""".format(table.get_html_string()))

References

Visible links
1. https://pypi.python.org/pypi/PrettyTable


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.