Package Writers

Examples of Writers.FileWriter


     * @throws Exception
     */
    public void saveToFile(String filePath) throws FileNotFoundException, IOException, Exception{
        filePath = filePath.toLowerCase();
        setOutputFile(filePath);
        FileWriter writer = null;
        if(filePath.endsWith("csv")){
            writer = new CSVWriter(data, result, outputFile);
        }
        if(filePath.endsWith("xls")){
            writer = new XLSWriter(data, result, outputFile);
        }
        if(filePath.endsWith("wss")){
            writer = new WSSWriter(data, result, outputFile);
        }
        if(filePath.endsWith("pdf")){
            writer = new PDFWriter(data, result, outputFile, pageSetup, coverPage, author, projectDesc);
        }
        if (writer!=null) {
            writer.writeAll();
        }else
            throw new Exception("Unsupported File Format");
    }
View Full Code Here

TOP

Related Classes of Writers.FileWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.