Gribo Posted October 13, 2015 Report Share Posted October 13, 2015 View File LibreOffice Simple LV interface A set of simple VIs that uses the LibreOffice / OpenOffice UNO API. The result is very similar to MS Office ActiveX API. Currently, only Calc is supported. This was tested on Windows 8 with LV2013 64 bit and LibreOffice 64 bit. Submitter Gribo Submitted 10/13/2015 Category *Uncertified* LabVIEW Version License Type Quote Link to comment
Bob W Edwards Posted November 30, 2015 Report Share Posted November 30, 2015 (edited) Just trying the 'Uno_test.vi' example on Labview 2014 / Windows 7 / LibreOffice 5.0.3.2. Having trouble right off with error code 1172 from the 'Bootstrap' invoke node in 'Create Factory' vi. This is being fed with a .net reference set to 'uno.util.Bootstrap'. If I try and create a similar node, I don't get that resource in the drop-down list. Sounds like I haven't installed or set all I need to with LibreOffice. What did you install and set (paths etc) on your computer please? I'm interested in this because I wrote a small test executive that uses Excel for all data storage. I got pretty good creating my own Excel interface and would like to add LibreOffice support to that. I'd attempted to do that via COM but never got it installed right / LibreOffice doesn't support COM - I never fully fathomed that out. Regards, Bob Edited November 30, 2015 by Bob W Edwards Quote Link to comment
Gribo Posted December 1, 2015 Author Report Share Posted December 1, 2015 I installed the LibreOffice SDK, However, I tested with 5.0.2.2, I will test with 5.0.3.2 and report here. Quote Link to comment
Gribo Posted December 1, 2015 Author Report Share Posted December 1, 2015 You can browse to the .dll at c:\program files\libreoffice\program\unoidllo.dll. Also, check if both LV and LibreOffice are 32bit or 64bit, if one is different than the other, it will not work. Quote Link to comment
Bob W Edwards Posted December 8, 2015 Report Share Posted December 8, 2015 (edited) Any luck with LibreOffice 5.0.3.2 ? I'm only use 32 bit Windows for now - I guess that means LibreOffice, the SDK and LabView were all 32 bit. Best regards, Bob Edited December 8, 2015 by Bob W Edwards Quote Link to comment
Gribo Posted December 8, 2015 Author Report Share Posted December 8, 2015 I managed to run it on 5.0.3.2 To create the Bootstrap node, click on .Net -> Invoke node -> select class -> .NET -> cli_cppuhelper -> Bootstrap (). Quote Link to comment
Gribo Posted April 28, 2017 Author Report Share Posted April 28, 2017 The current Libreoffice release (5.2.6) has a bug which prevents this library from working. There is fix scheduled for release 5.4 Quote Link to comment
Gribo Posted May 14, 2018 Author Report Share Posted May 14, 2018 I have validated this code with LibreOffice 6.0 1 Quote Link to comment
GroBe Posted June 12, 2018 Report Share Posted June 12, 2018 Hi Gribo, Thank you very much for this interface. I was looking for something like that for a long time. However, I get the error 1172 System.Runtime.InteropServices.SEHException when I run your script. This error comes from the Bootsrtap. I use Labview2018_x64 or Labview2017_x64, LibreOffice_6.0.4.2_x64 and LibreOffice_6.0.4.2_x64_SDK on a Win10_x64 computer. Do you have any idea where does this error come from and how to fix it? I set the environment variables: OFFICE_PROGRAM_PATH = C:\Program Files\LibreOffice\program UNO_PATH = C:\Program Files\LibreOffice Thank you! Quote Link to comment
Gribo Posted June 13, 2018 Author Report Share Posted June 13, 2018 (edited) I don't have access to LV2017. This error usually means that it can't find the Uno DLLs. IIRC, The UNO path should point to C:\Program Files\LibreOffice\program Edit: The UNO_PATH variable is case sensitive. Make sure it has the exact case as above. Edited June 13, 2018 by Gribo Quote Link to comment
GroBe Posted July 2, 2018 Report Share Posted July 2, 2018 Hi Gribo, I finally managed to get it work by setting the correct UNO_PATH + computer reboot!! Thank yo very much for all your work done on that subject and for sharing it with the community. It helps a lot, saving precious time... All the best! Quote Link to comment
davecyli Posted December 23, 2018 Report Share Posted December 23, 2018 (edited) Any tips on what I should research/learn to understand how I can add a chart through LabVIEW? I was able to get all VIs working in both LV 2015 32bit and LV 2018 64bit using version 6.0 Libreoffice. I'm at the point of developing the library more but not sure where to start. Thanks! David Edited December 23, 2018 by David C. Li Quote Link to comment
Gribo Posted December 23, 2018 Author Report Share Posted December 23, 2018 It is a matter of finding the right API calls in the LibreOffice API and using them. For charts, I think the easiest method would be to add a chart sheet and playing with its parameters. 1 Quote Link to comment
Gribo Posted December 24, 2018 Author Report Share Posted December 24, 2018 Instead of a spreadsheet document (unoidl.com.sun.star.sheet.XSpreadsheetDocument) you have to create a chart (unoidl.com.sun.star.chart.XChartDocument). See Libre Office example 1 Quote Link to comment
davecyli Posted December 28, 2018 Report Share Posted December 28, 2018 (edited) Hi Gribo, Thanks for the guidance! On that website, I followed this example: https://api.libreoffice.org/examples/DevelopersGuide/Charts/CalcHelper.java under the Charts Example section. They casted a specific XSpreadsheet to a XTableChartsSupplier.class. Then used the getCharts() method to return a collection of charts and then used the addNewByName method to add a new chart to that collection with the arguments (sChartName, aRect, aAddresses, true, false) I was able to create the charts and embedded it into the specific spreadsheet but they defaulted to bar charts. After the charts are created I was planning on formatting them to a different chart type, and also adding titles, axis names etc.. What do you think about this method? Any downsides? Also let me know if my understanding or terminology is flawed. I haven't programmed in Java in years, and I do not fully understand the API yet. Thanks! David Edited December 28, 2018 by David C. Li Quote Link to comment
Gribo Posted December 28, 2018 Author Report Share Posted December 28, 2018 I understand the API even less, as I have never programmed in Java. I played with it for a bit, but could not get it to create a chart document. Since this is not a high performance library, what ever gets the results is good. 😀 1 Quote Link to comment
davecyli Posted December 28, 2018 Report Share Posted December 28, 2018 Yeah, the VI I'm building is sort of a one-off solution. So it's a little messy but it does the job. For future viewers of this thread. This is a good resource: https://fivedots.coe.psu.ac.th/~ad/jlop/#calc And the author has a chapter on the chart2 api here: https://fivedots.coe.psu.ac.th/~ad/jlop/chaps/28. Chart2 API Overview.pdf Thanks again for the prompt responses Gribo, I wouldn't have expected it for a thread from 2015 haha If i ever clean up my library I'll add some examples to this thread. Cheers! David Quote Link to comment
Gribo Posted December 28, 2018 Author Report Share Posted December 28, 2018 After playing a bit with LabVIEW, and remembering to cast a value, and not its class, I managed to get to your level. I will post an update in an hour or so. 1 Quote Link to comment
Gribo Posted December 28, 2018 Author Report Share Posted December 28, 2018 I have uploaded a new version. The test VI now creates a chart with random data. LibreOffice 6 is way faster than 5, it feels as fast as the Excel .NET API. Quote Link to comment
Gribo Posted May 2, 2022 Author Report Share Posted May 2, 2022 I have validated this library against LibreOffice 7.2 and Windows 10. 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.