Organize the project (Quick Start for Java)

You can write, compile and execute your report program from within Genero Studio. This guided quick start illustrates how you should organize a Genero Studio project to manage the files for a Java-based report application.

Before you begin, you must have:
  • Configured Genero Studio for Java
  • Create a directory names Sales. The Sales serve as your project directory. Inside your Sales directory, create a sub-directory named src.

In this quickstart, you complete the steps to organize a project, where the report application will be handwritten in Java. You will set up a project, add and organize source files, create a data schema, create a report from a template, and test the application. The Java source will be provided for you. You would follow these same steps when writing your own Java report application.

Warning: If you plan on generating your application's data model, start with Quick Start: Generate a Java report application instead.
  1. Select File > New ... > Java > Simple Java Project (.4pw), then click OK.
  2. Create the file to hold your report application code.
    For this quick start, create a file named Sales.java. The Sales.java file will contain the source code for the report application. We provide you with a simple program for this quick start.
    1. Fully expand the project to display all nodes in the tree.
    2. Right-click on the Application node and select New File > Java > Java main (.java).
    3. Name the file Sales.java and save it in your project directory.
    4. Replace the content of the file with the source code found in the topic Source code for a simple Java report application.
    5. Save your changes.
  3. Rename your application node to match the fully qualified name (class name).
    1. Right-click on the Application node and select Rename.
    2. For our example, enter "Sales".
  4. Save your project.
    1. Click in the Project view, to give it focus.
    2. Select File >> Save untitled.4pw as ....
    3. Provide your project with a name (such as Sales.4pw) and save it in your project directory.
  5. Create the data schema file.
    1. Select Tools > Genero Tools > Genero Workplace Window.
    2. Type "schemagen Sales.java".
    3. Type "move schema1.xsd Sales.xsd".
      Sales.xsd is created.
  6. Compile the program.
    1. Right-click the application node and select Build.
      The program executables are created and placed in the /bin sub-directory.
  7. Create a simple list report.
    1. Select File > New > Report from template > Simple List (PULSE), then click OK.
      The New Report From Template wizard opens, and the Schema Association page displays.
    2. In the Schema Location field, select the Sales.xsd data schema you created in an earlier step. Click Next.
      Remember, we are keeping this report simple for the quick start only!
    3. On the Add Fields page, select one or more fields in the Available Fields pane and add them to the Selected Fields pane. When you have at least one field selected, click Next.
    4. On the Variables page, enter your name (or any string) in the Value column for the organizationName placeholder. Click Finish.
    5. Select File > Save untitled1.4rp as ... and name the file SalesList.4rp. Save it in the src directory within your project directory. Add the file to the src node of your project.
    6. Save the changes to the project.
  8. Execute the program. Right-click on the application node and select Execute.