Bug 165126 - Scriptforge ImportFromDatabase should allow with or without header
Summary: Scriptforge ImportFromDatabase should allow with or without header
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: ScriptForge
  Show dependency treegraph
 
Reported: 2025-02-08 13:29 UTC by jcsanz
Modified: 2026-03-23 03:13 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jcsanz 2025-02-08 13:29:32 UTC
Description:
Scriptforge ImportFromDatabase method from the SFDocuments.Calc service, should allow to decide if the imported data has a header with the fields names or not

Steps to Reproduce:
If use the ImportFromDatabase method from the SFDocuments.Calc service it is obtained a table data with the result of the sqlcommand, but the table always has a header with the fields name.
The table header can be a problem if the result is going to be appended to previous results, so my request is to add the possibility of obtain the results with or without the header

Actual Results:
Always the header is imported

Expected Results:
The possibility to decide if the imported table has header or not


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 25.2.0.3 (X86_64) / LibreOffice Community
Build ID: e1cf4a87eb02d755bce1a01209907ea5ddc8f069
CPU threads: 16; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: es-ES
Calc: CL threaded
Comment 1 Jean-Pierre Ledure 2026-03-22 12:01:03 UTC
Thanks for asking.
Having the option of importing data with or without a header row is very relevant.

However, ScriptForge uses internally the doImport() method available from the com.sun.star.util.XImportable interface. This method takes an import descriptor as argument.

The import descriptor looks like this:
(0)| Structure : com.sun.star.beans.PropertyValue --> DatabaseName  "" 
(1)| Structure : com.sun.star.beans.PropertyValue --> SourceType    0 
(2)| Structure : com.sun.star.beans.PropertyValue --> SourceObject  "" 
(3)| Structure : com.sun.star.beans.PropertyValue --> IsNative      True

It does not contain any option about the row header.

A workaround is to delete the row containing the header after the import.

ScriptForge won't do that by itself because the import does not impact areas external to the imported data. The header row might still contain older data left or right of the import zone.

I change the status of this bug to WONTFIX.

To post a request for a broader import descriptor, please open another bug.

Anyway, thanks for the suggestion.