ThisDatabaseDocument.ReportDocuments.getByIndex(0).open On Error Goto 0 Exit Sub Erro: MsgBox "ERRO " + Err + Chr$(13) + Error$ + " (linha: " & Erl & ")" On Error Goto 0 No error handling. Program just crashes and I need to recover it. Java 1.8.0_144 (64) W10 - 1703
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided. (Please note that the attachment will be public, remove any sensitive information before attaching it. See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)
Created attachment 135940 [details] Empty database with form & button calling the report Please note that in this empty database error handling is working. If I can attach picture of error message? Don't know how to attach 2 files (?) In the real database Base crashes but I can manually open the desired report.
Created attachment 135941 [details] Message from error handler
c18florentino: you can't attach 2 files in the same action, either you'll use several times https://bugs.documentfoundation.org/attachment.cgi?bugid=112165&action=enter or you can compress your files in 1 (zip or tar.gz).
Have tested this one. Couldn't reproduce a crash. LO shows the same error while opening a report without connection to a datasource and opening the same report by macro. Tested with LO 5.4.4.2 on OpenSUSE 42.2 64bit rpm Linux. If crash doesn't appear in this empty database: We need an example, which produces the crash.
"LO shows the same error while opening a report without connection to a datasource and opening the same report by macro." Ok. So it's a bug, right?
Ok... tested again original front-end (.odb connected to Oracle XE) and now it works fine. LO 5.4.3.2 (x64) But you can see in the example I uploaded that report doesn't open up. When connected to the database, LO crashed. Thanks for your attention.
On pc Debian x86-64 with master sources updated today, I gave it a try after having put macro security to Medium. 1) when trying to open the report, I got an error message "The document "rptBug" could not be opened 2) when trying to run the macro with Tools/Macros/Run Macro..., selected "AbrirRelatorio" in <file>/Standard/Module1, I got: A Scripting Framework error occurred while running the Basic script Standard.Module1.AbrirRelatorio. Message: wrong number of parameters! 3) when trying to run the macro with Tools/Macros/Organize macros/LO Basic, Edit "AbrirRelatorio", F5, same error as 1) In brief, I got same results as Robert had in comment 5 To respond to your question, I don't see bug here for the moment.
(In reply to c18florentino from comment #6) > "LO shows the same error while opening a report without connection to a > datasource and opening the same report by macro." > Ok. So it's a bug, right? No, it isn't. The report needs a datasource. Without a datasource it will fail to execute. LO doesn't crash and gives an error-dialog.
As I've said, originally report WAS connected to DB (as today and it worked). LO crashed. So, a LO Report cannot have only labels on it? A "recordset" ou "recordsource" is a REQUIRED parameter for these objects to open?
(In reply to c18florentino from comment #10) > As I've said, originally report WAS connected to DB (as today and it worked). > LO crashed. > So, a LO Report cannot have only labels on it? > A "recordset" ou "recordsource" is a REQUIRED parameter for these objects to > open? Indeed, the first you are asked for when creating a report is a datasource. You could create a query, which doesn't ever show any content > the report would open without any content. Have tested this with your example-database. The macro you added in the database produces a crash here: Sub AbrirRelatorio (e As Object) On Error Goto Erro ThisDatabaseDocument.ReportDocuments.getByIndex(0).open On Error Goto 0 Exit Sub Erro: MsgBox "ERRO " + Err + Chr$(13) + Error$ + " (linha: " & Erl & ")" On Error Goto 0 End Sub This macro won't be executed, if the report won't open. But if the report will open it is looking for '0' - where should it be? '0' is a number, not text where the macro could jump to. Sub AbrirRelatorio ThisDatabaseDocument.ReportDocuments.getByIndex(0).open End Sub will open the report, if connected to a datasource. No problem if the table or query is empty ...
Goto 0 is the exception handling. It deactivates & resets error information status. Has nothing to do with the report. "the first you are asked for when creating a report is a datasource." No. I can open a blank report on editor (without assistant) and draw labels or insert images... But if you say LO requires a resultset as a parameter - ok, understood. I repeat: it WAS connected to a table. In my experimental setup here I mantained the button who calls the macro opening the repor and now it worked. I think it is the new version of LO we are now using. This report is a receipt. User selects date (time period) and other customer info, previews the $ amount and fills extended value as desired. Then clicks the button and receipt is generated. It worked as desired except that the reported needed to be open manually in the Reports section of Base. Now the button is workinf as desired originally. I know this isn't a Forum, so thank you and really now there isn't bug.
(In reply to c18florentino from comment #12) > > "the first you are asked for when creating a report is a datasource." > No. I can open a blank report on editor (without assistant) and draw labels > or insert images... When I start to create a report here without wizard in a database I get this: The editor takes the first available datasource and offers me the dialog for putting fields (from this datasource) to this report. This behavior hasn't been changed since I am working with Base (and published the first Base-Handbook). I have to delete the content for data, if I will create a report without datasource - or there isn't any datasource (table, query, view) in the *.odb-file. > But if you say LO requires a resultset as a parameter - ok, understood. Could be the appearing dialog is misleading or we should allow to create reports without data. Feel free to write a new bug (as feature-request) for this. > Now the button is working as desired originally. > I know this isn't a Forum, so thank you and really now there isn't bug. So I will set this bug to RESOLVED and WORKSFORME.