.NET Imports and JadeDotNetType

Forums for specific tips, techniques and example code
advaro
Posts: 19
Joined: Mon Oct 10, 2016 5:59 pm

.NET Imports and JadeDotNetType

Postby advaro » Fri Oct 14, 2016 8:21 am

Hi,
Haven't really played with .Net imports so I'm a bit lost by the JadeDotNetType class and exactly how to use it.
Bit of background, I am writing an excel export. Currently we use csv, but I now have the need to format the output, with coloured headers, bold, totals etc..
It will generate files from the server as part of an overnight job, not the client PC, but I do not want to install office on the server.
Have found a product called GemBox that looks to fit the criteria, that will create Excel files for me without office installed.

So I have the library imported, and have managed to create a file, create a new worksheet and save it out to a file OK.
Trying to set values in the cells has me stumped now as the property I need to set has imported as a JadeDotNetType class.

The docs give the following info on the property CellRange.Value
public override Object Value { get; set; }
Property set will set value of multiple cells or of a merged range.
Property get has meaning only if range is Merged; otherwise, exception is thrown.
(http://www.gemboxsoftware.com/spreadshe ... _Value.htm)

So being an object it imports in Jade as:
Name: value_2 (14)
Class: CellRange ()
Type: JadeDotNetType
Access: public
Ordinal: 14
non-virtual embedded mapped

In their samples (http://www.gemboxsoftware.com/Spreadshe ... -World/601) they just set the property directly with the text, such as .value = "My text"; but being a JadeDotNetType object I have no such luck.
So how do I work with the JadeDotNetType object? - how can I tell it that this is text is should be taking?

Any pointers or help would be greatly appreciated
Thanks
Stephen

JohnP
Posts: 73
Joined: Mon Sep 28, 2009 8:41 am
Location: Christchurch

Re: .NET Imports and JadeDotNetType

Postby JohnP » Fri Oct 14, 2016 4:45 pm

.Net packages are generally designed for use from .Net. JADE .Net imports can only effectively use JADE types, so the interface needs to use basic types like String, Integer, Integer64, etc. It looks like GemBox relies on a two-dimensional array, and .Net arrays are not compatible with JADE arrays.

You may need to write a .Net wrapper that does some translating, eg an entry point that has Integer parameters for row and column, and the String text to put in it.


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 10 guests