TCL to HTML Table

163 views
Skip to first unread message

Scott Larmon

unread,
Mar 25, 2024, 8:21:10 PMMar 25
to Pick and MultiValue Databases
Just curious, has anyone created anything that can take a TCL command 

i.e. LIST CUSTOMERS NAME ADDRESS PHONE ...

captured the output to an HTML table?

Brandon Robinson

unread,
Mar 25, 2024, 10:46:22 PMMar 25
to mvd...@googlegroups.com
Hello Scott!

We have a few tools that do this. I would be happy to discuss in more detail!

We support most of the platforms. Which flavor of PICK are you working with?

Let me know if I can get you more details. 

Thank you!




Brandon Robinson
Head Geek - RDM Infinity


--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
---
You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mvdbms/4446ac34-6d34-4d6c-a79e-f0b1eacccf22n%40googlegroups.com.

Jay LaBonte

unread,
Mar 25, 2024, 11:27:13 PMMar 25
to mvd...@googlegroups.com

 

 

I generally parse the LIST statement and extract the Selection criteria and the display fields into separate array, then I convert he list to a SELECT or SSELECT and execute the query.

 

I also open the dict of the target file by extracting the filename from the file and search for any USING clause. Once I have the file name I open the

 

I then process using a READNEXT to load the @KEY value, then perform a Read into the @RECORD variable. I then read the dictionary item and then use the ITYPE function to translate the value on @RECORD with the ITYPE which returns a resulting value. I then add this value to an array and move on to the next record.

 

This method can take a little longer with large selections, but for the most part it is rather quick.

 

Let me know if you need further details.

 

Regards,

Jay LaBonte

--

martinp...@ladybridge.com

unread,
Mar 26, 2024, 6:44:27 AMMar 26
to mvd...@googlegroups.com

OpenQM had an experimental implementation of an AS.HTML keyword to the query processor commands. This is probably still in the latest release from Rocket but was never documented for application use.

 

Martin

 

From: mvd...@googlegroups.com <mvd...@googlegroups.com> On Behalf Of Scott Larmon
Sent: Tuesday, March 26, 2024 12:21 AM
To: Pick and MultiValue Databases <mvd...@googlegroups.com>
Subject: [mvdbms] TCL to HTML Table

 

Just curious, has anyone created anything that can take a TCL command 

 

i.e. LIST CUSTOMERS NAME ADDRESS PHONE ...

 

captured the output to an HTML table?

--

Jonathan Wells

unread,
Mar 26, 2024, 9:17:46 AMMar 26
to 'Jay LaBonte' via Pick and MultiValue Databases
Hi all,

I worked in the higher education world for around 20 years with Datatel's (now Ellucian) products using Unidata on the back end.  Cedarville University had a free utility that they offered to all called DOWNLOAD.  It acts a lot like a TCL LIST command, and can produce a wide variety of output, including HTML.  They even created a port to Universe.  It currently is on github @ https://github.com/cedarville-university/unidata-utilities.  Perhaps it could be ported to QM?

Cheers,
Jonathan Wells
--

Jim Idle

unread,
Mar 26, 2024, 9:52:25 AMMar 26
to mvd...@googlegroups.com
Not sure which system you are using, but we added JQLEXECUTE to jBASE for these exact reasons. It takes any valid statement and returns a result iterator on the resulting data. This includes standard processing of dictionaries. You can then iterate the result and trivially produce any kind of output, including HTML.



A better way though is to produce JSON, then use eCharts to consume the JSON and present the data nicely. You can also use a a table component from one of the many Javascript frameworks. Don't try and generate the final presentation - you are the data source, not the presentation layer.

Unfortunately, you are likely to be bombarded with hacks about scanning the output of EXECUTE "LIST....". 
 
Jim


Joe Goldthwaite

unread,
Mar 26, 2024, 11:40:41 AMMar 26
to mvd...@googlegroups.com
Pete Schellenbach had written some extensions to Pick that allowed you to get the results of LIST and SORT before they were formatted into the resulting report. This was how he implemented the PIE and PLOT commands that would change the tabular reports into graphic charts.

