How to use polylines and polygons in the report

2017-02-27

This article demonstrates a graphic editor introduced by FastReport.Net and seeks to offer strategies how to use some of its new features which differentiate the editor from a well - known graphic editor Point.

 Let us take a close look at the object "Shapes” that includes both finished shape and the line from which you can create your own polygons.

 

The elements “Line” (and its derivatives), “Rectangle”, “Rounded Rectangle”, “Ellipse”, “Triangle” and “Rhombus” are well known. New forms that have been released significantly extended the capabilities of the shapes. Developers of FastReport.Net have added the following elements: “Polyline”, “Polygon”, “Pentagon”, “Hexagon”, “Heptagon”, “Octagon”. All these new figures are constructed with the help of polylines, that allow editing of their shape, new angles and lines.

 Let us review the element “Polyline”. When you add it to the page it is necessary to specify the starting point from where to build the line. Choose the right place and click on it. Now, you need to specify the second point. The line will be built between the two points. By specifying the third point, you create a line from the second to the third point and so on.

It is possible to build a figure by connecting the last point in the first one.

Now let us examine the possibility of editing the shapes of already created figure.

It is possible to:

1. add new point on the line;

2. add a new line to the top;

3. add a new line to the end;

4. delete points;

5. move the points by mouse (thus changing the shape).

In addition, you can stretch, compress and move the shape.

The toolbar for editing polygons and polylines is given bellow:

It is possible to build a figure by connecting the last point in the first one.

Now let us examine the possibility of editing the shapes of already created figure.

It is possible to:

1. add new point on the line;

2. add a new line to the top;

3. add a new line to the end;

4. delete points;

5. move the points by mouse (thus changing the shape).

In addition, you can stretch, compress and move the shape.

The toolbar for editing polygons and polylines is given bellow:

 

It must be mentioned, that this panel is available only in FastReport.Net classic interface. It means that it is unavailable in the Ribbon interface-it. To switch to the old interface, use the menu “View-> Settings-> Interface”, uncheck the checkbox "Use the new Ribbon-interface."

To enable a shape edit mode, click on it by right mouse button and select "Edit" from the context menu. In this case there will a loss of a frame around the figure take place and figures editing toolbar will become active.

1. To add new points in the shape, use the item  from the toolbar. In this case, it will be possible to add nodes to the figure by clicking to the right place. To disable mode of appending new points, choose the item .

Now you can drag the added nodes to change the shape using the mouse.

In the image given above two new points were added to the shape.

2. The function “Add new line to start” allows to add a line, which will be drawn from the first point of polyline or polygon. You need to click on the desired place and the line will be drawn up to this point.

 

Three points were added to the pentagon in the image above. First, a line to the start was added to get the point 6. It was connected to points 1 and 5. Then another line was added to the start to the point 7. It was connected to points 1 and 6. Finally, one more line was added to the start to get the point 8, connected with points 1 and 7.

3. The function "Add a new line to end" is similar to the previous function, but in this case lines are added to the last added point.

In the picture given above a line was added to the end to get a point 6. It was connected to points 1 and 5. Next, another line was added to the end to get the point 7. It was connected to points 1 and 6. In the end, one more line was added to the start to get the point 8, connected to points 1 and 7.

This study illustrates that the procedure in paragraph 2 is identical to the procedure in paragraph 3 with the only difference in last point 5 of the pentagon that became the starting point for each added segment.

4. Removal mode of nodal points is activated by the icon  . Clicking on the point to be deleted you remove this point and all lines connected to it. Then, draw a new line connected to the points, which are neighboring to the remote one.

 

The picture given above shows a remote point for the figure from the first example.

5. It is possible to move the point of the figure in a polygon editing mode. You should drag the desired point to the desired location. At the same time associated with the point line will be redrawn according to the new location. All the above discussed operations are relevant for working with Polyline.

Let us analyze the object “Polygon” . Contrary to the “Polylines”, it allows building a closed shape. After the addition of the third point, the first and last points are connected. Each additional point will be connected to the first and the last point of the figure.

Shapes “Pentagon”, “Hexagon”, “Heptagon” and “Octagon” are the prepared forms, which can be edited (resize, add new point).

To fill the color, use the feature “Fill”. You will see the following screen:

 

The example illustrates that the shape of a figure can be filled not only with a solid color, but with a linear gradient, a path gradient (ellipse or rectangle) or a shading and glass (a translucent filling).

We have exhibited the new features of "drawing" in FastReport.Net which are worth having.

 

 

November 20, 2024

Localization and Language Switching in FastReport VCL

FastReport VCL supports 40 languages for interface localization and allows you to change the language on the fly through menus or code, without recompilation.
November 01, 2024

New Features of the FastReport VCL Editor

We are considering new features of the report editor: extension lines, highlighting of intersecting objects, updated report and data trees.
October 30, 2024

Using Styles When Creating Reports in FastReport VCL

The article discusses one of the new features of FastReport VCL — the use of styles and style sheets.
Fast Reports
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 66 Canal Center Plaza, Ste 505, Alexandria, VA 22314

© 1998-2024 Fast Reports Inc.