Xojo's Report

Hi everyone,

I would like to use Xojo Report-Engine to create Reports for a SQLite-Database. I have 2 Tables: Classes and Students.
Now I like to create a Report, which shows all Classes with all Students which are members of every Class.

[code]Report-Structure

Class 1

Properties of the Class…

Students:
- Student 1
- Student 3

Class 2

Properties of the Class…

Students:
- Student 2
- Student 4


[/code]

Will such a Report-Structure possible with Xojos native Report-Engine?

Ofcourse. This is the basics behind reporting. Look into the e-Books that come with Xojo.

Sure? Because I want all Classes in one report…

Sure that could work. Anything that implements the Reports.DataSet interface can be used as the source of data for a report.

http://developer.xojo.com/userguide/displaying-reports
http://developer.xojo.com/reports

Sounds nice. What I do not understand is, for displaying the Students of each Class, I need something like a sub report, isn’t it so?

SELECT * FROM Classes, Students WHERE Students.ClassID = Classes.ID ORDER BY Students.Surname ASC

What about a GROUP BY instead?

Tim, could you please explain a bit more?

I created a Report called Report1 and added 1 GroupSection. I use Groupsection to show the Columns of a Class and the Body Section to show the Students of the class.

I created a little sample. You can find it here. The ClassDB.db has a third Table “ClassNotes”. How to integrate them? Also the Report does not show the right Students of the class, I know looks like a wrong SQLite-Select.

For more sophisticated reports, I find it much easier to create a custom class that incorporates the DataSet interface. In its select case of the report field names, you can get as complicated as you want in terms of selects and other code. Then just deliver the result.
(I’ll be writing a blog entry in a few days once I have the code polished.)

Not really polished, but hopefully a bit informative (in German with built-in Google Translate – good luck!): https://xojoblog.me/2017/04/05/reports-nicht-ganz-so-limitiert-wie-man-denkt/

thanks, Ulrich !
any way to download the project ? thanks.

Sorry, the code is from a project I made for a customer. I’ll dig into the stuff deeper at a later time and see if I can add a demo then.