News combit Dev Blog

Add Your Custom Objects and Functions to the Web Designer

Posted: Friday, October 19, 2018 | 2 comment(s)
 
Extensibility is a first class citizen in the List & Label universe. You can add your own functions and objects to the Designer, enabling complex calculations within your code or custom objects. However, there was one important link missing so far - all this code just runs on the desktop. If your application runs on a server and you're using the Web Designer you're hosed - until version 24.

Now there is the possibility to add your custom Designer objects and functions to List & Label on the server and use them in the Web Designer or Report Server Designer on a client afterwards.

Web Designer
To add your DesignerObjects and DesignerFunctions instances to the Web Designer, you need to add information about the extension assemblies and their classes to the web application's configuration on the server. The WebDesignerOptions class has a new property ExtensionAssemblies to do so. A simple snippet would look like this. The sample assumes a folder called "extensions" in the root folder of the web application that contains the assemblies to load.

string dllPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "extensions");
  
options.ExtensionAssemblies.Add(new combit.ListLabel24.Web.WebDesigner.WebDesignerExtension()
{
    AssemblyName = "[YourExtensionAssemblyName].dll",
    ExtensionDirectory = dllPath,
    Dependencies = new List<string> { "[YourFirstExtensionAssemblyDependencyName].dll", "[YourSecondExtensionAssemblyDependencyName].dll", [...] },
    ExtensionClasses = new System.Collections.Generic.List<combit.ListLabel24.Web.WebDesigner.WebDesignerExtensionClass>(){
        new combit.ListLabel24.Web.WebDesigner.WebDesignerExtensionClass(){
            ClassName = "YourExtensionClassName", // this class should be derived from the DesignerObject class
            ExtensionType = combit.ListLabel24.Web.WebDesigner.WebDesignerExtensionType.DesignerObject               
        }
    }
});

Report Server Designer
To add your DesignerObjects and DesignerFunctions instances to the Report Server Designer, you need to add information about the extension assemblies and their classes to the privateSettings.config file in the WebUI folder of the Report Server application on the server. A simple snippet would look like this. The sample assumes a folder called "C:\Temp\" that contains the assemblies to load. The IIS Application Pool user needs to have read access to this folder.
<setting key="DesignerExtensions">
    <DesignerExtensions>
        <DesignerExtension Name="[YourExtensionAssemblyName].dll" Path="C:\Temp\">
            <Dependency Name="[YourFirstExtensionAssemblyDependencyName].dll" />
            <Dependency Name="[YourSecondExtensionAssemblyDependencyName].dll" />
            [...]
            <ExtensionClass ClassName="[YourExtensionClassName]" ExtensionType="DesignerObject"></ExtensionClass>
        </DesignerExtension>
    </DesignerExtensions>
</setting>

Loading the Extensions
By adding this code to the web application's configuration or the Report Server privateSettings.config file on the server, the Web Designer respectively the Report Server Designer on the client will automatically try to download the assembly and load it as a new extension. Anytime that a new version of the assembly is available on the server in the same folder, by restarting any client it will find out about the change and download the new assembly automatically again. If the assembly remains unchanged on the server and has been downloaded before, almost no network traffic will be used up as just the checksum of the file is transferred.




Author: Jochen Bartlau
Head of Development List & Label

Jochen Bartlau leads the development at combit as Managing Director. He's a Microsoft .NET enthusiast driving innovation & agile project management. The mobile devices geek who used to be a physicist in his first life loves to spend his spare time with his family.


  

RSS
combit Development BlogRSS
What’s this blog for?
A place to share updates about the ongoing development of our products. General musings on the software industry included.
Archive
April 2021 (1)
March 2021 (1)
February 2021 (2)
January 2021 (1)
December 2020 (2)
November 2020 (1)
October 2020 (2)
September 2020 (1)
August 2020 (2)
July 2020 (1)
June 2020 (1)
May 2020 (2)
April 2020 (2)
March 2020 (2)
February 2020 (1)
January 2020 (1)
December 2019 (1)
November 2019 (2)
October 2019 (2)
September 2019 (2)
August 2019 (2)
July 2019 (2)
June 2019 (2)
May 2019 (1)
April 2019 (0)
April 2019 (1)
March 2019 (1)
February 2019 (1)
January 2019 (1)
December 2018 (1)
November 2018 (2)
October 2018 (4)
September 2018 (4)
August 2018 (2)
July 2018 (2)
June 2018 (2)
May 2018 (1)
April 2018 (1)
March 2018 (1)
February 2018 (2)
January 2018 (1)
December 2017 (1)
November 2017 (2)
October 2017 (3)
September 2017 (3)
August 2017 (2)
July 2017 (2)
June 2017 (1)
May 2017 (2)
April 2017 (1)
March 2017 (1)
February 2017 (1)
January 2017 (2)
December 2016 (1)
November 2016 (1)
October 2016 (4)
September 2016 (5)
August 2016 (2)
July 2016 (2)
June 2016 (3)
May 2016 (2)
April 2016 (3)
March 2016 (3)
February 2016 (1)
January 2016 (2)
December 2015 (2)
November 2015 (1)
October 2015 (4)
September 2015 (5)
August 2015 (2)
July 2015 (2)
June 2015 (2)
May 2015 (1)
April 2015 (2)
March 2015 (1)
February 2015 (1)
January 2015 (1)
December 2014 (2)
November 2014 (1)
October 2014 (1)
September 2014 (2)
August 2014 (1)
July 2014 (2)
June 2014 (1)
May 2014 (2)
April 2014 (1)
March 2014 (2)
+1 800 256 3608 (toll-free North America only)