Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML

Fresher Job


 

Search Host

Monthly Fee($)
Disk Space (MB)
Register With us for Newsletter!
Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Have tutorials?
Add your tutorial to our Java Resource and get tons of hits.

We offer free hosting for your tutorials. and exposure for thousands of readers. drop a mail
roseindia_net@yahoo.com
 
   

Tutorials

Java Server Pages

JAXB

Java Beans

JDBC

MySQL

Java Servlets

Struts

Bioinformatics

Java Code Examples

Interview Questions

 
Join For Newsletter

Powered by groups.yahoo.com
Visit Group! Post Questions!

Web Promotion

Web Submission

Submit Sites

Manual Submission?

Web Promotion Guide

Hosting Companies

Web Hosting Guide

Web Hosting

Linux

Beginner Guide to Linux Server

Frameworks

Persistence Framework

Web Frameworks

Free EAI Tools

Web Servers

Aspect Oriented Programming

Free Proxy Servers

Softwares

Adware & Spyware Remover

Open Source Softwares

Java compilation error
Expert:Bill Swann
I place the following code in to my program but get a compile error of cannot resolve symbol on this code - fullFileName.append(vendorID)
vendorID is a parameter. What am I doing wrong.


public void writeWorkbookToFile() {
// create the full path & file name:
StringBuffer fullFileName = new StringBuffer(SPREADSHEETPATH);
fullFileName.append("/");

fullFileName.append(SPREADSHEETFILENAME);
fullFileName.append("-");
fullFileName.append(FileYearMonth);
fullFileName.append(vendorID);
// add the ".XLS" Excel extension to the file name:
fullFileName.append(SPREADSHEETEXTENSION);
Answers
Hi friend,

Plz give full source code to solve the problem :

Thanks

Here is the source code.
/*
* Created on Dec 2, 2008
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/

import burlington.files.Vndslrdl0;
import java.sql.*;
import java.io.*;


/**
* Create the monthly Vendor Service Level spreadsheet file.
* @author Gerry McLaughlin clone by Bill Swann
* to create use this command in qshell - javac -classpath /home/java/build/ ServiceLevelReport1.java
*/
public class ServiceLevelReport1{

private ResultSet queryResults;
private ExcelSpreadSheet spreadsheet;
public static final String TEMPLATEPATHANDFILENAME = "/home/mis/VendorIMA/GSK/GSKSvcLvlTemplate.xls";
private static final String SPREADSHEETPATH = "/home/mis/VendorIMA/ADJ";
private static final String SPREADSHEETFILENAME = "BDrug_ServiceLevelReport";
private static final String SPREADSHEETEXTENSION = ".XLS";
private String FileYearMonth = "";
private FileInputStream templateFile;


/**
* main - run the ServiceLevelReport with default.
* @param args
*/
public static void main(String[] args) {


if (args != null) {

if (args.length >= 2) {

try{
new ServiceLevelReport1(args[0],args[1] );
}
catch(Exception ex1) {

ex1.printStackTrace();
}
}
}
else {

try{
new ServiceLevelReport1();
}
catch(Exception e) {
e.printStackTrace();
}
}

}

/**
* default constructor - create Monthly Spreadsheet file for
* the default Glaxo Smithkline vendor " 001267" and Aug, 2005.
*
*/
public ServiceLevelReport1() {
this(" 001267","200508");
}

/**
* Create monthly Service Level Report spreadsheet file using the
* vendor# and year/month passed.
* @param vendorID
* @param Year/month - 6 character string.
*/
public ServiceLevelReport1 (String vendorID, String YearMonth) {
super();
cloneTemplateSpreadsheet();

queryFile(vendorID,YearMonth);
populateSpreadSheet();
writeWorkbookToFile();
}

private void queryFile(String vendorID, String YearMonth) {
try {
queryResults = Vndslrdl0.runQuery_getData(vendorID,YearMonth);
} catch (SQLException e) {

e.printStackTrace();
}
}

/**
* put the contents of the query result set into the spread sheet object.
*
*/
private void populateSpreadSheet() {
int row = 0;
Object[] obj = new Object[11];
// read the query results and add to spreadsheet:
try {
while (queryResults.next ()) {

obj[0] = queryResults.getString("SLRYRMO");
obj[1] = queryResults.getString("SLRNDC#");
obj[2] = queryResults.getString("SLRDESC");
// spreadsheet cells can't hold a BigDecimal, so transform the BigDecimal
// returned from the iSeries DB2 query results into a Double.
obj[3] = new Double( queryResults.getBigDecimal("SLRDMND").toString() );
obj[4] = new Double( queryResults.getBigDecimal("SLRLSHP").toString() );

obj[5] = new Double( queryResults.getBigDecimal("SLRLSRT").toString() );
obj[6] = new Double( queryResults.getBigDecimal("SLRSLVL").toString() );
obj[7] = new Double( queryResults.getBigDecimal("SLRLNBO").toString() );
obj[8] = new Double( queryResults.getBigDecimal("SLRSLVA").toString() );
obj[9] = " ";
obj[10] = queryResults.getString("SLRNOTE");

row = row + 1;
// use the first row's Year/Month field to populate the
// year & month part of the file name.
if (row == 1) {
FileYearMonth = obj[0].toString();
}
spreadsheet.putDataInRow(row,obj);
}
} catch (SQLException e) {

e.printStackTrace();
}

}

/**
* create a new excel file from workbook.
*/
public void writeWorkbookToFile() {
// create the full path & file name:
StringBuffer fullFileName = new StringBuffer(SPREADSHEETPATH);
fullFileName.append("/");

fullFileName.append(SPREADSHEETFILENAME);
fullFileName.append("-");
fullFileName.append(FileYearMonth);
// fullFileName.append(vendorID);
// add the ".XLS" Excel extension to the file name:
fullFileName.append(SPREADSHEETEXTENSION);

FileOutputStream file_Out;
try {
file_Out =
new FileOutputStream(fullFileName.toString());
spreadsheet.writeWorkBookToFileOutPutStream(file_Out );
// System.out.println("file created");
} catch (Exception e) {

e.printStackTrace();
}
}

/**
* create a new empty spreadsheet from the GSK 830 template Excel spreadsheet file.
*
*/
private void cloneTemplateSpreadsheet() {
// create the FileInputStream from the string representing the template excel file.
try {
templateFile = new FileInputStream(TEMPLATEPATHANDFILENAME);
} catch (FileNotFoundException e) {

e.printStackTrace();
}
// create the spreadsheet from the FileInputStream:
try {
spreadsheet = new ExcelSpreadSheet(templateFile);
} catch (IOException e1) {

e1.printStackTrace();
}

}


}

More Questions
Post Answers
 
Ask Question Facing Programming Problem?
Useful Links
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2007. All rights reserved.