Creating custom line styles in FastReport .NET

2023-11-27

Creating custom line styles in FastReport .NET

In the latest update of FastReport .NET 2024.1, a new property called "DashPattern" has been added for PolyLineObject, PolygonObject, LineObject, and ShapeObject. This property allows users to define a custom pattern to create a unique line style in cases where the desired pattern is not available in the default set.

The custom pattern is represented by an array of values, which can be set through the collection editor or manually.

Options for entering custom line pattern values

The elements in the array represent the length of each dash and the gap in the pattern.

The first element sets the length of the dash, the second element sets the length of the gap, the third element sets the length of the dash, and so on. In the example provided above: 5 represents the length of the dash, 3 represents the length of the gap, 2 represents the length of the dash, and 1 represents the length of the gap.

Each element should be a non-zero positive number; otherwise, its value is replaced with 1.

For the proper display of the custom pattern, the pattern array should have an even number of elements—2, 4, and so on. If the array has an odd number of elements, the pattern behaves as follows (using the example array 5, 3, 2): a dash of length 5 is drawn, followed by a gap of length 3, another dash of length 2, a gap of length 0, then a dash of length 5, and so on.

Example of a custom pattern with an odd number of elements

If there is one value in the pattern array, then a solid line is drawn (using the same principle). The length of each dash and gap in the custom pattern is the product of the array element value and the line thickness. It means that as the line thickness increases, the length of the dash and gap will also increase.

This mechanic can be visually observed in the example below. The same custom pattern, with different line thicknesses, creates completely different line styles.

Custom pattern with different line thicknesses

PDF export is supported for objects that use the DashPattern property. It enhances the ability to customize line and outline styles when saving a report in PDF format.

.NET FastReport Designer Customization
12 Ekim 2026, Pazartesi

FastReport .NET'te Greenplum Database'e bağlanma

Greenplum Database’i FastReport .NET’e nasıl bağlayacağınızı öğrenin: Npgsql ile eklentiyi derleme, rapor tasarımcısına entegre etme ve bağlayıcıyı uygulamanın C# kodunda kaydetme.
12 Ekim 2026, Pazartesi

FastReport .NET'ten Erişilebilir PDF'ye Bir Rapor Nasıl Dışa Aktarılır (PDF/UA-1)

FastReport .NET'ten bir raporu PDF/UA-1 uyumlu bir dosya olarak dışa aktarma: kullanıcı arayüzü ve C# kodu aracılığıyla yapılandırma, SemanticRole ve AltText rolleri ile doğrulama.
12 Ekim 2026, Pazartesi

FastReport .NET’te Önizleme’den bir raporu XML formatına aktarma

FastReport .NET'te bir raporu XML biçiminde nasıl kaydedeceğinizi öğrenin: kod kullanmadan Önizleme'den dışa aktarma ve parametreleri ayarlayarak XMLExport aracılığıyla programlı dışa aktarma.

© 1998-2026 Fast Reports Inc.