WordTemplate Class open setLocale setDataSource process save

WordTemplate.save Method


save(java.lang.String outputFileName)
Saves the generated Word file on the server.
save(java.io.OutputStream outputStream)
Writes the generated Word file to the specified output stream.
save(javax.servlet.http.HttpServletResponse response)
Streams the generated Word file to the client.
save(javax.servlet.http.HttpServletResponse response, java.lang.String attachmentName, boolean openInBrowser)
Streams the generated Word file to the client.

save(java.lang.String FileName)

Syntax:
public void save(java.lang.String outputFileName)
Description:

Saves the generated Word file on the server.

You can call save more than once for a single instance of WordTemplate. This allows you to save more than one copy of a generated file, and/or both save the file and stream it to the browser. Using multiple process and save calls, you can generate multiple files from a single template and an updated data source.

Parameters:
Exceptions:
Example:
	oWW = new WordTemplate();
	ServletContext ctx = this.getServletContext();
	oWW.open(ctx.getRealPath("/WordWriterTemplates/Template1.doc"));
	oWW.setDataSource(arrValue, arrName);
	oWW.process();
	oWW.save("C:\WordWriterOutput\Output1.xls");

Top


save(java.io.OutputStream outputStream)

Syntax:
public void save(java.io.OutputStream outputStream)
Description:

Sends the generated Word binary file to the specified java.io.OutputStream.

You can call save more than once for a single instance of WordTemplate. This allows you to save more than one copy of a generated file, and/or both save the file and stream it to the browser. Using multiple process and save calls, you can generate multiple files from a single template and an updated data source.

Parameters:
Exceptions:
Example:
	FileOutputStream fStream = new FileOutputStream("c:\\temp\\file.doc");
	oWW = new WordTemplate();
	oWW.open(application.getRealPath("WordWriterTemplates/Template1.xls"));
	oWW.setDataSource(arrValue, arrName);
	oWW.process();
	oWW.save(fStream);
	fStream.close();
	

Top


save(javax.servlet.http.HttpServletResponse Response)

Syntax:
public void save(javax.servlet.http.HttpServletResponse response)
Description:

If you pass Save an HttpServletResponse object, WordWriter will stream the generated file to the client. If the user chooses to open (rather than save) the file, it will open in the browser window.

You can call save more than once for a single instance of WordTemplate. This allows you to save more than one copy of a generated file, and/or both save the file and stream it to the browser. Using multiple process and save calls, you can generate multiple files from a single template and an updated data source.

Parameter:
Exceptions:
Example:
	oWW = new WordTemplate();
	ServletContext ctx = this.getServletContext();
	oWW.open(ctx.getRealPath("/WordWriterTemplates/Template1.doc"));
	oWW.setDataSource(arrValue, arrName);
	oWW.process();
	oWW.save(response);

Top


save(javax.servlet.http.HttpServletResponse response,
         java.lang.String FileNameToSend,
         boolean openInBrowser)

Syntax:
public void save(javax.servlet.http.HttpServletResponse response,
		 java.lang.String attachmentName,
	  	 boolean openInBrowser)
Description:

If you pass save an HttpServletResponse object, WordWriter will stream the generated file to the client. This method allows you to specify a default client-side file name, and whether the file should be opened in the browser window or in Microsoft Word.

You can call save more than once for a single instance of WordTemplate. This allows you to save more than one copy of a generated file, and/or both save the file and stream it to the browser. Using multiple process and save calls, you can generate multiple files from a single template and an updated data source.

Parameters:
Exceptions:
Example:
	oWW = new WordTemplate();
	ServletContext ctx = this.getServletContext();
	oWW.open(ctx.getRealPath("/WordWriterTemplates/Template1.doc"));
	oWW.setDataSource(arrValue, arrName);
	oWW.process();
	oWW.save(response, "Output.doc", true);

Top


WordTemplate Class open setLocale setDataSource process save

Copyright © 2003, SoftArtisans, Inc.