Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
9
Erster Beitrag:
vor 2 Jahren, 9 Monaten
Letzter Beitrag:
vor 2 Jahren, 9 Monaten
Beteiligte Autoren:
David Egan, Al, MichaelG

[WD20] .Net Control (Gembox)

Startbeitrag von David Egan am 30.08.2015 20:08

Hi
I'm trying to add the Gembox spreadsheet to a window.

I added the .Net control and added the DLLs to the project. In the parameters Windev requires 2 items, the assembly name & the Winform class & that is where I come unstuck! All the documentation for the object simply suggests the assembly is all that is required but Windev won't allow that.

No matter what I assign as the Winform I get 2 errors displayed in the control when I try to run it; "Unable to build object" and "Unable to invoke method of type. (The part varies depending on the Winform class selected). From testing I am certain these errors are propagated when the control is initilaised and before any license checking is done.

It's probably something very simple I've missed (first attempt at .Net control on a window).

Thanks

David

Antworten:

Hello David

I haven't used the Excel Gembox but The Word one works peferctly so I imagine that the setup would bethe same so have you copied the Gembox dll into the Windows assembly folder ?

Mario at Gembox is really helpful so an email to him may also be useful to try.

Regards
Al

von Al - am 31.08.2015 21:36
Hi Al
Thanks,the dll is there. I just tried the WP one & I have the same problem with it. I'm sure it's something I'm missing. What control type did you use, .Net or XAML?

With .Net it asks for the assembly (Gembox.Document.dll) & the .Net 2.0 class (Winform). What have you used for that?

If you've used XAML what code have you used to start it up?

Thanks

David

von David Egan - am 01.09.2015 04:08
Hello David

I bring the dll into my project using the .NetAssemblies option in the Windev Project Explorer pane. I just right click on it and select the Gembox dll from the list of assemblies. It doesn't ask me for any other .Net assembly
On the client side I had to add the wd190net2.dll and wd190net4.dll to existing installations
On my PC I have version .Net v4.0.30319 so maybe you need to be running a later verison of .Net ?

I hope this helps

Regards
Al

von Al - am 01.09.2015 09:53
Hi Al
Tried loading it that way & I'm getting a little bit further (no errors) but I still don't get anything displayed to the screen. What control type did you place on the window?

Cheers

David

von David Egan - am 01.09.2015 22:44
Hello David

Sorry David I just use the document version, so there is no control onscreen just code to handle the documents.

Regards
Al

von Al - am 02.09.2015 02:38
Aah well, that explains that!

Thanks anyway

David

von David Egan - am 02.09.2015 22:56
My first question would be whether the end user will have excel installed on their machine or not.

von MichaelG - am 04.09.2015 14:49
Bear in mind I've only used WinDev for a couple of months and am not familiar with GemBox. That being said it appears that GemBox doesn't have a good way to view files unless the box has Excel installed. To accomplish what you want you need to set your .Net 2.0 control CLASS to point to:

System.Windows.Forms.DataGridView

It will autofill the .dll (System.Windows.Forms.dll)

From there I added a button and in its click event I added:


ef is "GemBox.Spreadsheet.ExcelFile"
xlsLO is XlsxOptions
dgvOpt is ExportToDataGridViewOptions
dgvOpt:set_ColumnHeaders(True)
ssPath is UNICODE string
ssPath = "C:\Users\mwgreen\Desktop\WinFormsUtilitiesSample.xlsx"
ef:LoadXlsx(ssPath,xlsLO)
DataGridViewConverter.ExportToDataGridView(ef.Worksheets.ActiveWorksheet, excelshow, dgvOpt)


my sources were:

MSDN

GemBox Examples

and the compiled help provided with the software. I hope this helps you.

von MichaelG - am 04.09.2015 16:33
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.