Hello everyone.
I need to separate a report from the main app.
For example:
→ parent.app with all functionalities
→ report.app only with the report
Explaining:
By separating the two, I can update only one or the other, without having to stop all the work on the client, when the update is for the layout, for example.
Is something like this possible?
return#=report.app(data)
if return false…
Do you currently have your DCT and Files in a separate APP / DLL ?
That would be a first step to get working before making a DLL for Reports. You will find the DLL Tutor in the examples.
A simpler way I have seen done that avoids the DLL need is to make the Reports APP create another EXE. Then in your Main APP you RUN('MyReports.exe RunReport=Laudo_Todos_Relat'). Do not RUN( ,1) with the “,1” to wait, that will hang your main exe.
In the Reports EXE the Main procedure would a Source Procedure. It would check COMMAND() to see if there was a command line with a Report and run that then HALT. If no command it could call a Frame procedure. That would be very handy for your development and testing.
This way has some advantages that the reports are running in a separate process so your Main EXE is fully functional. You can always change the Reports.EXE to a DLL in the future.
To copy/move your current Report procedure to your new Reports APP my preferred way is to do a Selective Export to TXA, then Import TXA into the Reports APP. I have had problems with Import from APP so avoid it. This also leaves a little history of TXAs with procedures moved/copied.
As you are working on getting Laudo_Todos_Relat() to work in a separate EXE you will probably find you are copying in other procedures and code it needs to work.
So now all of that is duplicated in both APPs. At some point you see too much duplicated and it makes sense to have DLLs so that code is in one place. Most of us have DLLs, it just works better.
You might still have the special Reports.EXE for each customer. But it shares common DLLs with you Main App that has all the shared code.
If you have a custom report for each client why don’t you look at Allerup Report Designer . I believe it’s currently Open Source and someone has ported it to C11, I remember a thread on this forum about it.
Allerup Report Designer lets you create custom reports without recompiling your app.
As for splitting your app into multi-dll, for some time I do it with all my apps except really small ones. Compiling one dll or exe takes significantly less time than compiling everything, even though I do clean solution and recompile everything before release anyway just to make sure there are no conflicts resulting from missing globals or changes in file structures. Recompiling everything takes some 30 mins, but that gives me some time to drink coffee and relax a bit.
I have a solution consisting of 8 dll’s and 6 exe’s ( exe’s mostly have just main menu procedure calling procedures in other dll’s as not all users need all functionalities ). Just note that if your exe is using a specific dll with a report it will lock it preventing you from replacing it as long as the exe is running anyway. However if you put your custom report in report.exe and not have it in parent.exe and other generic reports in genericrpt.dll. This way your both your report.exe and parent.exe can access reports in genericrpt.dll and your custom one will be in report.exe only.