OutSystems and OpenXMLPowerTools

  

Hello!

I am trying to use OpenXMLPowerTools to merge documents with OutSystems but I keep on getting this error:

"sequence contains no elements"

I have isolated the problem to the BuildDocument Function of OpenXMLPowerTools. But the thing is, the problematic code is running fine on my computer.

Does anyone have any experience using OpenXMLPowerTools with OutSystems? 

(Also, how do I debug an extensions. I don't understand the answers to other posts about it.)

Thank you!

Hi Michael, 

There are a couple of ways of testing a extension. In my opinion the easiest is to add log to the extension. Beside this option you have the following options:

  1. Change the extension to windows application and do a class to test the different methods (problem is that you need to send the same inputs as outsystems
  2. If you have access to the outsystems server you can install VS there and attach to process w3wp.exe
  3. the other option is remote debugging that is even more complex

You can read this post https://www.outsystems.com/forums/discussion/6399/is-possible-to-debug-a-extension/ for the more complex options. But if is possible to do it with logI would do it. the log is added like this GenericExtendedActions.LogMessage and everything is log in general log.

Regards,

Marcelo

Hi Marcelo,


Thank you for your suggestions but I do not know where I should insert:

log.Write(System.DateTime.Now, app.OsContext.Session.SessionID, app.eSpaceId, app.Tenant.Id, app.OsContext.Session.UserId, message, "Warning", "ModuleName", "0"); 

If I do this correctly, will it give more details about the error than the error logs I see in the service center?

Thanks!

By the way, just in case anyone stumbles upon this problem with OutSystems and DocumentBuilder of OpenXML powertools. The problem lies with lists in the document. NSIDs should be set or else this error happen.

Still, I do not know why the code runs on my PC but not in OutSystems.