combit Software: Report Generator, Reporting Tools, Developer Components, CRM, Customer Relationship Management

Erleben Sie preisgekrönte Software für CRM, Kontaktmanagement und Reporting für Entwickler.
My Account: Login

News

Extend or restrict the List & Label Report Designer individually

How to Adapt the Designer to Your Application's Requirements

With the List & Label Designer in your application your users can set up new projects or adapt existing reports. However, sometimes it's necessary to add your own functions or to reduce the amount of functions, for example to protect certain objects or to reduce complexity. Good to know, that the Designer can easily be modified. This way you can offer your users a perfectly adjusted application. Below we will show you how to extend or restrict the Designer.

 

Add Your Own Functions to the List & Label Designer
with .NET, VCL and OCX

Your own functions can be used to relocate complex calculations into the application's logic respectively to retrofit the Designer with functions that are not yet available.

Programming expample in C#: Query registry key


This is how to integrate a function to query a registry key within a report. The result of the function could for example be displayed in the appearance conditions for objects.

ListLabel LL = new ListLabel();

LL.Language = LlLanguage.English;

LL.DataSource = CreateDataSet();

 

// Initialize function

DesignerFunction RegQuery = new DesignerFunction();

RegQuery.FunctionName = "RegQuery";

RegQuery.GroupName = "Registry";

RegQuery.MinimalParameters = 1;

RegQuery.MaximumParameters = 1;

RegQuery.ResultType = LlParamType.String;

RegQuery.EvaluateFunction += new EvaluateFunctionHandler(RegQuery_EvaluateFunction);

 

// Add function

LL.DesignerFunctions.Add(RegQuery);

 

LL.Design();

LL.Dispose();

 

void RegQuery_EvaluateFunction(object sender, EvaluateFunctionEventArgs e)

{

    // Read registry key

    RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\combit\");

    e.ResultValue = key.GetValue(e.Parameter1.ToString()).ToString();

}

 

 

Restrict menu items, functions and lock objects

A restricted Designer always makes sense, if users are not allowed to change certain elements of a report, e.g. the company logo, or if there are different versions of an application. For .NET or the VCL, the Designer restriction is accessible via the DesignerWorkspace properties of the ListLabel-Object:

ProhibitedActions: Removes menu items from the Designer.
ProhibitedFunctions: Removes functions from the Designer.
ReadOnlyObjects: With this property certain objects in the Designer can be locked. The objects continue to be visible, however, can not be changed or deleted.

In other programming languages or with OCX the same can be achieved with the LlDesignerProhibit... APIs.

Programming example in C#: Restrict Designer


The Designer is adapted in a way that no new projects can be created. Furthermore the function "ProjectPath$" is removed and the object "Demo" can not be altered.


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();




You don't know the current version of List & Label yet?



Print page
© 1989-2012 combit GmbH. All rights reserved. Please read our Notes on Data Protection. Changes and errors may occur.