At our recent "rebroadcast" of the 2013 MUSE RD/NPR "Tips and Tricks" session, participants were particularly interested in how to force either a Client/Server or MAGIC NPR report direct to a download file, where the user does not see any Print On: prompt, and the report itself defines the path and file name for the output. In the "Tricks" session, I showed the C/S approach, but not the MAGIC one, so I have included both methods in this tip for our newsletter.
In C/S, you can use the "EDIT ELEMENTS" routine to add an IFE attribute and put a path into Z.c.cust.rw.download.path. The user will not be prompted for an output destination and the report will automatically download to the path you load with your attribute code.
The Edit Elements routine allows you to attach field attributes to report selection fields in a similar fashion to the way you write attributes for Customer Defined Screens. We can exploit an IFE attribute (used to control whether the cursor stops at a field) to put the path into Z.c.cust.rw.path as the selection screen is displayed.
Here is what the IFE attribute should look like; substitute the local path and file name you wish to use for my example path and file here:
In MAGIC, you can imbed a program call in the title of the report, and use the program to set up an "auto download."
Since the title of the report is executed as a line of programming code when the selection screen is displayed (and again as the report banner is built for each page), we can use some quotes and underscores to imbed a program call in the title. We use a macro built as a program to set the report up to download, and we return the desired title as the last line of the program.
Since the MAGIC program involves quite a bit more code, I have uploaded this demonstration report to our MAGIC report library: ADM.PAT.zcus.is.auto.download.