The rows in the [[Invantive Query Tool/Results|Results]] panel are exported through the "Export" button on the panel's own toolbar. The menu behind it lists the formats, and the choice decides which of the options below apply: ![[20260904-qt-export-menu.png]] ## The Formats - "Export to Microsoft Excel" writes a workbook, which is the format asked for most and the one which keeps the column types. - "Export to Adobe PDF", "Export to Microsoft Word", "Export to Microsoft XPS", "Export to Microsoft RTF" and "Export to HTML" write the grid as it is laid out, so a grouping or a hidden column is carried into the document. - "Print" sends the same rendering to a printer. - "Export to Delimited Text (CSV)", "Export to Tab-delimited Text (TSV)" and "Export to Plain Text" write text, with the separators, the quoting character and the escape of that character as chosen. - "Insert Statements (SQL)", "Select Statement (SQL)" and "Create Table Statement (SQL)" write the rows as statements rather than as data: the rows as inserts, one select which yields the same rows, or the `create table` which would hold them. The first and the last ask for the name the target table is to have. - "Export to XML", "Export to JSON", "Export to NDJSON" and "Export to JSON Data Set" write the rows in those notations. NDJSON puts one row on each line, which is what a program reading a large file line by line wants; "JSON Data Set" writes the shape a .NET `DataSet` reads back. ## The Options Which options are offered follows from the format: - to a file or to the clipboard, and a file can be opened straight away in the application registered for it; - with or without the column headings; - with or without the statement which produced the rows, written as a comment above them, so the file says where it came from; - limited to a number of rows, for a sample of a large answer; - for the text formats: the character between the fields, the character between the records, the quoting character and whether that character is escaped by doubling it. ## What Is Exported What is exported is what the grid shows: the rows retrieved so far, in the order and the grouping they are shown in, without the columns which are hidden. A statement whose answer is read further while scrolling therefore exports what has been read by then; running the statement to the end first, or asking for fewer rows in the statement itself, is what makes an export complete. Exporting from the grid is meant for the answer of one statement on screen. A recurring export, an export of many tables, or an export which has to run unattended belongs in [[Invantive Script/Invantive Script|Invantive Script]], which writes the same formats from a statement without a user interface, and in [[Invantive Data Hub/Invantive Data Hub|Invantive Data Hub]] for running it on a schedule.