tableedControl

Discussions related to Visual Prolog
Gass
Posts: 11
Joined: 17 Aug 2017 8:51

tableedControl

Unread post by Gass » 17 Aug 2017 9:37

Can anyone tell me how to use Vip 7's tableedControl with customControl on Vip 7.5 or 8 in pfc/gui/controls, or no . In this case there is perhaps another solution more easy for output database with integer, string and real numbers? Thanks :D

Harrison Pratt
VIP Member
Posts: 283
Joined: 5 Nov 2000 0:01

Unread post by Harrison Pratt » 17 Aug 2017 12:34

Take a look at the listView class and the listView demo project.

Gass
Posts: 11
Joined: 17 Aug 2017 8:51

Unread post by Gass » 17 Aug 2017 13:04

lisview

Harrison Pratt
VIP Member
Posts: 283
Joined: 5 Nov 2000 0:01

Unread post by Harrison Pratt » 17 Aug 2017 13:59

Right, you will need to convert them to strings when loading the listView.

Gass
Posts: 11
Joined: 17 Aug 2017 8:51

Unread post by Gass » 17 Aug 2017 16:56

Hi,
I agree, but not quite satisfied because I have doubts about the tri list; Ex "10.5" < "9.5" it seems. But I will take ListView of course, if I have no better.
Thanks

Harrison Pratt
VIP Member
Posts: 283
Joined: 5 Nov 2000 0:01

Unread post by Harrison Pratt » 17 Aug 2017 19:01

You mentioned only "output" in your original post, so if you want to query the displayed data then another approach will be needed.

Another way, if you are just interested in quick and dirty display, is to write your data to an HTML-table file and open that file in your favorite browser.

Gass
Posts: 11
Joined: 17 Aug 2017 8:51

Unread post by Gass » 18 Aug 2017 6:56

indeed, this solution is very elegant, but I don'nt know language HTLM or I have'nt examples for. Why then not also exporting data table to excel? It's possible also no ? Perhaps do you know examples for my help concerning HTLM or excel? Thank's

Harrison Pratt
VIP Member
Posts: 283
Joined: 5 Nov 2000 0:01

Unread post by Harrison Pratt » 18 Aug 2017 14:49

See here for HTML table structure: https://www.w3schools.com/html/html_tables.asp

The table structure might look intimidating at first, but remember that for your application you (probably) won't need to do the fancy (but helpful) indenting. With a little thought you can figure out how to write a table header (<th> ... </th> ) with one line of code whose predicate declaration looks something like this:

Code: Select all

emitHeaderList( outputStream YourFile, string_list Headers )
The same technique will work for the table data (<td> ...<\td> ) rows.


Excel will happily open CSV (character separated values) files that you write from your application. The separators most commonly used are ',' and the tab character ( '\t' ). I prefer using tab because then fields can contain embedded commas. Some fields may need to be quoted with '"'. See this: https://support.office.com/en-us/articl ... 9e391393ba

Try mocking up a small data table in Excel that looks like the data you want to display, then SaveAs CSV file and also SaveAs TXT (tab-separated file). You can open these in Notepad or other editor to see how to format the data you write to disk.

Remember, you can launch Excel from your program, too.

Gass
Posts: 11
Joined: 17 Aug 2017 8:51

Unread post by Gass » 18 Aug 2017 16:37


Gass
Posts: 11
Joined: 17 Aug 2017 8:51

Unread post by Gass » 22 Aug 2017 18:45

It's Ok for Excel return but I regret Vip7 TableedControl

User avatar
Tonton Luc
VIP Member
Posts: 500
Joined: 16 Oct 2001 23:01

Unread post by Tonton Luc » 31 Aug 2017 6:33

Hi,

In tableedControl.i :

Code: Select all

tableedit_type = te_integer;    % INTEGER column type                  te_real;       % REAL column type                  te_long;       % INTEGER column type                  te_string;     % STRING column type (default: STRING column type)                  te_picture.    % picture column type

Post Reply