KB

Hi :)

 

I want to generate a report for each object (from the table) in one report.

I have something like that:

  
function createSection( p_aGroup)
{
	for(var i=0; i<p_aGroup.length; i++) {
		iteration_group(ArisData.sort(p_aGroup[i].ObjDefList(true, [Constants.OT_FUNC_CLUSTER]),Constants.AT_NAME, nLocale))
	}

	function iteration_group(p_aObjDef)
		{
			for(var i1=0; i1<p_aObj.length; i1++) {
                var report = Context.getComponent("Report") 
                var tab = new Array();
                tab[0] = p_aObj[i1];
                var reportInfo = report.createExecInfo("_A/583672a0-0b40-11df-7c8f-001a4b5ed64c", tab, nLocale, Constants.OUTWORD, "C:/Users/kb/Desktop/Stuff/test.doc")
                var result = report.execute(reportInfo);
                var plik  = result.getResultFileData();
                plik[0].getName();
			}

		}
}

but it doesn't work. What I'm doing wrong? plz help!

 

by Andre Sales
Posted on Fri, 01/28/2011 - 03:03

Hi,

What's the message?

 

 

 

0
by Katarzyna B Author
Posted on Fri, 01/28/2011 - 08:33

nothing :/

0
by Torsten Haase
Posted on Fri, 01/28/2011 - 11:08

Hi Katarzyna,

this cannot work, because you have specified a client path for the report result and you do not transfer the result to the calling client.

Reports are executed on server side, so you cannot expect, that the result is created on a client path. The file name you specify here can be used by Context.getSelectedPath()/Context.getSelectedFile(), but this file is not created.

The result file can be accessed (as you're doing right in your script) by  calling result.getResultFileData(). The main report now has to make sure, that all results are copied to the client correctly, so they have to be added to the "files to be transferred to the client" like this:

[line16] for(var i2=0; i2<plik.length; i2++) {

    Context.addOutputFile(plik[i2].getName(), plik[i2].getData() )

}

...and make sure that all output files have different names, for example by using the GUID (or Name) of the object definition as part of the file name.

BR,

Torsten

0
by Allen V.
Posted on Tue, 03/29/2011 - 17:58

Hello.  I realize this post is a little old, but I am trying to accomplish the same exact thing.  I have a report that I execute another report that generates an Excel file.  I have tried Torsten's suggestion, but I still do not see any file generated.  My code is something like this:

function createReport(scriptID, objObjects, language, outputFormat, outputFilename) {
  var oReportComponent = Context.getComponent("Report")
  var reportExecData = oReportComponent.createExecInfo(scriptID, objObjects, language, outputFormat, outputFilename)
  var result = oReportComponent.execute(reportExecData)
  var file = result.getResultFileData()
  Context.addOutputFile("C:/temp/" + file[0].getName(), file[0].getData())
}

 

0
by Torsten Haase
Posted on Wed, 03/30/2011 - 08:17

Hi Allen,

just don't use a path in Context.addOutputFile, but only a file name, for example file[0].getName() or "mySubReportResult.xls".

BR, Torsten

0
by Allen V.
Posted on Wed, 03/30/2011 - 15:02

Hello Torsten,

Thanks for the reply.  I tried different things yesterday after I posted the question.  It turned out that the report script was not enabled for output.  I had done like you said by not adding the path and it was still not working.  After I checked "Create output file" in the properties of the report script it finally wrote the file.  I am now using Context.setSelectedPath(outputPath) to define my path and then Context.addOutputFile(file[0].getName(), file[0].getData()).

Thanks for your help!

Allen

0

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock