Writing Reports

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
sandybassett
Posts: 35
Joined: Fri May 31, 2013 7:44 pm

Writing Reports

Post by sandybassett » Thu Sep 26, 2013 4:25 pm

Having finally succeeded in connecting to a database, creating tables, inserting, updating, finding and closing SQLite and Valindina DBs, I'm going to the next step-writing reports. I don't find a report writer in LC altho my last systems had them (Access & REALbasic). So what is the best practice in LC? One approach seems to be construct SQL statement that will find all tables/fields in related tables necessary that runs on opening a card, script to put that data into fields on the card, then a print button. Am I on the right track? or not?

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Writing Reports

Post by LCNeil » Thu Sep 26, 2013 5:13 pm

Hi Sandybassett,

Yes you are on the right track :) What you have suggested is one method of generating a report in LiveCode and you should be able to add to this to create more in-depth reports.

We also have a product in our marketplace that makes report creation in LiveCode a breeze. A link to this is shown below.

http://livecode.com/store/marketplace/q ... ard-1-1-4/

More information on Quartam Reports, with access to a trial, can be found on the developers site here-

http://www.quartam.com/

Kind Regards,

Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
-

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Writing Reports

Post by bangkok » Thu Sep 26, 2013 5:16 pm

Reporting can be a delicate matter with LC.

-first challenge : printing... on windows can be difficult (font size and fields). have a look on "formatForPrinting" to understand.

-then : which type of output ? printer or PDF ? Different solutions.

-then : the length issue... just 1 page ? Or more ? If more then you will have to master "chunck" (you'll print a field containing the X first lines of the report, then send a command to create a new page on the printer, then print the next following chunck etc.)

-then : complex report (many fields on the same page) or just one plain listing ?

-then : there are external solutions (as previously said, Quartam)

But don't be afraid : as usual, you can achieve what you want with LC, following several possible technical path.

sandybassett
Posts: 35
Joined: Fri May 31, 2013 7:44 pm

Re: Writing Reports

Post by sandybassett » Fri Sep 27, 2013 2:15 pm

Thanks guys! The Quartam Reports seems the way to go. Until I'm ready for that, I'll practice the SELECT SQL way to put data to a card for on-screen reports as a good learning exercise.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Writing Reports

Post by FourthWorld » Fri Sep 27, 2013 4:08 pm

When exploring your current approach, you may find that the recent addition of paragraph-level formatting for LC fields quite satisfying for many types of reports. With it you can now include multiple tables each with their own tabstops - see the tabstops, vGrid, and hGrid properties in the Dictionary.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply