Hi Derek,Joshua.
Quick solution to not insert null row data after records.
SQLite does not support variables and we will not create temporary tables in memory.
Create a separate table. For example "tenlines". With one column "num". Fill it in with numbers from 1 to 10 or any number 1 only all 10 lines.
You can enter data into the table in the script once if it is not filled.
Edit Report (SQL). We will UNION with data and limit the output. LIMIT 10.
SELECT
orders.id as "orders.id",
orders.customerName as "orders.customerName",
orders.orderDate as "orders.orderDate",
orders.salesRep as "orders.salesRep",
orderLines.qty as "orderLines.qty",
orderLines.number as "orderLines.number",
orderLines.description as "orderLines.description",
orderLines.price as "orderLines.price",
NULL
FROM
orders
JOIN orderLines
ON orderLines.id_orders=orders.id
WHERE
orders.id=$id
UNION ALL
SELECT $id as "orders.id",
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
num
FROM tenlines
ORDER BY 9 -- sort by 9 columns
LIMIT 10
OR without create table
It is irrational if the number of lines will be more. )
SELECT
orders.id as "orders.id",
orders.customerName as "orders.customerName",
orders.orderDate as "orders.orderDate",
orders.salesRep as "orders.salesRep",
orderLines.qty as "orderLines.qty",
orderLines.number as "orderLines.number",
orderLines.description as "orderLines.description",
orderLines.price as "orderLines.price",
null
FROM
orders
JOIN orderLines
ON orderLines.id_orders=orders.id
WHERE
orders.id=$id
UNION ALL
SELECT $id as "orders.id", NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1 as num
UNION ALL
SELECT $id as "orders.id", NULL, NULL, NULL, NULL, NULL, NULL, NULL, 2 as num
UNION ALL
SELECT $id as "orders.id", NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3 as num
UNION ALL
SELECT $id as "orders.id", NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4 as num
UNION ALL
SELECT $id as "orders.id", NULL, NULL, NULL, NULL, NULL, NULL, NULL, 5 as num
UNION ALL
SELECT $id as "orders.id", NULL, NULL, NULL, NULL, NULL, NULL, NULL, 6 as num
UNION ALL
SELECT $id as "orders.id", NULL, NULL, NULL, NULL, NULL, NULL, NULL, 7 as num
UNION ALL
SELECT $id as "orders.id", NULL, NULL, NULL, NULL, NULL, NULL, NULL, 8 as num
UNION ALL
SELECT $id as "orders.id", NULL, NULL, NULL, NULL, NULL, NULL, NULL, 9 as num
ORDER BY 9 -- sort by 9 columns
LIMIT 10
And remove rows with NULL or create new table "orderLines". Remove procedure add NULL from script.
If you have any difficulties, I'll post a modified version.
I'll watch the report later.