A designed report to print
A monthly report on paper is often a bare table, and a document tool's default look reads like a school paper. Here the assistant makes the report as a Quarto document with a theme of its own, so it prints like something the agency designed, and next month it is one setting and a button away. The data is a library of crimes reported in Durham, NC, from the city's open data.
Follow along: download dashboards.zip (4.7 MB) and unzip it. Add the files in its data folder to a library, then include the library in a project.
1. Put the data in a library
Add the data files to a library: each becomes a table in the library's DuckDB file, with a profile the assistant reads. Here, Durham crime: the city's crimes, calls for service, and outline. A data connection's lakehouse works the same way. Then include it in a project with the Explorer's + Library.
Expand2. Let the assistant work
Open the project and press Sandbox locked. Turn on Accept assistant edits automatically, so it can write the report's files, and Assistant-run Python, so it can look at the data and render the PDF.
Expand3. Ask for the report
Say what the report covers, from which data, and who it is for. Here: "Make a monthly crime report for November 2024 from the Durham crime library, as a PDF we can print and hand out at CompStat. Make it look designed, not like a plain table, and so I can run it again next month by changing the month. We are not the Durham police, so label it a demo made from the city's open data." The report design skill gives the assistant the look: the type, the colors, the layout, and the pieces that draw them.
Expand4. Read what it made
It writes the report (a .qmd file) and two files that carry the look, report_theme.typ and report_kit.py, renders the PDF, and checks the pages. Then it says what is on each page.
Expand5. Open the PDF
The PDF opens in a tab. Page 1 is the month at a glance: a title band, a tile for each of the largest groups of crime with its change from a year earlier and a sparkline, what stands out, a box for the analyst's own note, and a chart.
Expand6. Turn the pages
Press the down arrow in the PDF's toolbar for the next page. The tables and charts use the same type and colors as the first page, so the report reads as one piece.
Expand7. Run it next month
Open the .qmd. The settings are at the top of its first chunk: change the month, here from 2024-11 to 2024-12, press Ctrl+S, then Render PDF. The numbers, charts, and words follow.
Expand8. The next month's report
The PDF is made again, for the new month, with nothing else changed.
ExpandGood to know
- Each run is a little different: the assistant writes its own report each time, so yours will not look exactly like this one. Ask for changes from here, such as other groups, a district page, or another chart.
- The look lives in
report_theme.typandreport_kit.py. Change the colors there, or add the agency's logo, and every report made with them follows. - The report's Python runs in the app's sandbox, and Quarto and Typst, which come with the app, make the PDF on this computer.
- Write the analyst's note in the
.qmdbefore rendering: it is the one part of the report written by hand. - The crimes come from the City of Durham's open data portal.