WordTemplate Class open setLocale setDataSource process save

WordTemplate.Process Method


process()

Syntax:
public void process()
Description:

The process method enters data source values in a template's merge fields, and creates an image of the output file (the new spreadsheet) in memory. The save method can then save the output file to disk, stream it to the browser, or both.

Call process after setDataSource and before save.

You can call process more than once for a single instance of WordTemplate. This allows you to generate multiple files from a single template and an updated data source.

Exceptions:
Example:
	oWW = new WordTemplate();
	ServletContext ctx = this.getServletContext();
	iStream = new BufferedInputStream(ctx.getResourceAsStream(templateFile));
	oWW.open(iStream);
	oWW.setDataSource(arrValue, arrName);
	//--- Call WordTemplate.process() to populate the template with 
	//--- the new data.
	oWW.process();
	oWW.save(response, "StringVarOutput.doc", false);

Top


WordTemplate Class open setLocale setDataSource process save

Copyright © 2003, SoftArtisans, Inc.