[DataExport:0]
"Group Code","Menu Item Name","Portion Name","Barcode","Price"
{REPORT SQL DETAILS:
SELECT mi.GroupCode,
mi.Name AS MenuItemName,
p.Name AS PortionName,
mi.Barcode,
pr.Price
FROM MenuItems mi
INNER JOIN MenuItemPortions p
ON p.MenuItemId = mi.Id
INNER JOIN MenuItemPrices pr
ON pr.MenuItemPortionId = p.id
ORDER BY mi.GroupCode;
:F.GroupCode,F.MenuItemName,F.PortionName,F.Barcode,F.Price::"{0}","{1}","{2}","{3}","{4}"
}
this should get you going for your menu item report
breaking down the parts so you can build your own order tags report:
"Group Code","Menu Item Name","Portion Name","Barcode","Price"
these are your column headers for the CSV export
{REPORT SQL DETAILS:x:y::z}
this is the report expression that will run your SQL query and return the results
x: the SQL query
SELECT mi.GroupCode,
mi.Name AS MenuItemName,
p.Name AS PortionName,
mi.Barcode,
pr.Price
FROM MenuItems mi
INNER JOIN MenuItemPortions p
ON p.MenuItemId = mi.Id
INNER JOIN MenuItemPrices pr
ON pr.MenuItemPortionId = p.id
ORDER BY mi.GroupCode;
y: the fields/columns you want to return from the query
F.GroupCode,F.MenuItemName,F.PortionName,F.Barcode,F.Price
the names must match the column names or what name is specified (e.g. AS MenuItemName
)
z: formatting the output
"{0}","{1}","{2}","{3}","{4}"
{x}
where x is the index of where the column data is found - arrays start at 0 so the first column in the the above list, F.GroupCode
is {0}
. With the exception of {x}
all other characters will be return as typed.