I don't think a DTL is considered a business host and thus you can't configure parameters for at DTL like you would normally for a business host (service, process, operation). It doesn't have an On{This}() method like the business hosts do and where you would set and change parameters.  What parameter are you trying to change?

I'm not sure about the aux param.  The documentation doesn't seem to encourage programming custom transformations in code, rather the visual editor is pressed.  The transform method seems to be generated from the <transform> tag in the DTL and looking at the .int code in some of my examples I don't see the param used (just set to "").  I'm sure an ensemble process calls it.  Considering it's generated code, I think it would be risky to try to fiddle with that.  Curious to know what it does.

I think I answered my own question after working more on it today.  

My OnRequest() method processed the record with ObjectScript code.  I just was careful to return a proper %Status if there was an error so Ensemble knew what to do.  I used the Ens.StringContainer response class to set the response (which isn't used as far as I can see because it's async from the business service) and used that same response object as the request to a business operation just to finish things up.  That wasn't really necessary either, but while viewing the messages I can see a processing message that has the file name and resulting object ID so we can troubleshoot if needed.

I'm just poking around here to gain some knowledge.  When you say routine to you mean a compiled MAC file?  I'm curious to know how ZR would work if you've compiled the routine and, as Robert said, it's not on the stack.  Any time I've run a routine from the CLI and do a zprint, there's nothing there, so I'm not sure what ZR would remove it ZP isn't showing in the buffer.  When you call an entry point and there's a quit, isn't there an inherent ZR to get the routine out of the buffer?  

I guess I'm simply asking: did ZR solve your issue?

@Julie Bolinsky and @Stephen Canzano 
 

Thanks for your replies!

To back up and offer more clarity: the issue was that the WHERE clause of our query used a stored procedure to calculate a data element. This was causing the query to churn and for the Zen reports to timeout.  We wanted to break the query apart so that it could select a subset of the data by date range first and then loop through that data and run the store proc only that data to filter it further.   A subquery didn't end up being any more efficient here.  Views and CREATE TABLE ... AS wouldn't work at scale.  Since Zen wants a %Library.ResultSet object, I researched fetching each record and deleting data as needed OR creating a new %Library.ResultSet object and adding data to that, but there are no methods to support that.

The question was: can you give a Zen report a dynamic object as a data source?

Sounds like the answer is only %Library.ResultSet or XML file (or stream).  The stream idea is ok, but it's a big report and it would have been a big lift to transform the %Library.ResultSet into XML.

The solution was 1) move the stored proc out of the WHERE clause and into the SELECT and 2) use the filter='%val(""DataElement"")=VALUE' in the report tag to evaluate the table alias created by the stored proc in the select to skip the rows we didn't want to generate PDFs for.

Happy to talk more about this as I'm sure I'll be touching some Zen stuff again.

Well, maybe I don't quite understand MAC files.  I tried again this morning and helloWorld.mac kept erroring with an illegal header.  I added 'ROUTINE helloWorld' the top.  Still didn't work.  Added helloWorld.inc and now the MAC file has compiled.  I thought the MAC file compiles down to the INT file.  I'm not even sure what the INC file is. 

I am also having a odd time with connections.  My Docker stats show this:

Ports
1972/tcp localhost:9091
52773/tcp localhost:9092
 
and my setting are as such:
 
"objectscript.conn": {
            "ns""TEST",
            "server""docker-my-iris",
        "active"true
    }
 
"intersystems.servers": {
 
        "docker-my-iris": {
            "webServer": {
                "scheme""http",
                "host""localhost",
                "port"9092
            },
        }
    },
 
For some reason it connects me to the USER namespace even though I've indicated TEST.
 
Happy to email or use the DM feature to take this off the boards if it's too messy to help with here :)

@Flávio Lúcio Naves Júnior 

Check out my thread: https://community.intersystems.com/post/use-cache-write-excel-files

Basically people mentioned using Zen, Apache POI or Python.

What we ended up doing was reverse engineering a Excel spreadsheet and using the %XML.Writer class, created functions to build out an XML file that is built and optimized for Excel.  The problem is that you're left with just and XML file and not a true Excel file.  We are working on that post processing challenge now.

Hope this helps!

@Ben Spead @Evgeny Shvarov 

I watched the video, thank you!

As a new Cache developer, I'm curious to know if TestCoverage will ever be implemented in a future release of ObjectScript in the %UnitTest framwork versus why it stands alone as in InterSystems developed OpenExchange project.

Still learning the differences between Cache, ObjectScript, all the InterSystems' applications and how it all intersects with what my company has been doing in Mumps for the past 30 years.  

If I can reel back to some basics, however.  Because I never really written a complex applications, my sense of testing as always been "write a little, run it, write a little run it," and usually that was in Java.  It was easy to write a driver class or main method to test the code and see what was going on.  I suppose in a more complex system that is always growing, you need something like this unit test framework to single out these classes to run without writing a separate driver class, or at least in this case TestManager is acting as that driver class.  Am I on the write track on how to think about this?

Thanks for everyone's help!