FET Forum

FET Development => Contribute Input File / Show Off Your Timetable => Topic started by: Fiorellino on August 30, 2020, 11:44:35 PM

Title: FET TimeTable & Activities IMPORT (EXPORT?) to EXCEL
Post by: Fiorellino on August 30, 2020, 11:44:35 PM
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 (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:

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 (https://en.wikipedia.org/wiki/Office_Open_XML)

ANYONE is invited to test this beta version (I'm already working on some minor updates)
Title: Re: FET TimeTable & Activities IMPORT (EXPORT?) to EXCEL
Post by: Liviu Lalescu on August 31, 2020, 07:35:22 AM
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.
Title: Re: FET TimeTable & Activities IMPORT (EXPORT?) to EXCEL
Post by: Fiorellino on August 31, 2020, 11:11:55 PM
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 (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)
Title: Re: FET TimeTable & Activities IMPORT (EXPORT?) to EXCEL
Post by: Liviu Lalescu on September 01, 2020, 09:04:58 AM
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.
Title: Re: FET TimeTable & Activities IMPORT (EXPORT?) to EXCEL
Post by: Fiorellino on September 01, 2020, 09:37:05 AM
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 (https://wiki.qt.io/Handling_Microsoft_Excel_file_format)

and I think that a good QT external library to give a try can be this one :
GitHUB - VSRonin - QtXlsxWriter (https://github.com/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
Title: Re: FET TimeTable & Activities IMPORT (EXPORT?) to EXCEL
Post by: Liviu Lalescu on September 01, 2020, 10:04:45 AM
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.