Question

I'm a beginner in writing code that allows us (my company) to generate reports using the OpenOffice DLL allowing the generation of PDFs. I'm using ASP.NET, writing in VB. I need to be able to modify the cell of a table using the xPropertySet member/functions. So I have a variable named Property which is of the the xPropertySet and references the cell that I want. I'm assuming that I need to use the setPropertyValue function but I'm not entirely sure what arguments I should give it. The end result I want is the following:

Description: ________________

I need to figure out how to make the cell that I have above with the underscores just a border on the bottom. Because I'll have some fields that will be pre-populated. As a test I tried doing objCell.Property.setPropertyValue("CharColor", 255), but I get an error saying that Integer cannot be casted to an uno.Any type. Which, unfortunately I know nothing about. Any help would be greatly appreciated. Thank you.

Was it helpful?

Solution

Alright, sorry all I figured it out finally. All I did is created a border variable of type BorderLine like follows

Dim border As New unoidl.com.sun.star.table.BorderLine

Then I set the outerWidth like so:

border.OuterLineWidth = 1

Then I use the setPropertyValue method for the specific cell that I need So something like this:

objCell.Properties.setPropertyValue("BottomBorder", New uno.Any(border.GetType, border))

Of course Properties between ObjCell and Properties is the xPropertySet of the cell. Anyway, hope this helps someone else.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top