55
Programming With .NET
33
Data type
Usage
them as drawing if a suitable format is found.
LlFieldType,Barcode
Barcode. Barcodes are most easily passed as
instances of the LlBarcode class directly in the
Add methods of the Variables and fields property.
LlFieldType.HTML
HTML. The content of the variable is a valid HTML
stream, a file name or an URL.
2.3.3. Events
The following table shows some important events of the ListLabel component. A full
reference can be found in the component help for .NET.
Event
Usage
AutoDefineField/
AutoDefineVariable
These events are called for each field or variable
before passing it to List & Label. With the event
arguments you can manipulate the name and
content or completely prevent the declaration of
the element. Examples can be found in section
"2.4.8. Database Independent Contents".
AutoDefineNewPage
This event is triggered for every new page when
using databinding. Here, you can register
additional required page-specific variables for the
application which are not part of the data source
by using LL.Variables.Add(). Examples can be
found in section "2.4.8. Database Independent
Contents".
AutoDefineNewLine
The event is triggered for every new line. If the
application requires additional line-specific data
which is not part of the data source itself, it can
be added in this event by using LL.Fields.Add().
Examples can be found in section "2.4.8.
Database Independent Contents".
DrawObject
DrawPage
DrawTableLine
DrawTableField
These events are each called once before and
after printing the corresponding elements, e.g.
for each table cell (DrawTableField). The event
arguments contain a Graphics object and the
output rectangle so that the application can
output custom information additionally. That
could be a special shading, a "Trial” character or a
complete specific output.
VariableHelpText
You can support your users by displaying help
texts for each variable and field in the Designer.
XImage.OCR for .NET, Comprehensive Feature Details It empowers .NET users to extract formatted text from Tiff, scanned PDF, and Jpeg images. Then, output recognized information to PDF, Word, and text files.
export text from pdf to word; c# extract pdf text
37
Programming With .NET
34
2.3.4. Project Types
Three different modes of the Designer are available as report type. Which mode is
used depends on the value of the property AutoProjectType.
Lists
This is the default and matches the value LlProject.List for the AutoProjectType
property.
Typical fields of use are invoices, address lists, reports with charts and cross tables,
multi-column lists, briefly all types of reports where a tabular element is required. The
report container is only available in this mode (see section "2.3.8. Report Container").
Labels
This project type matches the value LlProject.Label for the AutoProjectType property.
It is used for the output of labels. As there are no tabular areas and also no report
container, only variables and no fields are available (see section "2.3.2. Variables,
Fields and Data").
If the used data source contains multiple tables, e.g. products, customers, etc. the
source table for printing labels can be selected by the DataMember property of the
component:
C#:
ListLabel LL = new ListLabel();
LL.DataSource = CreateDataSet();
// Products as data source
LL.DataMember = "Products";
// Select label as project type
LL.AutoProjectType = LlProject.Label;
LL.Design();
LL.Dispose();
VB.NET:
Dim LL As New ListLabel()
LL.DataSource = CreateDataSet()
' Products as data source
LL.DataMember = "Products"
' Select label as project type
LL.AutoProjectType = LlProject.Label
LL.Design()
LL.Dispose()
39
Programming With .NET
35
Cards
This project type matches the value LlProject.Card of the AutoProjectType property.
Card projects are a special case of label projects with exactly one page-filling label.
Typical fields of use are printing file cards (e.g. all customer information at a glance)
or mail merges. Activation is the same as "Labels", the same hints and restrictions
apply therefore.
2.3.5. Varying Printers and Printing Copies
List & Label offers a comfortable support of splitting a report to different printers or
the output of copies with a "Copy” watermark. The best is that these are all pure
Designer features that are automatically supported by List & Label.
Regions
The regions' purpose is to split the project into multiple page regions with different
properties. Typical fields of use are e.g. different printers for first page, following
pages and last page. Further applications are mixing Portrait and landscape format
within the same report.
You can see a demonstration e.g. in the List & Label Sample Application (on the root
level of the start menu) under Design > Extended Samples > Mixed portrait and
landscape.
Issues and Copies
Both issues' and copies' purpose is to output multiple copies of the reports. Copies
are "real” hardware copies, meaning that the printer is assigned to create multiple
copies of the output. Of course all copies are identical and will be created with the
same printer settings.
If the output is to have different properties (e.g. Original from tray 1, copy from tray
2) or a "Copy” watermark is to be output, issues are the way to go. The property
"Number of Issues” in the Designer has to be set to a value greater than one. Then
the function "IssueIndex” is available for all regions, so that a region with the
condition "IssueIndex()==1” (Original) and another with the condition
"IssueIndex()==2” (Copy) can be created.
The objects in the Designer get a new property "Display Condition for Issue Print”
with which the printing of a watermark can be realized in a similar way.
You can see a demonstration e.g. in the List & Label Sample Application (on the root
level of the start menu) under Design > Invoice > Invoice with issue print.
2.3.6. Edit and Extend the Designer
The Designer is not a "Black Box” for the application, but can be manipulated in many
ways. Besides disabling functions and menu items, user-specific elements can be
added that move calculations, actions or outputs to the function logic.
39
Programming With .NET
36
Menu Items, Objects and Functions
Starting point for Designer restrictions is the DesignerWorkspace property of the
ListLabel object. In the following table the properties listed can be used to restrict
the Designer.
Property
Function
ProhibitedActions
This property's purpose is to remove single menu items
from the Designer.
ProhibitedFunctions
This property's purpose is to remove single functions from
the Designer.
ReadOnlyObjects
This property's purpose is to prevent objects' editability in
the Designer. The objects are still visible; however they can't
be edited or deleted within the Designer.
The following example shows how the Designer can be adjusted so no new project
can be created. In addition the function "ProjectPath$” will be removed and the
object "Demo” is prevented from being edited.
C#:
ListLabel LL = new ListLabel();
LL.DataSource = CreateDataSet();
// Restrict Designer
LL.DesignerWorkspace.ProhibitedActions.Add(LlDesignerAction.FileNew);
LL.DesignerWorkspace.ProhibitedFunctions.Add("ProjectPath$");
LL.DesignerWorkspace.ReadOnlyObjects.Add("Demo");
LL.Design();
LL.Dispose();
VB.NET:
Dim LL As New ListLabel()
LL.DataSource = CreateDataSet()
' Restrict Designer
LL.DesignerWorkspace.ProhibitedActions.Add(LlDesignerAction.FileNew)
LL.DesignerWorkspace.ProhibitedFunctions.Add("ProjectPath$")
LL.DesignerWorkspace.ReadOnlyObjects.Add("Demo")
LL.Design()
LL.Dispose()
66
Programming With .NET
37
Extend Designer
The Designer can be extended by user-specific functions, objects and actions.
User-specific functions can be used to move more complex calculations to the
application or add functions which are not covered by the Designer by default.
An example for adding a new function can be found in the section "2.4.10. Extend
Designer by Custom Function".
Examples for user-specific objects or actions as well as another user-specific
function can be found in the "Designer Extension Sample” which is located under
"Miscellaneous” in the .NET sample area in the start menu.
2.3.7. Objects in the Designer
Some objects in the Designer only serve for graphical design (e.g. Line, Rectangle,
Ellipse). However, most of the other objects interact with the provided data. Specific
data types are available for that or there are conversion functions which allow
converting contents for use in the corresponding object. The following paragraphs
give an overview of the most frequently used objects, their corresponding data types
and Designer functions for converting contents.
The hints for the single objects are also valid in the same or similar way for (Picture,
Barcode, etc.) columns in table elements.
Text
A text objects consists of multiple paragraphs. Each of these paragraphs does have
specific content. This can be either a variable or a formula which combines multiple
data contents. To display single variables, usually no special conversion is required. If
multiple variables of a different type (see section "Data Types") are to be combined
within a formula, the single parts have to be converted to the same data types (e.g.
string). An example for the combination of numbers and strings would be:
"Total: "+Str$(Sum(Article.Price),0,2)
The following table lists some of the conversion functions, which are frequently
needed in this context.
From / To
Date
Number
Picture
Barcode
Text
Date
-
DateToJulian()
-
-
Date$()
Number
JulianToDate()
-
-
Barcode(Str$())
FStr$()
Str$()
Picture
-
-
-
-
Drawing$()
Barcode
-
Val(Barcode$())
-
Barcode$()
Text
Date()
Val()
Drawing()
Barcode()
-
38
Programming With .NET
38
Picture
The content of a picture object is set via the property window. The property Data
Source offers three values File Name, Formula and Variable.
The setting File Name is used for a fixed file, such as a company logo. If the
file is not supposed to be redistributed it can be embedded in the report itself.
The file selection dialog offers the appropriate option.
With Formula, the content can be set by a string containing a path. The
required function is "Drawing”.
With Variable, contents already passed as a picture can be displayed (see
section "Data Types").
Barcode
The content of a barcode object is set in a dialog. This dialog offers the three options
Text, Formula and Variable for the data source.
The setting Text is used for fixed text/content in the barcode. In addition to
the content, the type – e.g. with 2D-Barcodes – and other properties for error
correction or encoding can be set.
With Formula the content can be set by a string which contains the barcode
content. The required function is "Barcode”.
With Variable contents already passed as a barcode can be displayed (see
section "Data Types").
RTF Text
The content of a RTF-Text object is set in a dialog. This dialog offers the options
(Free Text) or a selection of possible passed RTF variables (see below) under Source
The setting (Free Text) is used for fixed text/content in the RTF object. Within
the object, data content can be used at any position (e.g. for personalized
multiple letters) by clicking the formula icon in the toolbar.
By selecting a variable, contents already passed as RTF can be displayed (see
section "Data Types").
HTML
The content of an HTML object is set in a dialog. This dialog offers the three options
File, URL and Formula as a data source.
The setting File is used for a fixed HTML file.
With URL, a URL can be passed from where the HTML content should be
downloaded.
With Formula, contents already passed as an HTML stream can be displayed
(see section "Data Types").
30
Programming With .NET
39
2.3.8. Report Container
The report container is the central element of list projects. It allows displaying tabular
data (also multi-columnar or nested), statistics and charts as well as cross tables.
Data can also be output in different form – e.g. at first for a graphical analysis of the
sales by years and then in a detailed tabular list.
A specific tool window for the contents of the container, the Report Structure, is
available within the Designer. Using this window, new content can be added or
existing content can be edited. The window is a sort of "screenplay” for the report
since the exact order of the single report elements is shown in it.
The Report Structure tool window in the Designer
To make the report container available, a data provider (see section "2.3.1. Data
Provider") has to be used as data source. Generally it is also possible to perform
the complete printing on your own by using the low-level API functions of the
LlCore object, however this is not the recommended practice since many features
(Designer preview, Drilldown, report container, …) would have to be specially
supported. If in doubt, it makes more sense to write your own data provider. See
section "2.4.8. Database Independent Contents".
All provided list samples for the .NET Framework make use of the report container
and therefore provide demonstration material for the different operation purposes.
A detailed description for using this element can be found in the Designer Manual
under section "Inserting Report Container”.
2.3.9. Object Model (DOM)
Whereas the Designer is providing a very comfortable and powerful interface for
editing project files, it can often be desired to set object or report properties per
code. For example, the application can display a dialog prior to the Designer with a
data preselection and then start the Designer with a project already prepared with
this selection. An example for that can be found in the sample "Simple DOM
Example” under "Miscellaneous” in the .NET Sample area in the start menu.
45
Programming With .NET
40
Access to the object model is only available from the Professional Edition and
higher.
The following table lists the most important classes and properties of the namespace
combit.ListLabel16.Dom.
Class
Function
ProjectList
ProjectLabel
ProjectCard
The actual project classes. These represent the root
element of the project. Key methods are Open, Save and
Close.
<Project>.Objects
A list of all objects within the project. The objects are
descendants of ObjectBase and each object contains its
own properties and enumerations (e.g. Text paragraphs).
<Project>.Regions
An enumeration of the layout regions of the project. A
page dependent printer control can be realized this way
for example. Further information can be found in section
"Regions".
ObjectText
Represents a text object. Key property is Paragraphs,
the actual content of the text.
ObjectReportContainer
Represents a report container. Key property is SubItems,
the actual content of the report container.
SubItemTable
Represents a table within the report container. It
consists of different line regions (Lines property), which
have different columns (Columns property of a line).
Within the single classes, the properties can easily be browsed via IntelliSense. A
complete reference of all classes can be found in the component help for .NET.
2.3.10. List & Label in WPF Applications
As List & Label itself is a non-visual component, it can be used in WPF applications as
well as in WinForms applications. The Designer itself is no WPF window, however
this does not affect its functionality. The WPF Viewer can be used for displaying
preview files and is a replacement for the WinForms PreviewControl.
2.3.11. Error Handling With Exceptions
List & Label defines a number of internal exceptions, which are all derived from the
common base class ListLabelException and therefore can be caught at a central
location. If the application is supposed to carry out its own Exception handling, calls
to List & Label can be enclosed by an Exception handler:
Documents you may be interested
Documents you may be interested