Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9069

Re: Agentry Command Line File Path issue

$
0
0

Thanks AK K

 

I tried as per mentioned like below

 

Runtime.getRuntime().exec("cmd /c start C:\\TestPrint\\test.bat");

 

test.bat :

java -Dfile.encoding=UTF-8 -jar "C:\\TestPrint\\OnlineJasperReport.jar"


when i run standalone java program, it works fine.

 

But when calling this in Steplet, jar is not executing. Do you have any idea ?

 

Steplet - get values from Transaction and write in File,

test.bat - it execute jar, that jar will read file and pass values to jasper report for printing.

 

 

for(int i=0;i<size;i++)

  {

  String prefix="transaction.ZFieldServiceForm.";

  String Date=_user.getString(prefix+i+".Date");

  log.info("Date is"+Date);

  multiMap.put("Date", Date);

  }

 

 

  log.info("Parameter values are"+multiMap);

 

 

  File file = new File("C:\\TestPrint\\Print.txt");

 

 

 

  file.setExecutable(true);

  file.setReadable(true);

  file.setWritable(true);

 

 

 

  PrintWriter pw = new PrintWriter(file,"UTF-8");

  pw.println(multiMap);

  pw.close();

 

  try {

  Runtime.getRuntime().exec("cmd /c start C:\\TestPrint\\test.bat");

  } catch (IOException e) {

  // TODO Auto-generated catch block

  e.printStackTrace();

  }

 

 

  return true;


Viewing all articles
Browse latest Browse all 9069

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>