He built a similar function for CompuSheet+. We used it to emplement the SPREAD and SSPREAD commands which would convert the results into a CompuSheet+ spreadsheet.

I've often thought that this should be a standard option for the built  in MVDB report queries. Having the data from the query in a more computer accessible format rather than as a report with all the column spacing and formatting makes adding new options much easier.

Use the function to pull the data then you just need to write a program to convert it to HTML, XML, Excel or any other format.

It's funny because this is how SQL works. The query that extracts the data is separate from the resulting report. With MVDB the query and report where tied together making alternate outputs more difficult.

I guess what I'm saying is that instead of AS.HTML, just have an AS.DATA option. The data is the hard part. Once you have the data you could use standard formatters for printed reports, plots, html, etc but you could also easily write your own customer formatter.

Joe Goldthwaite

Jim Idle

unread,
Mar 26, 2024, 12:09:51 PMMar 26
to mvd...@googlegroups.com
This is how it works in jBASE. Though as far as I know there is no automatic way to export to JSON, it would be trivial to build that using JQLPREPARE and related statements. It should probably be built in as well.

Jim

--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
---
You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.

Christopher Jeune

unread,
Mar 26, 2024, 3:03:05 PMMar 26
to mvd...@googlegroups.com
I Wonder is Chat GPT4 could do that.

--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
---
You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.

Jim Idle

unread,
Mar 27, 2024, 10:26:42 AMMar 27
to mvd...@googlegroups.com
GPT4 does not know enough about MV/BASIC to do this. I tried a few approaches. It seems to half understand JQLCOMPILE, then hallucinates. If using more general MV BASIC, then it attempts the same kind of hacks that have already been mentioned here, but gets them wrong.

Tony Gravagno

unread,
Apr 16, 2024, 10:52:54 AMApr 16
to Pick and MultiValue Databases
Scott doesn't mention his platform but at some point he was using D3, so the following is about D3.

Option 1)

1) Google this forum for TABSORT and SORTT. In less than a minute you can create a new TCL command from SORT that outputs tab-delimited data rather than space-delimited.
2) When you say "HTML" there's nothing in normal AQL output that styles data, so if you want any kind of styling you need to create new dict items. For example, if you want negative CR/DB values to be red and bold, create a new descriptor BALANCE-HTML1 that uses the atb8/correlative to test and wrap negative values with <span class="bal-cr"></span>.
3) Use HDR-SUPP and other modifiers to eliminate print-specific nuances that don't apply to HTML.
4) With the above and a report sent to a hold file, you now have tab-delimited styled data.
5) Post-process that with BASIC (PEQS file is just another D3 file), deleting tabs, converting @AM EOLs to <br/> or </p><p>. Add tags for Html, Title, Body, scripts, and class styling.

In summary, in less than an hour you can create a new command like HTMLSORT that is a BASIC program, reads the command line, executes SORTT and captures to a hold file, post-processes the hold file, then copies the PEQS item to an OS-level file with a .html extension.

Option 2)
Use the above SORTT/TABSORT technique to output a tab-delimited file and strip out MV-specific cruft. Copy the file to the OS with a .csv extension. Now use any sheet app (Excel, Google Sheets, LibreOffice) to open/import the file and convert delimiters to columns and rows. Use app-specific tooling to apply templates and print to HTML, PDF, or other formats. Why this option? It shifts all of the formatting from MV to other tools that are better suited to that important task.

Option 3) PhiReport (used with AccuTerm, contact Pierre Trinephi) : Reasonable pricing and LOTS of great features.

Option 4) Entrinsik Informer : Tons of features, designed for the purpose, leaves aesthetics to data consumers, not producers.

Option 5) Find the source for NebulaXLite and generate true Excel files, not just CSV, which can then be output as per option 2.

Option 6) Rather than SORT,  use SREFORMAT. Send output to an MV file or the host OS. Then post-process that with BASIC, or process it with other "mainstream" tooling to do whatever you want. That is, MV is a database, use it to generate data and use other tools designed for user interfaces to do that part of the job.

Poor little kitties skinned so many ways.

T (crawling back under my rock)
Reply all
Reply to author
Forward
0 new messages