Previous Thread
Next Thread
Print Thread
PRTXLS - Example? #35284 13 Jun 22 08:24 AM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Morning everyone...
I had a question from a customer few weeks ago asking can they export more reports from Madics/Ashell? I said sure I can change the report to create a csv or like majority of the time I convert the report into XTree and they can export it from the data-grid them self using the right click export to CSV, Just let me know what report... They replied back with over 30+ of them, yikes...
This made me think could PRTXLS help, is there any [90x,x] examples? remember im looking for the magic bullet one tweak/thing that work with 99% of the reports. smile

I created a LPT88.INI with COMMAND=SBX:PRTXLS but nothing unless I missed the obvious shows to export to xsl? (see screen shot)
Or a licencing issues? mine shows: ISMA ATE ATS PDFX APEX AXL ASQL EFS - Testing under Ashell/Windows but would be for Ashell/Linux/ATE.

Lot of report were accounting ones with multi-line so not sure how clever it needs to be..

Thoughts, suggestion?

Code
RUN DATE: 13-JUN-22  TIME: 09:11 HRS          Madics 4.2 (Multi Div)                                         (STEVE)     PAGE     1
PLIP02 4.2(501)               PURCHASE LEDGER-TRANSACTION POSTING JOURNAL - BATCH: TI0220    PERIOD: 6, 2021
====================================================================================================================================
1 - INVOICE, 2 - CREDIT NOTE, 3 - DEBIT NOTE, 4 - JOURNAL, 5 - CONTRA
====================================================================================================================================

-----DOCUMENT-----  -----------------SUPPLIER-----------------                                              APPLY   DUE-DATE
   NO    TP DATE      NO   NAME                                    AMOUNT        VAT      TOTAL   NON-DISC     TO   STL-DISC CURRNCY

12345678 1 30/06/21 STEVE  Steve test Supplier Ltd                 100.00      20.00     120.00       0.00          28/07/21   GBP
  000861  REF: ABCDEF               NOTE:                           75.00 6230-400                                      3.00
                                                                    25.00 6960-500

                    TOTAL INVOICES                                 100.00      20.00     120.00
                    TOTAL CREDIT NOTES                               0.00       0.00       0.00
                    TOTAL DEBIT NOTES                                0.00       0.00       0.00
                    TOTAL JOURNALS                                   0.00       0.00       0.00
                    TOTAL CONTRAS                                    0.00       0.00       0.00
                    TOTAL GBP                                      100.00      20.00     120.00


Attached Files 2022-06-13_09-19-51.png
Last edited by Steve - Caliq; 13 Jun 22 08:26 AM.
Re: PRTXLS - Example? [Re: Steve - Caliq] #35286 13 Jun 22 12:48 PM
Joined: Jun 2001
Posts: 3,406
J
Jorge Tavares - UmZero Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 3,406
Good point, me neither have those extrabuttons on the Preview window whistle


Jorge Tavares

UmZero - SoftwareHouse
Brasil/Portugal
Re: PRTXLS - Example? [Re: Steve - Caliq] #35287 13 Jun 22 12:50 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Must me a top secret switch Jorge what's enabled when x amount of $$ are transferred into a special swiss bank account. smile

Re: PRTXLS - Example? [Re: Steve - Caliq] #35288 13 Jun 22 01:51 PM
Joined: Mar 2005
Posts: 494
Ty Griffin Offline
Member
Offline
Member
Joined: Mar 2005
Posts: 494
Jorge, Steve--I'll contact you via secure email with the bank account numbers...

Re: PRTXLS - Example? [Re: Steve - Caliq] #35289 13 Jun 22 01:56 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
cool cool

Re: PRTXLS - Example? [Re: Steve - Caliq] #35290 13 Jun 22 03:18 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
It seems we have managed to bury the necessary details about APEX configuration in the documentation where it isn't easily found. But the missing link is the APEX extensions configuration file, ASHCFG:APEX.CFG, covered under Operations > APEX > APEX Extensions. For the PRTXLS extension, you also need PRTXLS.INI and PRTXLS.SBX, both of which are included in the ATE and A-Shell install packages, and can also be retrieved via UPDCUR.

