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 Swift-based report application.
Before you begin, you must
have:
In this quickstart, you complete the steps to organize a project, where the report
application will be handwritten in Swift. 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
Swift source and a sample data schema will be provided for you. You would follow these
same steps when writing your own Swift report application.
-
Select , then click OK.
-
Rename the default group node to Sales.
This group node will hold nodes for your application and for your reports.
-
Create the file to hold your report application code.
This file will contain the source code for the report application; we provide you with
a simple program for this quick start.
-
Fully expand the project to display all nodes in the tree.
-
Right-click on the Application node and select .
-
Name the file main.swift and save it in the application
node.
-
Replace the content of the file with the source code found here.
-
Save your changes.
-
Rename your application node to match the fully qualified name (class name).
-
Right-click on the Application node and select .
-
For our example, enter "Sales".
-
In the application node's Linker options, ensure the following
exists
-I "$(ProjectDir)/bin" -L "$(ProjectDir)/bin" -I "$(GREDIR)/lib/swift"
-L "$(GREDIR)/lib/swift" -lgre
-
Save your project.
-
Click in the Project view, to give it focus.
-
Select
-
Provide your project with a name (such as Sales.4pw) and save it in your
project directory.
-
Create the data schema file.
For Swift applications, the data schema is created by hand. You cannot generate the
file.
-
Rename the default library node as Reports.
-
Select .
-
Copy the code provided here and paste it in the file.
-
Save the file as Sales.xsd in the
Reports library node.
-
Compile the program.
-
Right-click the application node and select .
The program executables are created and placed in the /bin
sub-directory.
-
Create a simple list report.
-
Select , then click OK.
The New Report From Template wizard opens, and the Schema
Association page displays.
-
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!
-
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.
-
On the Variables page, enter your name (or any string) in the Value column for the
organizationName placeholder. Click Finish.
-
Select and name the file SalesList.4rp.
Save it in your project directory. Add the file to the Reports node of your
project.
-
Save the changes to the project.
-
Execute the program. Right-click on the application node and select
Execute.