holgerflick / flixaccounting

Build a non-trivial software project with Delphi
5 stars 1 forks source link

Add dynamic loading for reports #17

Closed holgerflick closed 9 months ago

holgerflick commented 10 months ago

Right now, all reports are hard-coded into the source code. If we use RTTI, reports can be looked up dynamically. Based on this, the user interface needs to be loaded as well.

The reason it is not part of the book release is that generating the user interface is a lot of boilerplate code that is off-topic. Also, providing nice button icons would also require some work for the icons to be encoded in base64 or similar in source code.

Might be a good example for Delphi 12 multi-line strings.

agallero commented 10 months ago

I am not sure I undestand what you are talking about, but anyway I will give my opinion. As it should be 😜 So, still know knowing exactly wha this is, I wonder if you can use the existing "MainDemo" in FlexCel for this... at least as a starting point. It just runs (and compiles on the fly) all the demos that are below it. It is all done dinamically so if you add a new folder with a new demo, it will show in the treeview at the left, and you will be able to run it. You can also search for words and find the correct demo.

You can just wipe all FlexCel demos from below it, and put your own on there. Probably not to print on the book, but you can give a URL where they can download this "demo runner" MainDemo is a little old (like 20 years old...) so it could probably use some modernization, specially for the icons, but it works. Maybe you can adapt it to something you can use. We are discussing adopting something like this for all tms demos (see https://github.com/tmssoftware/tms-smartsetup/discussions/121 )

holgerflick commented 10 months ago

Adrian, this repo refers to my demo application.

The example so far has 2 reports and there is a button on the UI for each. Instead, this issue suggests to create these buttons dynamically based on the report classes (IReport) that are found in the executable.

This has nothing to do with FlexCel.

Regards,

Holger Flick

--

Dr. Holger Flick

Chief Executive Officer, FlixEngineering LLC

P: 239.315.1042

Estero, FL 33928 | United States of America

From: adrian gallero @.> Sent: Tuesday, November 28, 2023 11:17 AM To: holgerflick/flixaccounting @.> Cc: Dr. Holger Flick @.>; Author @.> Subject: Re: [holgerflick/flixaccounting] Add dynamic loading for reports (Issue #17)

I am not sure I undestand what you are talking about, but anyway I will give my opinion. As it should be 😜 So, still know knowing exactly wha this is, I wonder if you can use the existing "MainDemo" in FlexCel for this... at least as a starting point. It just runs (and compiles on the fly) all the demos that are below it. It is all done dinamically so if you add a new folder with a new demo, it will show in the treeview at the left, and you will be able to run it. You can also search for words and find the correct demo.

You can just wipe all FlexCel demos from below it, and put your own on there. Probably not to print on the book, but you can give a URL where they can download this "demo runner" MainDemo is a little old (like 20 years old...) so it could probably use some modernization, specially for the icons, but it works. Maybe you can adapt it to something you can use. We are discussing adopting something like this for all tms demos (see tmssoftware/tms-smartsetup#121 https://github.com/tmssoftware/tms-smartsetup/discussions/121 )

— Reply to this email directly, view it on GitHub https://github.com/holgerflick/flixaccounting/issues/17#issuecomment-1830203841 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJXQKAI7JQUX7VBHRO57CLYGYE6TAVCNFSM6AAAAAA75AWHWCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZQGIYDGOBUGE . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AAJXQKBYKO4XYZ342BJGKOLYGYE6TA5CNFSM6AAAAAA75AWHWCWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTNC2Y4C.gif Message ID: @. @.> >

agallero commented 10 months ago

This has nothing to do with FlexCel.

yep, I imagined so :) Still I mentioned it because you might be able to adapt the MainDemo from FlexCel to your demos, or get ideas from it. It does exactly that, but lists the demos in a treeview instead of adding buttons.