The $64 question though is how successful PRTXLS will be in translating your existing reports into Excel spreadsheets. The primary requirement is that the reports contained "well behaved" columns, and the primary consideration there is that there be at least 2 blank spaces between each column, or, if there is a set of underlines or dashes separating the column headers from the data, there is at least one blank separating each column. In the example below, we have both (a separator between the column headers and the data with at least one space between each column), and the column data has at least 2 spaces between them. It also helps if there are several rows with consistent column data (which allows PRTXLS to properly set up the Excel column format options.)

[Linked Image]

In your example, you only have one real data row, and those secondary (NOTE) lines are problematic in that there is only one space between the AMOUNT and VAT columns (and also the first 3 columns). You may be above to overcome some of that just by adding a separator row of dashes below the column headers (reducing the column separation requirement from 2 to 1 space), but you're likely to still have problems with mixture of line types.

Typically, the path from printed reports to spreadsheets consists of:
  • Experiment, i.e. try printing your existing reports to PRTXLS
  • To the extent that the results aren't good enough, determine whether minor systematic adjustments (such as adding a separator line between the headers and data) will suffice.
  • If that's not going to be good enough, then what I do is add a secondary CSV output to the existing report (taking advantage of the CSV2XL features). You can then create a wrapper for the PRTXLS extension to switch from the print file being previewed to the corresponding CSV file for Excel output.


That last option is obviously a potentially large and open-ended project, as the give-a-mouse-a-cooking effect will soon creep in as the users get a sense of how much more exciting their reports can become when turned into customized multi-sheet spreadsheets with all kinds of bells and whistles. But that's not necessarily a terrible path to go down. (While it may involve a considerable amount of programming, that may still be more cost effective for the customer in the long run than having their employees individually and repetitively doing the same kinds of things themselves.) In my experience the natural progression ends up with the most-commonly-used reports being output automatically to spreadsheets that are stored in a common network folder, possibly with an email being sent to the most-interested users, so that they all share one set of auto-generated spreadsheets instead of each user creating and maintaining their own spreadsheet kingdom.

Feel free to email me a couple of typical report samples, as it is sometimes the case that a minor tweak to the logic can make PRTXLS work a lot better for a given style of report.

Re: PRTXLS - Example? [Re: Steve - Caliq] #35293 13 Jun 22 03:47 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
After transferring that £34,000,000.67 to Ty's Swiss bank account I thought it would be magic do everything with a press of a button?

You asked all the questions i pretty well asked myself, and really not sure what even the user expects for multi line data and secondary row... In the end I think its going have be looking at them report by report.
But thanks for links and tips and I'll have a play with one report and may just send you an example once i get stuck eek

Re: PRTXLS - Example? [Re: Steve - Caliq] #35294 13 Jun 22 05:07 PM
Joined: Jun 2001
Posts: 3,406
J
Jorge Tavares - UmZero Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 3,406
I tried a transfer in BRL currency, but the numeric mask on the online bank form wasn't prepared for such figure, sorry whistle


Jorge Tavares

UmZero - SoftwareHouse
Brasil/Portugal
Re: PRTXLS - Example? [Re: Steve - Caliq] #35303 16 Jun 22 10:15 AM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Morning...
Thanks for the tips, now working.

Under Windows/Ashell I created a ERSATZ of ASHCFG: pointing it to DSK0:[1,4] and created the following APEX.CFG:
Code
;APEX customization
;BUTTON=prog,icon,tip{,msgno,ini}
;If msgno>0, is expected to be msg 002,### in inifile.lng
BUTTON=SBX:PRTXLS,ashico1::document_out,Export to Excel,38,BAS:PRTXLS.INI
BUTTON=SBX:PXLCFG,ashico1::preferences,Configuration Options For Export,0,BAS:PRTXLS.INI

I already had a PRTXLS.INI and PRTXLS.SBX Version 2.1(217).

So now getting the special Export APEX buttons Jorge has paid his life saving for.

Few tests and the one line by line reports looks well converted.
As we expected the multi list reports do supress certain lines (but what could it doe with them any way to make any real sense)

To set up this for ATE can the INI's and SBX be on the server or do they have be on each ATE clients/local ashell?

Attached Files 2022-06-16_11-11-30.png
Re: PRTXLS - Example? [Re: Steve - Caliq] #35304 16 Jun 22 10:57 AM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Regarding pricing $32/node is it all ashell/ATE users or not at all and not selected individuals.

