Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Perplexing behavior with ApolloDB

Hello All,

I'm a retired Delphi developer of 35-ish years having started a career in the early 80s. I haven't coded a thing in almost 10 years. I'm not current on development tools, etc. Recently, though, I've developed an itch to do a little hobby programming so I acquired all the latest versions of my old tools hoping it wouldn't be too difficult to refresh my skills. Not to be, I'm afraid. Nonetheless...

I'm the treasurer for our small community's HOA. For me it means a bit of record-keeping that got to be pretty tedious especially around dues-invoicing time each year. That inspired me to put together what I'll call my personal HOA finance app. I've reached a point where I needed a first, quite specialized, report so I dove back into RB and have hit a roadblock.

One of those tools I mentioned above is ApolloDB. My coding career started all those years ago with massive dBase and Clipper programs for a department of electrical engineers in a major electric utility. I was amazed at the things that could be accomplished with those tools. I've never lost my fondness for the simplicity of their table and index structures nor for the power of the language. Many tens of thousands of lines of code later, I find myself a little stuck with what most would call ancient tech. It all worked very well right up to retirement time. Be that as it may, I've hit a snag that has me wondering whether ApolloDB is at fault, RB, or both.

Without too much trouble I've been able to put together a small test app that contains nothing more than a ppReport, a ppDBPipeline, a TApolloTable and Delphi TDataSource. One big button on the form allows me to initiate a report run. From there the snags get confusing. I should add that I purchased the Standard version of RB rather than the more costly Pro or Enterprise versions, the latter being what I used for all those years. Getting back into the groove of debugging has been particularly challenging especially since I don't have any RB source files to step through/into.

I quickly figured out that I could not use the Open or Close methods for the DataSource because RB would consistently issue an "Invalid Work Area" error. At least I think RB was responsible for that message. Instead, I used the ppReport's OpenDataSource and CloseDataSource properties which allowed the report to run (initially) and display it in a preview window. The next problem appeared when I tried to send the report to my printer using the Preview's Print option.

In an effort to keep this post at some halfway reasonable length, following is essentially the steps and outcomes of trying to get a report out of the printer. I'm hoping that someone might have encountered such an issue and identified the cause. To me, it seems the problem is tied to the DataSource being opened and/or closed at inappropriate times. Thanks in advance for any possible suggestions.

==========
- RBTest program opens properly

- Click on "Print Report" button

- Report preview opens with first page appearing exactly as expected. There are 10 pages available as expected and contain correct data.

- Click on the "Print" button icon. Printer dialogue opens with correct (default) printer.

- Change nothing in dialogue and click "OK" button to initiate printing.

- Error message appears: "Unable to open table:" followed by full path of project table.

- Click on OK button to close message. Preview still appears with correct information displayed.

- No report makes it to the printer.

- Click "Print" button again. Table open error message does NOT re-appear.

- Printer dialogue appears. Click OK button to start printing.

- Message appears stating "Accessing Data..." very briefly, disappears then followed by empty page (no data) in preview. Nothing is printed.

- Clicking on any page in side "Outline" displays selected page with correct data.

- Click on Print button again as above and the same cycle begins. It can be repeated over and over with no change in behavior.

- Click "Close" button on print preview window. Return to main form.

- Click Print Report button again.

- Preview window opens, this time with blank page - no data and no other pages available in Outline. No other operations can be initiated.

- Close the program and re-start. All of the above steps take place again.
==========

Sign In or Register to comment.