ExcelExporter error. GenerateReport fails because InputObject is missing

Using ExcelExporter, having defined a template with a entity as Inputobject, and clicking on ‘Create report’ I get this error: The template looks to be defined correctly, MxReflection has been run, making entity ‘Teacher’ of module ‘test’ selectable: just does not Still it does not get it’s input object sent along to the java-action. Apparently InputObject is empty, here in GenerateExcelDoc.java, which throws the error at the last line of this code because this.InputObject is empty: public GenerateExcelDoc(IContext context, IMendixObject TemplateObject, IMendixObject OutputDocument, IMendixObject InputObject) { super(context); this.__TemplateObject = TemplateObject; this.__OutputDocument = OutputDocument; this.InputObject = InputObject; } @java.lang.Override public IMendixObject executeAction() throws Exception { this.TemplateObject = __TemplateObject == null ? null : xlsreport.proxies.MxTemplate.initialize(getContext(), __TemplateObject); this.OutputDocument = __OutputDocument == null ? null : system.proxies.FileDocument.initialize(getContext(), __OutputDocument); // BEGIN USER CODE // Check first if the input is correct as configured if (TemplateObject.getMxTemplate_InputObject() != null && InputObject != null) { String expectObject = TemplateObject.getMxTemplate_InputObject().getCompleteName(); if (!Core.isSubClassOf(expectObject, InputObject.getType())) { throw new CoreException("Cannot create excel, because the inputobject isn't a subclass of configured. Expect: "+expectObject+" Retrieved: " +InputObject.getType()); } } else if(TemplateObject.getMxTemplate_InputObject() != null) { String expectObject = TemplateObject.getMxTemplate_InputObject().getCompleteName(); throw new CoreException("Cannot create excel, because the inputobject isn't given. Expect: "+expectObject); Yet, the $Template/InputDocument has been created in the microflow GenerateReport: Any idea what is wrong here? Trying to solve this, I also created another template but now passing person.person as inputObject and trying to get person.address which is *-1 associated to person.person. Same response when clicking ‘Create report’ To reply the error: Go to see https://tiekasmodules-sandbox.mxapps.io Log in with ‘visitor’ and ‘Welcome12345!’ Go to ‘Trials’ -> ‘Excel import and export’. Select ‘Teacher’ and click ‘Create report’
2 answers

Hi Tim

Adjusted your template. There is no context object to provide at the moment and it exports all the teachers. Can you check and verify this?

You can use the input object to for instance use the subset of records that is associated to it. 


Hi Tim,

Does the input object : teacher is generalized or associated with FileDocument object?