Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

Spreadsheet Document Server API - Part 2

$
0
0
This example demonstrates how to use the Spreadsheet Document Server API to programmatically manage spreadsheet documents, without the need for Microsoft Excel to be installed.
The application includes the RichEditControl  used to display and edit the code. The code modifies the spreadsheet document loaded in the Workbook instance. To see the results, open the document in Microsoft Excel by clicking the button.
You can modify the code and watch the result. If an error occurs during compilation or execution, the backcolor of the code window changes.

This sample introduces API properties and methods used to perform the following operations:

- Insert, delete and modify pictures
- Add a hyperlink to a picture
- Create a table
- Apply a custom style to the table
- Protect a workbook
- Protect a worksheet
- Apply user-specific permissions to a range in a protected worksheet
- Sort a range in descending and ascending orders
- Sort by multiple columns
- Simple search
- Search with options
- Export to HTML
- Group and outline data
- Insert subtotals
- Filter data by a list of values
- Apply a number filter
- Apply a text filter
- Apply a dynamic filter
- Sort the filtered data

For more information, review the Examples section in the documentation.

The Universal Subscription or an additional Document Server Subscription is required to use this example in production code. Please refer to the DevExpress Subscription page for pricing information.

Question Comments

Added By: Goran Ambrosic at: 9/7/2017 6:03:55 AM    Hi guys,
I am facing an issue with the worksheet protection.

In a tested sheet (Workbook created with Excel Pro 2016), I've Unlocked one cell ("B8").
Others are locked by default in Excel.
Then I try to programmatically protect the Sheet, via the API:
worksheet.Protect("password", WorksheetProtectionPermissions.Default)
as you've suggested.
In Visual Studio debugger I can confirm that before the call, worksheet.IsProtected was false and after the call true.
Also,
worksheet.Cells["B7"].Protection.Locked == true
as any other cell in a worksheet, except for the one chosen not to be locked, i.e.
worksheet.Cells["B8"].Protection.Locked == false.

However, I can update the value of any Locked cell.

The same is unclear in your example ProtectionActions.cs, in a method
static void ProtectWorksheet(Workbook workbook)
where you write a content into the
worksheet.Cells["B2"].Value
after the call
worksheet.Protect("password", WorksheetProtectionPermissions.Default);

What am I missing?


Viewing all articles
Browse latest Browse all 7205

Trending Articles