Organize the project (Quick Start for C#)

Genero Studio lets you manage the files of a C#-based report application. You can write, compile and execute your report program from within Genero Studio.

Before you begin, you must have:

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. You will complete the steps to create and manage the development of a report program written in C#. In this instance, the C# file is provided for you. Follow these same steps when coding a .NET report program by hand.

  1. Select File > New > C# > Simple C# Project (.4pw), then click OK.
  2. Create the file to hold your report application code.
    1. Fully expand the project to display all nodes in the tree.
    2. Right-click on the Application node and select New File > C# > C# main (.cs).
    3. Name the file Sales.cs 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 .NET 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. Add the reference to gre.dll.
    The gre.dll file contains the Genero Report Writer APIs.
    1. Select the application node.
    2. In the Properties view, enter "/reference:"$(GREDIR)/lib/dotnet/gre.dll"" in the Linker options property.
  5. 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.
  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. Copy gre.dll from $(GREDIR)/lib/dotnet/gre.dll to the /bin sub-directory.
    The directory now contains both the executable (Sales.exe) and gre.dll
  8. Create the data schema file.
    1. Select Tools > Genero Tools > Genero Workplace Window.
    2. Navigate into the /bin directory.
    3. Type "xsd.exe /nologo Sales.exe /language:CS /type:Sales".
      The file schema0.xsd is created.
    4. Rename schema0.xsd to Sales.xsd.
      Note:

      This step is not mandatory, it is only for convenience.

  9. 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 project directory, and save it under the Library node in your Project.
      Optional: You can rename the Library node to Reports.
    6. Save the changes to the project.
  10. Execute the program. Right-click on the application node and select Execute.