Profile picture for user Nique

Hi

In my report, I'm running trough big arrays. Each entry (a model) creates a new sheet (Excel-Report).

Now I have to to the same loop again, because I need the same but with other columns.

What I like to to is, that I have one report and creating the output to each proper outputfile.

I can create the two OutputObjects and also fill the content correctly. But at the end, Aris will open Excel only with one report (the last). As I understand, this is defined by the report-path (including one filename) in the Report-Assistant-Dialogue.

But I do also the following:

oOutDef.WriteReport("C:\\Temp","temp.xls")

This runs witout error, but the file is not there.

What did I miss or how to write multiple files in one report?

Kind regards,

Dominik

by Jens Heylmann
Posted on Thu, 05/03/2012 - 15:23

Hi Dominik,

try to use:

 

Report class Context - Method addOutputFile

 

addOutputFile ( String p_sFileName, byte[] p_fileData )

Adds the specified file to list of files to be transfered to the client.  

 

Cheers,

Jens 

0
by Dominik Jenzer Author
Posted on Thu, 05/03/2012 - 17:34

Hi Jens,

thanks for this.

I get an TypeError, saying that this function cannot be found.

And second, how can I put the Data into p_fileData?

What I have is:

var oOutDef = Context.createOutputObject()
oOutDef.OutputF("blabla", getString("ID_STYLE_RD_DEFAULT"))
oOutDef.WriteReport()

This works with opening Excel. With your Info, I tried this:

var oOutDef = Context.addOutputFile("text.xls",p_fileData)
oOutDef.OutputF("blabla", getString("ID_STYLE_RD_DEFAULT"))
oOutDef.WriteReport()

 

0
by Jens Heylmann
Posted on Fri, 05/04/2012 - 08:55

Hi Dominik,

in this case I think

 

addOutputFileName ( String p_sFileID, int p_nLocation )

 

is better. You have to do the following:

 

1. Create a output object with a given filename

var out = Context.createOutputObject ( Constants.OUTEXCEL,  filename );

2. Add some content

out.OutputF("blabla", getString("ID_STYLE_RD_DEFAULT"));

3. Add the output file to transfer

Context.addOutputFileName(filename, Constants.LOCATION_OUTPUT);  

 4. Call WriteReport

out.WriteReport( Context.getSelectedPath(), filename );

 

 

Jens

 

 

0
by Dominik Jenzer Author
Posted on Mon, 05/07/2012 - 14:03

Hi Jens,

Thanks. It almost works. Im running in trouble with the 4th statement.

When I read the ARIS help to the WriteReport(String,String)-Statement, there is documented, that the first parameter (p_sSelectedPath) will be ignored. This fits the current error. The report does not try to save the report where I like, he chooses "D:\ARIS7.2\server\temp\ReportTemp\5\text.xlsx. This is a directory that does not exist on the client. This is the server-directory, and none of the users later have access to this share. Even when the file will be stored there. They can't get the report by file-explorer.

So, how can the correct place be defined?

I have a var for this:

var selClientFolders = Dialogs.getClientFolder("Select new output folder", "", false)

What can be done?

Dominik

0
by Jens Heylmann
Posted on Mon, 05/07/2012 - 14:51

Here an example writing two files. Send to client in a folder selected by the user:

function main() {
    
 var out = Context.createOutputObject ( Constants.OUTEXCEL,  Context.getSelectedFile() );
 out.DefineF("F1", "ARIAL", 8, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 0, 21, 0, 0, 0, 1);
 out.BeginTable(100, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_CENTER, 0); 
 out.TableRow();
 out.TableCellF("BlaBLa", 100, "F1");
 out.EndTable(" ", 100, "ARIAL", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_CENTER | Constants.FMT_VCENTER|Constants.FMT_BOLD, 0); 
 
 var filename = "secondfile.xls";
 var out2 = Context.createOutputObject ( Constants.OUTEXCEL, filename );
 out2.DefineF("F1", "ARIAL", 8, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_LEFT, 0, 21, 0, 0, 0, 1);
 out2.BeginTable(100, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_CENTER, 0); 
 out2.TableRow();
 out2.TableCellF("BlaBLa2", 100, "F1");
 out2.EndTable(" ", 100, "ARIAL", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, 0, Constants.FMT_CENTER | Constants.FMT_VCENTER|Constants.FMT_BOLD, 0);  
 out2.WriteReport();
 Context.addOutputFileName(filename, Constants.LOCATION_OUTPUT);
 
 var selClientFolders = Dialogs.getClientFolder("Select new output folder", "", false);
 if( selClientFolders != null ) {
    for each( folder in selClientFolders ) {
        Context.setSelectedPath( folder );
    }    
 }
 out.WriteReport();
 
}
main();
0
by Dominik Jenzer Author
Posted on Tue, 05/08/2012 - 07:42

Thanks, this solution works!

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