Reports - Determine when table finished filling data

Discuss the database features

Reports - Determine when table finished filling data

Postby arfgh » Sat Mar 09, 2019 1:01 pm

Hey there friends.
Just need to determine from macro level when the loaded report finished to fill the table with the data.
I have explored the events, and none of them seems to help to determine that.
Also i did some MRI exploration without success....
Reason to need that determine is to implement other subroutine that change data on the columns by hyperlinks, that will help so much for other DB functions i have in mind.

So, how to determine the report finished to fill data in the table ?
OpenOffice last version - Windows 8.1 Enterprise x64 - Windows XP x64 SP2
arfgh
 
Posts: 452
Joined: Tue Mar 05, 2013 6:44 pm

Re: Reports - Determine when table finished filling data

Postby F3K Total » Sat Mar 09, 2019 6:06 pm

Simple:
Open the report by code then you can have access to it when it finished to fill the table with the data:
Code: Select all   Expand viewCollapse view
    oreportdoc = thisdatabasedocument.reportdocuments.getbyname("NAME_OF_YOUR_REPORT")
    oreport = oreportdoc.open
    MRI oreport
    ...
    MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
    my current system
  • Windows 7 OOo, AOO, LOLinux Mint OOo, AOO, LO
F3K Total
Volunteer
 
Posts: 934
Joined: Fri Dec 16, 2011 8:20 pm

Re: Reports - Determine when table finished filling data

Postby arfgh » Sat Mar 09, 2019 6:35 pm

that's the problem, they are opened from the reports section of base by the user....
OpenOffice last version - Windows 8.1 Enterprise x64 - Windows XP x64 SP2
arfgh
 
Posts: 452
Joined: Tue Mar 05, 2013 6:44 pm

Re: Reports - Determine when table finished filling data

Postby F3K Total » Sun Mar 10, 2019 10:20 am

Do you want to show, what's not easily doable or solve a real problem?
If the second, give them a button in the form, where they filter the reports content.
    MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
    my current system
  • Windows 7 OOo, AOO, LOLinux Mint OOo, AOO, LO
F3K Total
Volunteer
 
Posts: 934
Joined: Fri Dec 16, 2011 8:20 pm

Re: Reports - Determine when table finished filling data

Postby longi » Sun Mar 10, 2019 1:28 pm

Well
As I could finally catch, I think you want to use a report as a form, in order to use data , not to print them, but you can.
You have to open the report, and in the execution time you have to fill the selected cells with the hyperlinks you have stored somewhere.
In this example, you have a table (the old normal table) and another one in which I put some hyperlinks.
I made a query in order to have an array with the hyperlinks I want, and, in the execution time, I filled every cell I wanted with the specific hyperlink for each row.
You have to be able to modify the query, in order to get the hyperlinks you want to insert, which depends on the report source (in this case both tables are similar, but it is not neccessary this way).

I hope I understood you properly.

Bye! ;)
Attachments
Hyperlink.7z
(60.2 KiB) Downloaded 36 times
OpenOffice 4.1.5 on Windows 10
LibreOffice 5.1 on Windows 7
LibreOffice 6.0.1 on Windows10
longi
 
Posts: 108
Joined: Mon Jul 15, 2013 5:04 pm

Re: Reports - Determine when table finished filling data

Postby arfgh » Sun Mar 10, 2019 6:30 pm

Longi, that your example. What i need is to determine via macro, when your report 'comarcas' finished to load data, in order to execute other subroutine that will add hyperlinks on one of the columns. The problem i am having is that i am unable to determine via macro when the report finished to do the job. And yes, at the moment i added an event to pass the mouse over to execute that subroutine...
But wanted is to be able to determine when report finished to load.
OpenOffice last version - Windows 8.1 Enterprise x64 - Windows XP x64 SP2
arfgh
 
Posts: 452
Joined: Tue Mar 05, 2013 6:44 pm

Re: Reports - Determine when table finished filling data

Postby RoryOF » Sun Mar 10, 2019 7:38 pm

Here are two references which may help
http://www.openoffice.org/api/docs/comm ... eable.html
viewtopic.php?f=20&t=37023#p169875

You are the one who needs to do this - it is up to you to investigate how to do it. I have no need to.
Apache OpenOffice 4.1.7 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29751
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Reports - Determine when table finished filling data

Postby longi » Sun Mar 10, 2019 8:03 pm

As far as I Know, a report is a non editable document, so we are oblied to make changes, if we want, in the execute time.
As you can see in the macro, after the 'open', you has more code, and it is working after the report was finished (and I thought you needed that).
If you have a different macro, you can put a call for it after the 'open' moment, and it will work properly:

Code: Select all   Expand viewCollapse view
Sub NormalReport
    '--------------------------------------------------------------------
    ' 0 We declare the variables
   
    Dim oreportdoc As Object, ocontroller As Variant
    Dim oTextTable As Variant, oCell As Variant
    Dim oCurs As object, oText As Variant
    '------------------------------------------------------------------------------
    '1º We open our report
   
    ocontroller = Thisdatabasedocument.currentController
    if not ocontroller.isconnected then ocontroller.connect                                        ' The connection
    oreportdoc = Thisdatabasedocument.reportdocuments.getbyname("COMARCAS").open                   ' We open the report
    Call "Your macro"
End Sub


To summarize: a report is a non editable document and I only know this way to modify the original structure.
If you want to modify a column you have to put your code inside the macro (or a call to your macro), and you'll get the result of your code after the report result was loaded.

Bye! ;)
Last edited by longi on Sun Mar 10, 2019 11:32 pm, edited 1 time in total.
OpenOffice 4.1.5 on Windows 10
LibreOffice 5.1 on Windows 7
LibreOffice 6.0.1 on Windows10
longi
 
Posts: 108
Joined: Mon Jul 15, 2013 5:04 pm

Re: Reports - Determine when table finished filling data

Postby arfgh » Sun Mar 10, 2019 8:20 pm

no, the report is opened via base reports section by iteraction of the user. It is very strange that there are no any events that help on this...
We can edit the loaded report, but the problem is just to determine when finished the loading data into table.
OpenOffice last version - Windows 8.1 Enterprise x64 - Windows XP x64 SP2
arfgh
 
Posts: 452
Joined: Tue Mar 05, 2013 6:44 pm

Re: Reports - Determine when table finished filling data

Postby longi » Sun Mar 10, 2019 11:31 pm

Sorry, but my little knowledge don't permit me to edit a report previously opened.
In my way, I always open a report by a button, in a form, in order to use the total macro, so I can edit it, add a new column or write different texts inside a cell, or put a hyperlink, etc.
So, I recommend to use a button in a form to deal with reports, as a logical way.
If you has different tipe of reports depending of the user, you can change the code in the button, or change the filter of the report depending on the user, etc.
I can't help you more about this topic.

Bye! ;)
OpenOffice 4.1.5 on Windows 10
LibreOffice 5.1 on Windows 7
LibreOffice 6.0.1 on Windows10
longi
 
Posts: 108
Joined: Mon Jul 15, 2013 5:04 pm

Re: Reports - Determine when table finished filling data

Postby arfgh » Mon Mar 11, 2019 12:49 am

it is perfectly possible to edit a report previously opened. Like i said before i do it from event, but to do that, first the report must finish the table flill, it is what i want to determine, when did finish.

Calling MR Villeroy....
OpenOffice last version - Windows 8.1 Enterprise x64 - Windows XP x64 SP2
arfgh
 
Posts: 452
Joined: Tue Mar 05, 2013 6:44 pm

Re: Reports - Determine when table finished filling data

Postby F3K Total » Mon Mar 11, 2019 7:22 pm

Bind it to the .odb's event "Deactivate Document"
Code: Select all   Expand viewCollapse view
sub main
    sReportName = "Addressdata"
    sExtension = ".odt"
    oActiveFrame = Stardesktop.activeFrame
    do
        wait 10
    loop while ismissing(Stardesktop.currentComponent)
    if instr(oActiveFrame.Title,sReportName) > 0 AND  instr(oActiveFrame.Title,sExtension ) > 0 Then
        print "Report """ & sReportName & """ is loaded"
        oLoadedReportComponent = Stardesktop.currentComponent
        mri oLoadedReportComponent
    endif
end sub
    MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
    my current system
  • Windows 7 OOo, AOO, LOLinux Mint OOo, AOO, LO
F3K Total
Volunteer
 
Posts: 934
Joined: Fri Dec 16, 2011 8:20 pm

Re: Reports - Determine when table finished filling data

Postby longi » Mon Mar 11, 2019 11:32 pm

Sorry!
I always use the SRB, not ORB, so my reports are not editable (one another thing to study in order to change it!)

bye! ;)
OpenOffice 4.1.5 on Windows 10
LibreOffice 5.1 on Windows 7
LibreOffice 6.0.1 on Windows10
longi
 
Posts: 108
Joined: Mon Jul 15, 2013 5:04 pm

Re: Reports - Determine when table finished filling data

Postby arfgh » Wed Mar 13, 2019 2:00 am

the main question is about base reports, not ORB. ok F3K Total, i will try that.....
OpenOffice last version - Windows 8.1 Enterprise x64 - Windows XP x64 SP2
arfgh
 
Posts: 452
Joined: Tue Mar 05, 2013 6:44 pm

Re: Reports - Determine when table finished filling data

Postby arfgh » Wed Mar 13, 2019 9:50 pm

very curious F3K Total, that event deactivate cause that all into base receive that event... forms, reports, and even main 'untitled 1' base gui screen....
OpenOffice last version - Windows 8.1 Enterprise x64 - Windows XP x64 SP2
arfgh
 
Posts: 452
Joined: Tue Mar 05, 2013 6:44 pm

Re: Reports - Determine when table finished filling data

Postby Villeroy » Wed Mar 13, 2019 10:12 pm

arfgh wrote:Calling MR Villeroy....

no idea what you're asking for
way over my head
dazzled and confused, sincerely V.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 27296
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Reports - Determine when table finished filling data

Postby arfgh » Thu Mar 21, 2019 2:55 pm

F3K Total wrote:Bind it to the .odb's event "Deactivate Document"
Code: Select all   Expand viewCollapse view
sub main
    sReportName = "Addressdata"
    sExtension = ".odt"
    oActiveFrame = Stardesktop.activeFrame
    do
        wait 10
    loop while ismissing(Stardesktop.currentComponent)
    if instr(oActiveFrame.Title,sReportName) > 0 AND  instr(oActiveFrame.Title,sExtension ) > 0 Then
        print "Report """ & sReportName & """ is loaded"
        oLoadedReportComponent = Stardesktop.currentComponent
        mri oLoadedReportComponent
    endif
end sub


Finally i did what i require thx to your help. Anyways can you please explain a bit more about that 'deactivate' event ? because, like i said before, it is running in all base elements even on the main base screen. At the moment i was able to use that way you revealed to wait on certain report while the table is filling data, but also i have been noticed that sometime, for unknown reasons, this way make the entire base to crash.... We need to know more about 'deactivate event'.
OpenOffice last version - Windows 8.1 Enterprise x64 - Windows XP x64 SP2
arfgh
 
Posts: 452
Joined: Tue Mar 05, 2013 6:44 pm


Return to Base

Who is online

Users browsing this forum: No registered users and 4 guests