r1 - 05 Jan 2006 - 04:52:14 - TanDunlinYou are here: TWiki >  Main Web  >  ElixirReport > ElixirReportCookbook > SystemVariable

System Variable

Using java.lang.System, you would be able to access the system variable.

JDK 1.5

For JDK 1.5, use the following code snippet.

Code Snippet
java.lang.System.getenv(name)

Example :

Create a label with the field type set to 'Script' and type in the following :-
java.lang.System.getenv("temp");

JDK 1.4

For JDK 1.4, 'java.lang.System.getenv(name)' is not available as it is deprecated since JDK 1.3 but has been un-deprecated inJDK 1.5.

Steps to be taken :

  1. Set the variable and value at the console
  2. Access using the following codes.

Example :

When launching Elixir Report Professional, include the sentence (-DSample=Test) to the batch file.
Code Snippet
java -DSample=Test -jar ERD-Launcher.jar


Create a label with the field type set to 'Script' and type in the following :-
Code Snippet
java.lang.System.getProperty("Sample");

-- TanDunlin - 05 Jan 2006

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback