For those following along, the direction we've decided is to output the files as XML data.  So I am trying to use the %XML.Writer and %XML.Adapter classes to do this, but the documentation is thick and difficult to understand.  For example, I'm trying write to write the following tag and attributes:

<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:o="urn:schemas-microsoft-com:office:office"
 xmlns:x="urn:schemas-microsoft-com:office:excel"
 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:html="http://www.w3.org/TR/REC-html40">

</Workbook>

I can't seem to figure out how to write the tag with more than one attribute.  The documentation says I can add an additional property and note "XMLPROJECTION="ATTRIBUTE", but that then required the initialization of these attributes every time we create the object.  I would rather it be a parameter so it's remains static.  Also you can define a property or parameter with a ":" which makes it difficult.

Does InterSystems have a tutorial  on this somewhere?  A video?  I would love some help.  

For the record, I'm a very new programmer if you do offer thoughts, context helps.

Mike

I will have to keep playing with this.

I created the class and tried to run it (in SAMPLES) and when I pressed run it launched the management portal login and made me log in (it appeared it was trying to log into another namespace which might be significant).

An Excel file started to open but I got the 'wrong format/corrupt data' message.  I thought maybe there was an issue since I'm running from samples, but it's trying to do something in the other namespace (we call it DVL).  So I tried logging into the management portal first and switched the namespace to SAMPLE and then ran the report.  Same thing happened as above: had me try to log into DVL portal.

I'll keep playing as it seems hopeful, but it may be a limitation on how our system was configured (which I'm too new to have much influence to change).

Mike

@Chris Thompson 

Thanks!

Re the JSON and REST call, are you basically saying create a web service that serves the report in JSON format, and then use https://github.com/exceljs/exceljs to write the XLS file?

Do you have any links or discussion on the ADO .net package?  I think the problem here is that if it's not Cache no one want to touch it.  If someone has to use .net that idea would get squashed right away :(

Mike

Hi @Charles Cross!

I don't think your link pasted right.

To answer your question . . . I would lean twoards programmatically.  It's a mumps routine that prompts the user for some inputs and then builds out a temporary database with the required data and then writes it to a file with tab deliminators. 

You're not the first to mention the XML solution, so I will look into this.

Mike

@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!

Thanks @Roberto Cahanap 

The catalyst for my initial post was simply reading the package and class documentation for %UnitTest.  I noticed that whoever set up our unit testing framework here was only using the %TestCase class and %Manager class.  There are many other classes in the package, and I'm trying to get a sense if we are utilize the tools in the package to the greatest extent.  

The other half of it is that I'm a very new programmer (brand new pretty much) and I'm not accustom to unit tests.  I'm curious to know how others do it so I can see where's there common ground and where people differ.

I'm going to watch the presentation linked above and then get back with more questions.

MD

Ah yes, I see this now!  Thank you!

I can see the ^(Package).PersonD global created in our global exploration tool, however it won't let me read it.  When I load and run the routine in the terminal and do a ZW I get data that looks like this:

person1=<OBJECT REFERENCE>[1@Test.MXD.Person]

The status indicator for the %Save shows success (1).  

Now how do I do it the other way around?  Let's say a global ^PEOPLE already exists?   How do I create a class do deal with that?  If I create a class User.People, the global ^User.PeopleD will be created when I want it to use ^PEOPLE.

MD

Right, I've been working with the documentation and training, but I came here because I don't think it's always very clear.

In your example here you've use .%Save() to save to the Person table.  Is that the same thing as the ^PERSON global? 

Based on what I've tried, I would say it is not.  So you see I'm trying to use ObjecScript and object to update my ^PERSON global.

Does that make sense?

MD

Thanks, Scott.  

What you explained about IRIS was what someone told me about Cache, lol!  I'd be interested to know other perspectives on the grouping of products and what they are, but what you've said makes sense.

I might rephrase my problem with globals: let say I've been using Cache/MUMPS for many years and all my data is in globals.  With the advent of ObjectScript and studio, I would like to take a more object oriented approach to manipulating my data.  How would I create a class to do that?

^PERSON(1) = "MIKE|MALE|DEVELOPER"

^PERSON(2) = "SCOTT|MALE|MASTER PROGRAMMER"

How would I create a class to do the CRUD ops on these existing globals?

Thanks!

Mike