Trigger a different report from within a report

I’m curious.

I have a report that calls an option procedure. The report presents people records filtered based on the option. One of the options is to create mailing labels for the records presented. Most of the options are typical report stuff: A header, a form, a footer and various detail bands.

My issue is the label option. It uses the basic report structure of the others. Everything works ok but the labels don’t play nicely in the primary report structure. I would like to do something a little different, at least than I’ve done before.

I would like to have this be a different report structure, nothing but the label detail. These are 1" x 2 5/8" Avery 5260 - 30 per page labels. I don’t care to offer other label templates.

Can I, how can I, control that the report be mostly the classic way but have the labels be a separate report structure? I would like to do this within basic Clarion, not rely on some external product. I am using 6.3 Enterprise 9058.

I suppose I could have the option be the primary entry point and then call separate report procedures depending on the option selected but I’m curious to be able to trigger a different report structure from within a report structure.

Thank you for any suggestions or guidance. Happy Holidays to everyone!
Best Regards,
Doug Selzler

I think your best bet will be to call a separate report procedure for your labels.
Depending on where you are calling your report options logic in the main report, you can exit that procedure without actually running the report. If you call in ThisWindow.Init method for the options, then set the ReturnValue to Level:Cancel if the user picks the label report. You can accomplish the samething at other points, just depends on where you call the report optins.

Thank you, Rick, for your reply.

I chose to put the reports into separate procedures. The main reason for my question was curiosity. Could one have a report procedure offer a choice of report structures, something like the PDF option. I didn’t try very hard before posting and will likely go no further as I accomplished the main idea. I did take a peek at the OpenReport embed but didn’t pursue further experimentation.

I read in Bruce Johnson’s great book (Page 52) where he discusses “composite” reports and was curious what others might have to say. I didn’t attempt to implement his discussion but may still get around to trying something to see what happens.

Per your reply, I called the option procedure from Window Manager (ReportManager) Init after Open Files. I never had an issue with that. It seems to me that the OpenReport embed would be an ideal place for some logic to select an alternate report structure.

Oh, well. I wanted to reply to the group for any value this question might be to others. Thanks again for your response. Always curious…

  • Doug Selzler

Doug,
The way I combine reports is I pass an optional preview queue to the report procedure. If the queue is passed that report does not do the preview or print, instead it transfers it’s one preview queue records to the passed queue. It copies each of the page image files.
All the reports do this creating one queue with all the pages from each report. A dummy report uses that preview queue. You do have to clean up the report page files yourself.

RPM has provided the ability to append reports for more years than I want to admit so, yes, it’s possible and also provides the ability to output as one PDF if that’s what’s needed. It does this by passing a queue from one report to another, renaming the preview files from one and passing those new filenames back to the previous report. You must rename the preview pages in one report before closing that report or the RTL will delete them.

You will get multiple progress windows for each appended report but they aren’t that bad. As well as appending reports you can also embed one report within another using this same technique although using RPM makes it a LOT EASIER!:grinning: