FET TimeTable & Activities IMPORT (EXPORT?) to EXCEL

Started by Fiorellino, August 30, 2020, 11:44:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Fiorellino

Hi guys, ;) how are you?

First of all, I would like to send a BIG thank you to Liviu for this beautiful and POWERFUL open-source software!

I'm trying to help a friend to plan a good school timetable so I accidentally became a new FET user (maybe 'cause I have some few skills on Office / Excel VBA automation)

She pointed me to this old resource on the FET forum: https://lalescu.ro/liviu/fet/forum/index.php?topic=504.msg2970#msg2970

It is an old Office 2010 Excel sheet with a macro (with Italian comment and Italian labeling for variable names, so not fully comprehensive for an international developer) that can import a .FET file and its related (generated) _ACTIVITIES.XML into the Excel sheet itself;
it's very useful if you need to re-layout the timetable and need to adapt data in a (good enough) printable format because you can add header and footer, apply a school logo and change anything you need with the flexibility of a spreadsheet.
Obviously  :o, the macro doesn't work with a recent Excel version (2016/2020), and then I get involved 8)

Attached to this post my first updated version that fixes some incompatibilities I've found with the latest Office 2016/2020.

Please note that it's still a beta version and has only been tested with MSOFFICE 2016 ITA - Excel version 16.0.4849.1000 - 32 bit

KNOWN BUG / USEFUL NOTES:

  • does not (yet ...) work on Office / Excel for MAC OSX
    (but works in progress to fix code)
  • not fully tested compatibility with the 64-bit version of the latests Office / Excel versions
    (some compilation errors and warning are gone but  ::) -> Converted from Long to LongLong and 32-bit library calls are now 32/64 compatible)
  • Macro/Automation doesn't works in OpenOffice / LibreOffice and never will works ...
    (you can convert and open the worksheet but the macro doesn't start, in fact, it is ignored when opening / converting file because it is written in
    VBA -> VisualBasic for Application, a programming language patented by Microsoft, covered by their copyright and used in all their Office products like Word, Excel, Access, Outlook ...)

The LONG-TERM solution for OpenOffice / LibreOffice is a complete macro conversion to JAVA scripting language but it is not an easy task,
Maybe much better to add in FET an EXPORT to Office Open XML format (usable both by Microsoft Excel and LibreOffice Calc) ... Liviu, are you listening? ;D
https://en.wikipedia.org/wiki/Office_Open_XML

ANYONE is invited to test this beta version (I'm already working on some minor updates)

Liviu Lalescu

#1
Hello, Fiorellino, and welcome to the forum!  :)

Thank you for your kind words and for your work!

Unfortunately, I am not skilled at all in Office_Open_XML. Also, it is a Microsoft format, which I am trying to avoid. But it might be easy for a programmer to take the .fet results data file and create a program to convert it to O_O_XML.

Fiorellino

Hi Livium, thank you for your quick response!

I'm not an Office Suite expert (nor commercial or free/opensource) but according to Wikipedia Office_Open_XML is a standardized format developed by Microsoft and approved from an international committee or consortium (originally EICMA, later ISO) which can be easily open, used and converted from a lot of Office Suite software

BUT

maybe using a true, open and free office format like OpenDocument is the right choice for a solution like FET
https://en.wikipedia.org/wiki/Comparison_of_Office_Open_XML_and_OpenDocument

It's so difficult to think that after a timetable has been successfully generated, the same data can also be exported in an Office open format ?
(like the .html webpages already built)

QT Library can't help in this not so easy task ?
(sorry I don't know this framework anymore after I've used it a long time ago when it was a TrollTech product called QT Embedded)

Liviu Lalescu

Thank you, Fiorellino, for your suggestion! Unfortunately, I have no experience with this, but I added your suggestion in the TODO list. Actually, many people suggested this in the past, see the TODO file, items: #18, #124, #152, #170, #300, and #310 (yours will be #420).

I think Qt does not have functions for this.

I am ready to talk some more about this.

Fiorellino

Thank you Liviu for adding my suggestion, I will catch TODO file for items tagged as #18, #124, #152, #170, #300, #310 (ad mine #420)

Some good suggestion for handling OOXML file format with QT can be found here :
Handling Microsoft Excel file format within QT

and I think that a good QT external library to give a try can be this one :
GitHUB - VSRonin - QtXlsxWriter

I will take some time to dig in FET source code to try to understand how it works...
Liviu stay online 'cause I'll have some questions for you in the next days  ;D

Liviu Lalescu

#5
OK, I think I will be online  :)

You don't necessarily need to see the FET C++ code. You could see the file_data_and_timetable.fet timetable file. This consists of the data file + all the constraints to lock activities in time and space with constraints activity preferred starting time / preferred room. The format is straight-forward XML.

PS: I stickied this topic, so that the users can benefit better from your script. If you consider, we could add it on another more relevant board.