← Reports Academy

Build the solution · 4 / 5

Deliver separate workbook sheets

Package the job list and prepared note as a useful workbook.

YOUR TASK

Make this happen

3 steps
  1. Add a workbook output and Jobs/Handover sheets reading jobs and summary. Preserve the CSV output.

  2. Keep the working capabilities from the previous lesson and connect the new pieces to the same solution.

  3. Check the complete solution, then inspect any unmet requirements.

This step starts with the earlier solution and one new challenge. Each lesson keeps its own draft.

Read the starter files

main.cococo

report_document "weekly" {
  schemaVersion = 1
  snapshotRetentionDays = 30
  sources = [report_source.jobs]
  outputs = [report_output.csv]
  parameters = [report_parameter.show_note]
  preparationScript = file("prepare.lua")
}

source.cococo

report_source "jobs" {
  name = "jobs"
  kind = "MICRO_SQL"
  query = "SELECT jobs.name, jobs.status FROM jobs ORDER BY jobs.name ASC LIMIT 100"
}

outputs.cococo

report_output "csv" {
  name = "jobs.csv"
  format = "CSV"
  storage = "DATABASE"
  dataset = "jobs"
  columns = ["name", "status"]
}

parameters.cococo

report_parameter "show_note" {
  name = "showNote"
  label = "Include handover note"
  type = "BOOLEAN"
  required = false
  defaultValue = false
}

prepare.lua

input.datasets.summary = {{ message = "Production handover" }}
return input

sheets.cococo

report_sheet "jobs" {
  name = "Jobs"
  # TODO: add dataset — see the task above.
  # TODO: add columns — see the task above.
}

report_sheet "summary" {
  name = "Handover"
  # TODO: add dataset — see the task above.
  # TODO: add columns — see the task above.
}

Reference: reports · getting-startedreports · sql-authoringreports · valuesreports · preparationreports · pdf-templatesreports · operationsreports · reference