User Module:Open Office Write spreadsheet
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
User Module:Open Office Write spreadsheet
Just a user module to allow the creation and writing of Open Office spreadsheets.
Thanks to all on the forum that helped.
Use the dropbox link below to down a zip with the project files.
Unzip the project and run. (No exe in download so you need PB. Load the project and run. Click the button and you will be promted for a filename. Enter the filename and it will be created with some test data in the folder. Double click the file to run Open Office and you will see the spreadsheet.
Code fairly self explanatory but if more info required leave post here.
The module will be changing as i wish to add procedures to extract data from the spreadsheet and maybe add style etc.
If anyone has any suggestions or can help enhance the module please leave code snippets here and I will incorporate them as and when I can.
Edit 08 April 2016
Seems to be some problems. Changed all "\" as path seperators to "/". Added a little checking to ensure files exist.
Code removed.
Tested with PB5.42LTS on Windows 7 and PB5.41LTS on MAC OS el kapitan
Dropbox link for project files added:- https://www.dropbox.com/s/2jfh2o3kudu3d ... e.zip?dl=0
Regards
CD
Enjoy
Thanks to all on the forum that helped.
Use the dropbox link below to down a zip with the project files.
Unzip the project and run. (No exe in download so you need PB. Load the project and run. Click the button and you will be promted for a filename. Enter the filename and it will be created with some test data in the folder. Double click the file to run Open Office and you will see the spreadsheet.
Code fairly self explanatory but if more info required leave post here.
The module will be changing as i wish to add procedures to extract data from the spreadsheet and maybe add style etc.
If anyone has any suggestions or can help enhance the module please leave code snippets here and I will incorporate them as and when I can.
Edit 08 April 2016
Seems to be some problems. Changed all "\" as path seperators to "/". Added a little checking to ensure files exist.
Code removed.
Tested with PB5.42LTS on Windows 7 and PB5.41LTS on MAC OS el kapitan
Dropbox link for project files added:- https://www.dropbox.com/s/2jfh2o3kudu3d ... e.zip?dl=0
Regards
CD
Enjoy
Last edited by collectordave on Thu Dec 01, 2016 4:25 pm, edited 3 times in total.
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Re: User Module:Open Office Write spreadsheet
Hi,
just for information:
it works also with LibreOffice 5.1
Bernd
just for information:
it works also with LibreOffice 5.1
Bernd
Re: User Module:Open Office Write spreadsheet
I appoligize, but I've got a busy schedule today and have to go.
But I tried with LibreOffice which I always use, and it always crashes here in the WriteCalc.pbi file:
I ran the code as directed in the notes.
(It's probably something simple and stupid, but I just don't have time to look at it further right now.)
*I do appreciate your sharing this code though.*
WriteCalc.pbi:
But I tried with LibreOffice which I always use, and it always crashes here in the WriteCalc.pbi file:
I ran the code as directed in the notes.
(It's probably something simple and stupid, but I just don't have time to look at it further right now.)
*I do appreciate your sharing this code though.*
WriteCalc.pbi:
Code: Select all
Procedure DeleteRows()
;Procedure to delete current cell detail from document
*CurrentNode = XMLNodeFromPath(RootXMLNode(loadedxml), SpreadSheetPath);**** CRASHES HERE <------<<<<
For child = XMLChildCount(*CurrentNode) To 1 Step - 1
*child = ChildXMLNode(*CurrentNode, child) ;**** or CRASHES HERE everytime <------<<<<
; [Error] The specified #XML is Not initialized
DeleteXMLNode(*child)
Next
FormatXML(loadedxml,#PB_XML_ReFormat )
EndProcedure
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: User Module:Open Office Write spreadsheet
hi yrreti
Can you let me know which OS you are using/
The only thing I can see with the error you are getting is where the xml is loaded. The content.xml file should exist after the crash in the \Temp folder in whichever folder you are running the programme from. The temp folder is deleted after a successfull operation.
I do no error checking there at all so first check that the file exists on the path specified. If you are running a MAC maybe the backslash should be a forward slash. If the file exists you could add the lines
and see what you message you get.
Please let me know how you get on.
Can you let me know which OS you are using/
The only thing I can see with the error you are getting is where the xml is loaded. The content.xml file should exist after the crash in the \Temp folder in whichever folder you are running the programme from. The temp folder is deleted after a successfull operation.
Code: Select all
;Load the xml from the content.xml file
loadedxml = LoadXML(#PB_Any, GetCurrentDirectory() + "Temp\content.xml")
Code: Select all
If XMLStatus(loadedxml ) <> #PB_XML_Success
Message$ = "Error in the XML file:" + Chr(13)
Message$ + "Message: " + XMLError(#XML) + Chr(13)
Message$ + "Line: " + Str(XMLErrorLine(#XML)) + " Character: " + Str(XMLErrorPosition(loadedxml))
MessageRequester("Error", Message$)
EndIf
Please let me know how you get on.
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Re: User Module:Open Office Write spreadsheet
collectordave:
I've tried you code on Windows 64 bit with PB 5.41 LTS (64 bit) and got results similar to
ones reported by yrreti : crashing with error in WriteCalc.pbi (Line: 162)
[ERROR] The specified #XML is not initialised.
P.S. The error above happening because application tries to read data from Temp\content.xml file
and that file does not exist...
I've tried you code on Windows 64 bit with PB 5.41 LTS (64 bit) and got results similar to
ones reported by yrreti : crashing with error in WriteCalc.pbi (Line: 162)
[ERROR] The specified #XML is not initialised.
P.S. The error above happening because application tries to read data from Temp\content.xml file
and that file does not exist...
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: User Module:Open Office Write spreadsheet
Problems with missing files it seems.
Now updated original post with a dropbox link to the project files as zip. No exe file just text and a Template.ods file.
Now updated original post with a dropbox link to the project files as zip. No exe file just text and a Template.ods file.
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Re: User Module:Open Office Write spreadsheet
Hi collectordave
Is it possible to get an update of this program again?
Your dropbox link has been removed.
I really have a need to try experimenting with it again.
Doing it manually is a pain in the butt.
Thanks for your help.
Is it possible to get an update of this program again?
Your dropbox link has been removed.
I really have a need to try experimenting with it again.
Doing it manually is a pain in the butt.
Thanks for your help.
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: User Module:Open Office Write spreadsheet
Hi
Just back after a little problem. Working through the programmes I was doing at the time. When I get to it I will post again.
sorry for any problems.
cd
Just back after a little problem. Working through the programmes I was doing at the time. When I get to it I will post again.
sorry for any problems.
cd
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: User Module:Open Office Write spreadsheet
Hi
Tested code quickly and still seems to work so link in first post updated and enabled again.
Regards
cd
Tested code quickly and still seems to work so link in first post updated and enabled again.
Regards
cd
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Re: User Module:Open Office Write spreadsheet
@collectordave thanks, that was a pain to search reliable and independent (without MS Office required, etc) way of working with sheets from PB (I found only one independed library looking nice, and it is proprietary). At least your code might allow writing of those sheets, will try it somehow ^^
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: User Module:Open Office Write spreadsheet
@Lunasole
I will be moving onto that later to develop it further as I want to use OO, not MSword as wel, so if I can help drop me a line.
Regards
cd
I will be moving onto that later to develop it further as I want to use OO, not MSword as wel, so if I can help drop me a line.
Regards
cd
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Re: User Module:Open Office Write spreadsheet
Sorry to dig up an old thread, but does anyone have a copy of the file WriteCalcFile.zip?
Not surprisingly, the old dropbox link is dead.
Thanks.
Not surprisingly, the old dropbox link is dead.
Thanks.
"There is no passion to be found playing small - in settling for a life that is less than the one you are capable of living." - Nelson Mandela
Re: User Module:Open Office Write spreadsheet
- It was too lonely at the top.
System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: User Module:Open Office Write spreadsheet
Project expanded you can now read and write OO spreadsheets.
No commate no api just straight PB here on this thread and as such should be cross platform.
viewtopic.php?f=13&t=76189
No commate no api just straight PB here on this thread and as such should be cross platform.
viewtopic.php?f=13&t=76189
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.