Re: PRTXLS - Example? [Re: Steve - Caliq] #35310 16 Jun 22 07:22 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
You could put the SBX and INI on the server and add them to your ATSYNC list to sync to the client on startup.

As for the pricing, although we may have wanted to allow selection of the option for individual users, our lawyers have advised us that it would run afoul if not of the equal protection clause of the 14th Amendment to the US Constitution, then probably some more general human rights anti-discrimination principles. Not to mention the negative effect on workplace morale if only certain favored users are given this life-enhancing tool.

Perhaps you can apply for some kind of Brexit framework exemption, but you'd have to take that up with Ty. (And as a practical matter, would require individual licensing of each ATE client rather than server-side site licensing.)

Re: PRTXLS - Example? [Re: Steve - Caliq] #35311 16 Jun 22 07:33 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Thanks, I’ll try sync those files , including the Apex.cfg?

Meanwhile spoke to Ty regarding the pricing and BRL currency payment requirements to yet another Swiss account.

Re: PRTXLS - Example? [Re: Steve - Caliq] #35312 16 Jun 22 08:25 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
Sure, APEX.CFG too.

Re: PRTXLS - Example? [Re: Steve - Caliq] #35319 17 Jun 22 10:55 AM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Im getting there...

I've now changed our login program to transfer the 3 files from the Unix server to the same folders on the local ATE.
(I delete the local apex.cfg if I dont have it enabled in a new INI setting so I can turn on/off the feature)

Code
 17/06/22  SE  4.2(596)     Now Sync's the APEX/Excel export files from the Linux Server
                            to the the Local ATE (if enabled)
                            Set:  APEX ENABLED=Y      in MADSYS.INI under [SYSTEM]
                                  SYNC APEX TO ATE=Y
                            This transfers the following files:
                                  DSK0:APEX.CFG[1,7]
                                  DSK0:PRTXLS.SBX[7,6]
                                  DSK0:PRTXLS.INI[7,6]
                            FUNC.SUB was also changed adding: FN'SYNC'APEX'TO'ATE()


I now have APEX popup and show on printing by setting the following new LPT80.INI printer def on the UNIX server::
Code
DEVICE = AUXLOC:PROMPT(DEFAULT):
PREVIEW=TRUE
APEX=TRUE


Is there a way to remove the Apex: Exit without printing prompt? and set DEVICE=null as my idea is if they choose this printer its solely use is APEX and Export to Excel and then exit so no warning prompt required as it just confuse people.

Re: PRTXLS - Example? [Re: Steve - Caliq] #35320 17 Jun 22 11:19 AM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Actually more testing when I print to LPT80 (config settings above) the APEX does not come up, is there way forcing this no mater what if printed to a certain printer def.
From a program using xcall spool and to LPT80 it does not show APEX but if I print to the LPT80 from the dot prompt it does.

Re: PRTXLS - Example? [Re: Steve - Caliq] #35321 17 Jun 22 12:23 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Steves for the APEX Preview Preferences you could try use ATEREG.SBX and set the On Exit to: Just exit.

Re: PRTXLS - Example? [Re: Steve - Caliq] #35323 17 Jun 22 12:32 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Thats if i could fine the registry settings, eg. SOFTWARE\MicroSabio\JBCT\ATE\Hosts\LinuxServer

Re: PRTXLS - Example? [Re: Steve - Caliq] #35324 17 Jun 22 12:57 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Steve tell Steve to try:
Code
MAP1 STATUS,F,6
MAP1 VALUEDATA,S,256
MAP1 REGKEY,S,256

REGKEY="PVexitOption"   ! 3=Just Exit
XCALL ATEREG,0,STATUS,REGKEY,VALUEDATA
PRINT STATUS;": ";REGKEY;"=";VALUEDATA

REGKEY="PVlaunchOption" ! 0=App Control/On
XCALL ATEREG,0,STATUS,REGKEY,VALUEDATA
PRINT STATUS;": ";REGKEY;"=";VALUEDATA

.
.RUN A
0 : PVexitOption=3
0 : PVlaunchOption=0

Re: PRTXLS - Example? [Re: Steve - Caliq] #35325 17 Jun 22 01:14 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
I think everything is now working...(for now)..

