FormReport (How To)

From GeoMedia Smart Client
Jump to: navigation, search

GMSC 2014



Blue.pngYou will find the Telerik Report Designer in INSTALLDIR\Program\Telerik.ReportDesigner.exe



Creating a report template

In this tutorial the template is created with telerik Report Designer. The following steps and screenshots shows you how to create a template and response to the columns and fields in the database.

1. Open a empty report file in the telerik Report Designer. In the wizard, which opens automatically you can choose between some predefined layouts.

2. Add some textboxes in the detailSection:

Insert textbox DetailSection with a few textboxes
Telerik textbox.png

Telerik textbox2.png


3. Filling the textboxes with static values (for example: School Name).

4. Filling the textboxes with values from database(for example: NAME) to get the "real" name of the school.

4.1 Click on a textbox, where you want to get values from the database
Telerik3.png


4.2 Type in =Fields.FORM_{ColumnName} at the box Value on the right side (for example: =Fields.FORM_NAME).
Blue.pngYou have to set FORM_{ColumnName} because the values are in a form. If you have list values you are response with ROW_{ColumnName}.


Telerik4.png



Pfeil new.png To the top Pfeil new.png

FormTable in Reports

In principle you have to possible options to get a table into your report.

  1. Inserting a table Telerik table.png
  2. Creating a SubReport template



Pfeil new.png To the top Pfeil new.png

Inserting a table

1. Insert a table into your empty or predefined layout.
Telerik table1.png

2. The first row serves for the header of every column and the second serves for the values you want to have out of your database.
Telerik table2.png

3. To bring the values up to the right field, you have to type in =Fields.{ColumnName} (for example =Fields.CATEGORY) like in here.

4. Check if the name of the whole table is the same as your FormTable.

Checking the table Checking the name of the table with the name of the FormTable
Telerik table2.png

Telerik table3.png



Pfeil new.png To the top Pfeil new.png

Creating a SubReport template

In this section you get an introduction how to create a SubReport.

Insert SubReport Report + SubReport
Telerik sub.png

Telerik sub3.png

You have to follow step 1-4 like in Creating a report template.

1. Empty form
2. Inserting textboxes
3. Filling with static values
4. Filling with values from database

4.1 Clicking on a textbox
Telerik sub1.png


4.2 Type in =Fields.{ColumnName} at the box Value on the right side (for example: =Fields.CATEGORY).
Blue.png{{{1}}}


Telerik sub2.png



5. At your parent report you have to check if the Name value correlates to the name of the FormTable and if the ReportSource correlates to the SubReport Template, you have created:

5.1 Clicking on the subreport
Telerik sub4.png



5.2 Check Name and ReportSource
Telerik sub5.png



Pfeil new.png To the top Pfeil new.png

FormMap in Reports

It is also possible to show a map on the FormReport.

You have to follow step 1-4 like in Creating a report template.

1. Empty form
2. Inserting textboxes
3. Filling with static values
4. Filling with values from database
5. Insert a PictureBox

Insert PictureBox Template with FormMap
Telerik picturebox.png Telerik picturebox1.png

6. Check if the name of the PictureBox is the same as for FormMap in your workflow.

Checking the picturebox Checking the name of the picturebox with the name of the FormMap in your workflow
Telerik picturebox1.png

Telerik picturebox2.png



Pfeil new.png To the top Pfeil new.png

Creating a workflow

In this case a simple workflow was built, which gives an overview of all schools in Las Vegas. Futhermore it is possible to get a detailed view of every school. There you find the ID, type and category of the specific school and you get a table, where every operations (fire department, police and ambulance) for the specific school is listed.



Pfeil new.png To the top Pfeil new.png

FormSettings

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <FormList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  3.   <Form name="SCHOOL" table="SCHOOL_P" idfield="ID1" order="SQL[Order By ID1]">
  4.     <FormTab name="GENERAL_TAB" label="General Information">
  5.       <FormGroup name="General_GROUP" label="General">
  6.         <FormField name="ID1" label="ID:" type="textfield" datatype="number" required="false" maxlength="36" visible="hidden" />
  7.         <FormField name="NAME" label="School Name:" type="textfield" visible="true" />
  8.         <FormField name="SCHOOL_ID" label="School ID:" type="textfield"  visible="form,list" />
  9.         <FormField name="TYPE" label="School Type:" type="textfield" />
  10.         <FormField name="CATEGORY" label="School Category:" type="textfield" />
  11.       </FormGroup>
  12.       <FormGroup name="OpertaionsTable" label=" ">
  13.         <FormTable name="OPERATIONS" idfield="ID" lov="SQL[Select * FROM OPERATIONS WHERE SCHOOL_ID = {FORM.ID1}]" persisted="false">
  14.           <FormTableField name="CATEGORY"     />
  15.           <FormTableField name="DIRECTOR"     />
  16.           <FormTableField name="STARTDATETIME" datatype="datetime"    />
  17.           <FormTableField name="ENDDATETIME" datatype="datetime"    />
  18.         </FormTable>
  19.         </FormGroup>
  20.     </FormTab>
  21.   </Form>
  22. </FormList>



Pfeil new.png To the top Pfeil new.png

WorkflowSettings

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <WorkflowRoot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  3.   <WorkflowNode id="0" label="Home" >
  4.     <WorkflowNode id="1" label="School" >
  5.       <WorkflowNode id="10" label="Overview" controller="List" form="SCHOOL">
  6.         <WorkflowNode id="100" label="Edit" controller="Form" form="SCHOOL" follownode="10" />
  7.       </WorkflowNode>
  8.     </WorkflowNode>
  9.   </WorkflowNode>
  10. </WorkflowRoot>



Overview formreports.png
Detail form.png

Pfeil new.png To the top Pfeil new.png

Adding FormReport to the workflow

You have to add the attribute FormReport to your workflow. Detailed information about FormReport can be found here.

 <FormReport name="GMSCReport" type="detail" />

As you can see, you have to set the name the same as your template and the type is defined as detail. So you get the report button at the overview list as well as at the detailed view.


Blue.pngName in FormReport must be the same as your template name.



Reportbutton overview.png

Reportbutton form.png

Because the default value for format at the FormReport is pdf, this is the only available options in this case. For sure you can add existing ones or defining new ones. Every information about this topic can be found here.

So if you click on the icon or the font pdf, a report gets automatically downloaded.

Pfeil new.png To the top Pfeil new.png

Adding FormMap to the workflow

You have to add the attribute FormMap to your workflow. Detailed information about FormMap can be found here.

 <FormMap name="Map" label="Map" activelayer="7" layers="1,6,7,8" fitelements="{FORM.ID1}" drawingmode="highlighted" fitfactor="2" template="MapBigTemplate" />

As you can see, you have to set the name of the FormMap like the name of the PictureBox and you have a few other options, which are described here.


Blue.pngName in FormMap must be the same as the name of the picturebox in your template.




Pfeil new.png To the top Pfeil new.png

Report (detail) with table

Report detail table.png



Pfeil new.png To the top Pfeil new.png

Report (detail) with SubReport

Report detail sub.png



Pfeil new.png To the top Pfeil new.png

Report with FormMap

Formmap.png



Pfeil new.png To the top Pfeil new.png

Report (overview)

The difference to the two above mentioned report results is:

<FormReport name="GMSCReportOverview" type="overview" />



Telerik overview.png
Telerik overview1.png




Language: English