Random Ramblings on LabVIEW Design

Community Browser
Labels
cancel
Showing results for 
Search instead for 
Did you mean: 
swatts
4813 Views
10 Comments

What-ho Wire Wrestlers.

I had two other options for this article

  1. A discussion about the poor sods who get thrown onto complex projects undercooked and what can be done to educate project managers about the value of employing experience. I've witnessed this a few times this year.
  2. Open up the design of the API for the ODS tool. It's working rather nicely in my application, but I know it's not sorted yet.

Or alternatively I could leave the ODS API half-cooked and I'm not in the mood to grizzle. So instead I'm going to talk about ODTs

ODTs are the output of Open Document Word Processors, including newer versions of Microsoft Word, Open-Office Writer and LibreOffice Writer.

Before I plough in and do the hard work I thought it might be good to request some input from other users.

Here's one use-case that would be marvellous for me.

IssueReport.png

Here I have my bug reporting tool, when I press commit I would like it to generate an issue report document, with all the details filled in for me. This would be way better than my current "Issue Saved" dialog confirmation.

Using a similar model to the one I employed for the spreadsheet I could load a template and update it.

Luckily both Word and Openoffice offer bookmarking facilities. We could organise our template with various bookmarks and then offer methods to insert things at the book mark point. In ODS I have fathomed tables, Images are just links and the images go into a directory called ..\Configurations2\images\Bitmaps, text is a direct replacement.

Main page data goes in content.xml

Header and Footer info goes into styles.xml so I would need to search that for bookmarks too.

The bookmark tags come in two flavours.

<text:bookmark text:name="headerbookmark"/> <--- this is just a single place point and your insertion goes either at the end or the beginning of this tag.

<text:bookmark-start text:name="my2ndbookmark"/>ddd<text:bookmark-end text:name="my2ndbookmark"/> <--- this is a range of text that should be replaced by whatever is inserted.

The only additional facility that I can think that will be useful is the ability to duplicate pages.

Here's the updated (version D1:01) example program screen

ODFExampleScreen.jpg

This demonstrates both ODS and ODT generation.

Here's another instance where I could use this type of functionality.

Document.png

I generate a new document number for a project using this little utility, it would be splendid if it actually generated the document all numbered and dated.

Is there any other use-cases that would be handy?

Leave words of wisdom in the comments please.

Much Love

Steve

04-May-2016 added ODF toolkit, this purely replaces/insert text into a template and saves the template, as a bonus there's a bit that then converts the ODT file to a PDF if you have LibreOffice (probably works with OpenOffice too). Created file works with Word too. Questions and use cases into the comments please. ODTExample.vi shows usage. Video to follow...

06-May-2016 Made the text entered XML safe (as far as I know) for ODS and ODT

19-05-2016 D1:01 added version numbering and prettied up the example, tested with provided templates and works OK. Used LibreOffice 5 for the pdf printing

08-06-2016 D1:02 ODTGetBookmarks removed table of contents "RefHeadings" bookmarks LV2014

swatts
3998 Views
7 Comments

In my opinion the LabVIEW community is just full of lovely people!!

I missed going to the eCLA Summit as I'm presenting at NIWeek and very jealous I was sat in my office trying to get ODS documents to work (all sorted now hopefully).

So imagine my surprise when I was presented with this jacket all autographed up.


WP_20160414_005.jpgWP_20160414_002.jpgWP_20160414_003.jpg

Zooming in

JeffK.jpg

Some will see Jeff K but all I can see is Jeff X.... Well I you too Mr Kodosky.

I have one complaint about the beer!

WP_20160414_006.jpg

It was a little dry! (I blame Mr Roebuck)

I hear it was Oli that organised it, so many thanks my friends, I was very touched!

Look here's a picture.

Touched.jpg

Much Love

Steve

swatts
7617 Views
26 Comments

Hello My Sweets,

Way back when I started a project to make a Open Document Tool, some words can be found here.

It came grinding to a halt due to memory leaks in the xpath tool used for navigating content.xml and pressure of work.

Well .... I've only gone and cracked it.

So attached to this article is a project with the following example.

ExampleScreen.png

And the block diagram looks like this.

BlockDiagram.png

And what it does is

  1. opens a template spreadsheet (to get all the formatting, preload data etc etc).
  2. Returns Sheet names
  3. Returns Contents for a selected sheet
  4. Stores the Spreadsheet

There's also couple of methods for replacing and inserting sheets. This is restricted to strings at the mo' but there's no reason we can't add formatting/polymorphism.

This should be all we need create spreadsheets from LabVIEW (obviously we can be adding more methods).

I would like to add some word processor functionality in the coming months as another class.

It's been tested with LibreOffice and OpenOffice and one converted excel file with the help of Jarobit, but this is a pretty early release so expect surprises.

I've used the open G ZLIB tools, but these are embedded in my project and namespace protected in an LVLIB so it should sit in a project and mind its own business.

Now I need to sleep.

night night Lovelies

Late night issue fix (always the recipe for awesome software), issues 1 and 2 sorted SW 09-04-2016

12-04-2016 I think I've sussed the Excel issues, so I've included a Template.ods with some data in it too. (there is a minor untidyness with some the repeat rows of emptyness)

It's now 4M because I've added all the ZLIB stuff, my thinking being that we can trim it back down when we're happy.

13-04-2016 disappointing result on the rebuilding of the ODS file, ZLIB is unzipping empty dirs as 0 value files. This is causing me some angst as I'm struggling to get the file correct for both LibreOffice and Excel.

ODS files are slightly simpler when created by Excel, so it all works OK using the template.ods provided <-- Well Well Well it appears there's an issue with ZLIB Read Compressed File__ogtk.vi where it is extracting an empty directory.

15-04-2016 I've tidied the project and improved the example.