Generating a report

Hi All

Struggling to create a report using a sqlite database for the source

I’ve triad adapting the example from the docs but unable to get it to run

Var sql As String = “Select * from Selection”
Var rpt As New selection

Var rs As RowSet = DB.SelectSQL(sql)
Var ps As New PrinterSetup

If rpt.Run(rs, ps) Then
If rpt.Document <> Nil Then
End If
End If

I’ve made selection a class with super of report ??? not sure if that s correct

if anybody could give me a ‘Doughnuts’ guide to creating a basic report in a windows desktop app I’d be grateful


What exactly does not work? Compiler error (s) and/or anything else you observe?
Please provide details.


the error is

frmReports.Button1.Pressed, line 10
Too many arguments: got 1, expected only 0.

ok, thanks. If you did not start with a sample project, I suggest that you do so.
You’ll find some in Xojo’s ‘Example Projects/Printing and Reporting/Reporting/’. Choose one that is closest to what you want to achieve. Starting with a working file is easier than taking a code snippet from the doc (my own experience).

Well I’ll be …

I checked the example projects in 2022 r2 before posting and there were none related to reporting! after your reply I wend back and thought to check 2022 r1.1 and low and behold there they are! Apologies I incorrectly assumed both r1.1 and r2 would have the same example projects but how wrong was I

Thanks for the help I hope to be able to get my head around reports now



1 Like

P.S. There is also a webinar on Youtube, where @Paul_Lefebvre explains how reporting works.