Skip to Main Content

SQL Developer

User reports with custom actions may not be correctly persisted

user9540031Dec 13 2021

Tested on: SQL Developer 21.2.1 (Windows 10, Windows 7)
1/ Summary
User reports enhanced with custom actions can be opened as user-defined reports in SQL Developer, and successfully run. However, they may be incorrectly persisted into SQL Developer's main UserReports.xml file, causing the custom actions to fail unpredictably after restarting SQL Developer.
2/ Workaround
Deploy reports containing custom actions as user-defined XML extensions, of type REPORT (menu Tools -> Preferences.., then Database::User Defined Extensions panel).
(Opening the report as a user-defined report is fine for testing, though.)
3/ References
http://www.thatjeffsmith.com/archive/2014/04/how-to-add-custom-actions-to-your-user-reports/
https://github.com/oracle/oracle-db-examples/tree/master/sqldeveloper/extension/xml#simple-user-extensions-xml
4/ Example
Sample report with custom action:
favorite_wish_list.xml.gz (743 Bytes)image.pngCorresponding UserReports.xml file—manually edited in order to restore newlines and indentation in the <item> element.
UserReports.xml.gz (748 Bytes)Remark: if you're bothered about downloading untrusted content, so am I—I'd have merely copy-pasted the XML markup into a code section, but sorry, the Forums software barks at that markup and won't let me do that: "Access Denied, You don't have permission to access "http://splash.oracle.com/tech/developers/post/discussion/sql_developer?" on this server. Reference #18.c721102.1639415785.2338a889" says the popup
If you compare the markup from the original report file (favorite_wish_list.xml) and from the corresponding UserReports.xml file, you'll notice that the original contents of the <sql> element in the <confirmation> element has been improperly replaced with that of the "main" <sql> element of the <item>.
This is obviously wrong, and in this particular case it causes unsubstituted placeholders in the confirmation message. In real-life use cases I have also seen situations in which the entire action would be broken (hence do nothing at all), but I couldn't reproduce that in a simple test case.
Regards,

Comments
Post Details
Added on Dec 13 2021
1 comment
25 views