Re: PRTXLS - Example? [Re: Steve - Caliq] #35326 17 Jun 22 02:52 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
With all that back and forth going on inside your head I'm surprised you can get a word in edgewise! laugh

Did you get the direct spooling to APEX working? Your general approach seemed about right to me, and I have something similar working here.

Re: PRTXLS - Example? [Re: Steve - Caliq] #35327 17 Jun 22 02:55 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Yes been very noisy here and that just me working along at home!
Yes not sure what I did (or did not do) but now printing to the LPT80 that I created brings up the APEX all ready for the Export button to be pressed.
LPT80.INI
Code
DEVICE = AUXLOC:PROMPT(DEFAULT):
PREVIEW=TRUE
APEX=TRUE

Re: PRTXLS - Example? [Re: Steve - Caliq] #35330 20 Jun 22 06:59 AM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Im guessing my registry tweak with ATEREG.SBX is window security? and something have no control of, it works for some, not others.
Code
20/06/22 07:25:42 - Error -1005 setting ATE PVexitOption registry key.
20/06/22 07:25:42 - Error -1005 setting ATE PVlaunchOption registry key.
20/06/22 07:48:58 - Error -1005 setting ATE PVexitOption registry key.
20/06/22 07:48:59 - Error -1005 setting ATE PVlaunchOption registry key.
20/06/22 07:49:41 - Error -1005 setting ATE PVexitOption registry key.
20/06/22 07:49:41 - Error -1005 setting ATE PVlaunchOption registry key.
20/06/22 07:49:55 - Error -1005 setting ATE PVexitOption registry key.
20/06/22 07:49:56 - Error -1005 setting ATE PVlaunchOption registry key.
20/06/22 07:50:15 - Error -1005 setting ATE PVexitOption registry key.
20/06/22 07:50:15 - Error -1005 setting ATE PVlaunchOption registry key.
20/06/22 07:51:57 - Error -1005 setting ATE PVexitOption registry key.
20/06/22 07:51:57 - Error -1005 setting ATE PVlaunchOption registry key.
20/06/22 07:55:25 - Error -1005 setting ATE PVexitOption registry key.
20/06/22 07:55:25 - Error -1005 setting ATE PVlaunchOption registry key.
20/06/22 07:55:52 - Error -1005 setting ATE PVexitOption registry key.
20/06/22 07:55:52 - Error -1005 setting ATE PVlaunchOption registry key.

Re: PRTXLS - Example? [Re: Steve - Caliq] #35332 20 Jun 22 01:00 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
(User had to get their admin person to change the ATE Preview Preferences settings manually via Right click ATE and run as administrator) - Pity.

Re: PRTXLS - Example? [Re: Steve - Caliq] #35333 20 Jun 22 03:34 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
Are those settings stored in the HKCU (current user) hive, or the HKLM (all users) hive? If the former, it seems excessive to block the program from updating the settings. After all, that's how the vast majority of the entries in the HKCU hive get created in the first place. But if you have your configurations spanning all users, then it makes sense to require admin privileges. (In which case I would suggest migrating or recreating them for each user, even if that means proliferation of registry entries that could otherwise be shared.)

Re: PRTXLS - Example? [Re: Steve - Caliq] #35335 20 Jun 22 04:57 PM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
OK, As I thought smile Thanks.

Re: PRTXLS - Example? [Re: Steve - Caliq] #35336 20 Jun 22 11:54 PM
Joined: Jun 2001
Posts: 11,794
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,794
Steve - FYI, I just posted a 2.1(218) version of the PRTXLS.SBX module. It won't help the Registry obstacle (above) but does have some improved logic for figuring out the column separation in reports (like the examples you sent me), and also closes a memory corruption loophole. For now, the updated module can be downloaded via the UPDCUR utility (and then ATSYNC'd to the ATE clients). I'll add it to the next builds after a little more field testing.

Re: PRTXLS - Example? [Re: Steve - Caliq] #35337 21 Jun 22 07:52 AM
Joined: Sep 2003
Posts: 4,158
Steve - Caliq Offline OP
Member
OP Offline
Member
Joined: Sep 2003
Posts: 4,158
Thanks Jack, Updated to 2.1(218) and both those reports exported to Excel nicely - I'll update customer and get them to try. Much appreciated.


Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3