Using List & Label 17 with Microsoft WebMatrix - combit GmbH

17 downloads 132 Views 175KB Size Report
General. Requirements. Installed Windows WebMatrix (http://www.microsoft.com/ web/webmatrix/). Step by Step Instruction. Creating a new WebMatrix Project.
combit GmbH Untere Laube 30 78462 Konstanz Germany

Whitepaper

Product: combit List & Label 17 Using List & Label 17 with Microsoft WebMatrix

Copyright combit GmbH, Alle Rechte vorbehalten.

Product: combit List & Label 17 Using List & Label 17 with Microsoft WebMatrix

-2-

Content General Requirements Step by Step Instruction

3 3 3

Creating a new WebMatrix Project

3

Creating the Code File

3

Inserting the Code

3

Copyright combit GmbH, All rights reserved.

Product: combit List & Label 17 Using List & Label 17 with Microsoft WebMatrix

-3-

General Requirements Installed Windows WebMatrix (http://www.microsoft.com/web/webmatrix/).

Step by Step Instruction Creating a new WebMatrix Project Start WebMatrix and create a new project via "Website from Template > Starter Side". After that you will see the WebMatrix development environment.

Creating the Code File Click on the item "Files" on the left side and create a file called "print.cshtml" via "Project Name > Right Click > New File". Also create a new folder named "bin" via "Project Name > Right Click > New Folder". Add the "combit.ListLabel17.dll" to the folder "bin" (see the file redist.txt in your List & Label installation for information about further required DLLs) via "Project Name > Right Click > Existing File".

Inserting the Code Open the file "Default.cshtml" and add the following code between

/

:

Click the button for creating the list:

Now open the file "Print.cshtml" and add the following code: Copyright combit GmbH, All rights reserved.

Product: combit List & Label 17 Using List & Label 17 with Microsoft WebMatrix

-4-

@using combit.ListLabel17; @{ Layout = "~/_SiteLayout.cshtml"; Page.Title = "combit List & Label 17 WebMatrix Sample"; }

@{ ListLabel LL = new ListLabel(); ExportConfiguration ex = new ExportConfiguration(LlExportTarget.Pdf, "", ""); LL.DataSource = ; LL.Export(ex); LL.Dispose(); Response.ContentType = "application/pdf"; Response.AddHeader("content-description","filename="); string filePath = "Path of PDF"; Response.WriteFile(filePath); Response.End(); }

With "Run" you now can test your website on your local IIS.

When clicking on the button, List & Label 17 executes an export on the server and shows the created PDF in the browser afterwards.

The information stated above is for purely informative purposes and does not stand under guarantee. Although our goal is to give you the best information we can, errors and mistakes may occur. In some cases the information has been given in order to help you with a special task, even though the product wasn't necessarily meant for that specific purpose. This information does not have an effect on your product guarantee. Copyright combit GmbH, All rights reserved.