Skip to main content

Can anyone assist me with an example of how to populate Excel from an Acucobol program?



------------------------------
Peter Clayton
Developer
Cobsolv Cc
Midrand ZA
------------------------------

Can anyone assist me with an example of how to populate Excel from an Acucobol program?



------------------------------
Peter Clayton
Developer
Cobsolv Cc
Midrand ZA
------------------------------

I've not tried it in a while, but I have attached an old sample to this case that should be a good start for you. It will need a new .def file generating using axdefgen - https://docs.rocketsoftware.com/bundle/acucobolgt_dg_1051_html/page/BKITITACTXS003.html

The COBOL source may need adjusting for newer versions of Excel.

Thank you



------------------------------
Martin Turner
Developer/Engineer
Rocket Forum Shared Account
Newbury United Kingdom
------------------------------

I've not tried it in a while, but I have attached an old sample to this case that should be a good start for you. It will need a new .def file generating using axdefgen - https://docs.rocketsoftware.com/bundle/acucobolgt_dg_1051_html/page/BKITITACTXS003.html

The COBOL source may need adjusting for newer versions of Excel.

Thank you



------------------------------
Martin Turner
Developer/Engineer
Rocket Forum Shared Account
Newbury United Kingdom
------------------------------

Hello,

this function for populate Excel file exist also for Linux runtime? ver. 10.3



------------------------------
Alberto Rossi
Resp. IT - Bi Esse S.p.A
Bi Esse Spa
Fossano IT
------------------------------

Hello,

this function for populate Excel file exist also for Linux runtime? ver. 10.3



------------------------------
Alberto Rossi
Resp. IT - Bi Esse S.p.A
Bi Esse Spa
Fossano IT
------------------------------

ActiveX controls and COM objects are Windows only, so we cannot leverage the same technology on Linux.



------------------------------
Martin Turner
Developer/Engineer
Rocket Forum Shared Account
Newbury United Kingdom
------------------------------

Hello,

this function for populate Excel file exist also for Linux runtime? ver. 10.3



------------------------------
Alberto Rossi
Resp. IT - Bi Esse S.p.A
Bi Esse Spa
Fossano IT
------------------------------

Depending on what you need to support, you may want to consider:

1) CSV files - very simple text files, with limited functionality, but very easy to create from COBOL

2) Writing your own XLSX - the standard is well publicized, and it's basically XML in a ZIP file wrapper. A very basic version wouldn't require all of the extra data, and you could create a small sample for yourself in Excel, save it as XLSX, and open it with a ZIP utility to see what the underlying data (XML file) should look like. There are ways to create a very slimmed-down version to start with: php - How far can a .xlsx file be simplified - Stack Overflow

3) Find a library that already does this. We use DevExpress Reports for our report writer, and there are built-in options for creating many different file outputs, such as PDF, DOCX, XLSX, etc.



------------------------------
Christopher Ryan
CTO
C/F Data Systems, Llc
Weymouth US
------------------------------

Depending on what you need to support, you may want to consider:

1) CSV files - very simple text files, with limited functionality, but very easy to create from COBOL

2) Writing your own XLSX - the standard is well publicized, and it's basically XML in a ZIP file wrapper. A very basic version wouldn't require all of the extra data, and you could create a small sample for yourself in Excel, save it as XLSX, and open it with a ZIP utility to see what the underlying data (XML file) should look like. There are ways to create a very slimmed-down version to start with: php - How far can a .xlsx file be simplified - Stack Overflow

3) Find a library that already does this. We use DevExpress Reports for our report writer, and there are built-in options for creating many different file outputs, such as PDF, DOCX, XLSX, etc.



------------------------------
Christopher Ryan
CTO
C/F Data Systems, Llc
Weymouth US
------------------------------

Thanks, Christopher, for your advice.
I am moving forward with a program sent to me by Martin Turner.
I do use both CSV (for very large data) and html (for report style, formatted) via a callable program.
I have never tried DevExpress, but I do use List & Label for both reports and charts.
As a supplier of POS Software one of the appeals of L&L is that it is one-payment and royalty free. (I have not yet found the need to pay for a version upgrade)
If you know both products, do you feel I should look at DevExpress?



------------------------------
Peter Clayton
Developer
Cobsolv Cc
Midrand ZA
------------------------------

Depending on what you need to support, you may want to consider:

1) CSV files - very simple text files, with limited functionality, but very easy to create from COBOL

2) Writing your own XLSX - the standard is well publicized, and it's basically XML in a ZIP file wrapper. A very basic version wouldn't require all of the extra data, and you could create a small sample for yourself in Excel, save it as XLSX, and open it with a ZIP utility to see what the underlying data (XML file) should look like. There are ways to create a very slimmed-down version to start with: php - How far can a .xlsx file be simplified - Stack Overflow

3) Find a library that already does this. We use DevExpress Reports for our report writer, and there are built-in options for creating many different file outputs, such as PDF, DOCX, XLSX, etc.



------------------------------
Christopher Ryan
CTO
C/F Data Systems, Llc
Weymouth US
------------------------------

Regarding csv files, one can get a surprising amount of control over the information, since a field can be a formula, not just a value.   Use .tab as an extension, and you can associate excel with it for opening the first time you try to open a .tab file in windows.  Some info:

  • I recommend tab for delimiter instead of comma, so you don't have to fiddle with quoting values with commas in them.
  • using slashes in a date tells excel this is a date.  Or you can use =DATE(year,month,day)
  • Adding a $ to a number tells excel this is currency (do NOT use =DOLLAR, that's a string function)
  • adding a % to a number tells excel this is a percentage.
  • To force a value to be text, use =LEFT("text-value")
  • You can even use field references, and set up a calculated column, if your program keeps track of row/column.  eg) add up columns B and C on each row (assuming 1 is the headers):
    • =B2+C2
    • =B3+C3
    • =B4+C4
  • A note about formulas - they won't indicate currency, they will just be a number.  Sigh.

The file is now excel-ready, but to process it in something not a spreadsheet, all that formatting would have to be stripped.



------------------------------
Robert Redekop
Senior Programmer/Analyst
Samco Software Inc
Surrey CA
------------------------------

Thanks, Christopher, for your advice.
I am moving forward with a program sent to me by Martin Turner.
I do use both CSV (for very large data) and html (for report style, formatted) via a callable program.
I have never tried DevExpress, but I do use List & Label for both reports and charts.
As a supplier of POS Software one of the appeals of L&L is that it is one-payment and royalty free. (I have not yet found the need to pay for a version upgrade)
If you know both products, do you feel I should look at DevExpress?



------------------------------
Peter Clayton
Developer
Cobsolv Cc
Midrand ZA
------------------------------

I'm sorry, I'm not familiar with Label & List. DevExpress has a LOT of tools and a lot of capabilities, but it does require each developer to be licensed, and you need to renew to maintain support and access updates and fixes. We use it for many things beyond just COBOL, so it's worthwhile for us, but it was only 1 of a number of suites we considered based on all of our requirements and multi-platform support. 



------------------------------
Christopher Ryan
CTO
C/F Data Systems, Llc
Weymouth US
------------------------------