PxPlus User Forum

Twitter Twitter Twitter

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Susan Cryderman

Pages: [1] 2
1
Phil,

The difficulty here is that (I'm assuming) the list or printers needed is variable.  Because of this, the data needed for the drop box needs to be written to a memory file.

I tried the following and it seems to work (although I have not coded a Printer_Validate method).

1) Edited the _fm_panel_iol$ hidden variable in the html file to include printer$
2) Included the following code for the printer drop box:

 [row "*\[show usefile field=printer$\]:"][list printer$ size=20 event=Printer_Validate program=c:\webster\prog\tools][/list][/row]<br>

3) Coded the c:\webster\prog/tools program to load a memory file as follows:

 ! tools - load printer list
 !
  ENTER fileno
 !
  OPEN (HFN)"*memory*"
  fileno=LFO
 !
  printer_list$="Printer A/Printer B/Printer C/"
  FOR val$ FROM printer_list$
  WRITE (fileno,KEY=val$)
  NEXT
 !
  EXIT 

You would need to edit your Printer_List method accordingly.

Hope this helps!

2
Phil,

Just for clarification - you may NOT want to use the File Maintenance Generator method for adding the hidden variable as this would over-write the previous edits you made to the html file.

3
Hi Phil,

If I'm understanding this correctly - printer$ is the element in the data file being maintained and printerList$ is the delimited list of available printers (that is not an element in the data file).

I have not tried this - but it sounds like you might need to add a Hidden Variable to the form.  You can do this by adding a line using the [hide] short code to the generated html page that looks something like:

[hide printerList$ value=""]

 - or -

If you are running PxPlus 2022 or later, you should be able to also do this from within the File Maintenance Generator.  Press the Hidden Variables button on Step 6 and add an Additional Variable of printerList$.
 

4
Nomads / Re: Copying a Panel
« on: January 18, 2024, 10:39:05 AM »
I believe the only difference is that the "OK" button leaves the Copy Screen Objects dialog while the "Apply" button leaves you in the dialog,

5
Programming / Re: From It run program - debug window too short
« on: January 08, 2024, 11:18:17 AM »
We are having some difficulty determining the exact window you are referring to.
 
Could you perhaps detail the exact steps you follow to display the window or, better yet, attach a screen shot of the the window that is too short?   

Thanks!

6
Programming / Re: DEF OBJECT WORD
« on: November 06, 2023, 09:53:39 AM »
Not sure if this will help - but in PxPlus 2017 we added a PxPlus Word Object to simplify interactions with Word.  It may make translating your existing code easier.

You should be able to see the documentation for this object at the link below:

https://manual.pvxplus.com/PXPLUS/PxPlus%20User%20Guide/External%20Components/PxPlus%20COM%20Support/Word%20Object.htm

7
Programming / Re: Create/Update Excel Workbook
« on: June 20, 2023, 03:03:22 PM »
Tom,

The PxPlus Excel object will look for Excel locally on the machine that instantiates the object (X_OBJ=new(*obj/excel).  If you run the program on a workstation, that workstation will need to have Excel installed.  If the program is run on the server - only the server should need to have Excel installed.  However, the excel file created would also be on the server.

There may be ways around this if you do not use the PxPlus Excel Object.

8
Programming / Re: Create/Update Excel Workbook
« on: June 09, 2023, 11:59:36 AM »
Tom,

It appears that writing the data using WindX may be the issue.  Please open a support ticket and be sure to provide the version and serial number.


9
Programming / Re: Create/Update Excel Workbook
« on: June 09, 2023, 11:09:26 AM »
Tom,

You can print TCB(29) to see what version is installed.  Version 16 should show 16000000 and 16.2 should show 16200000.

Just to clarify - were you still using WindX when it worked using verison 20?

Thanks,

10
Programming / Re: Create/Update Excel Workbook
« on: June 08, 2023, 05:21:10 PM »
Hi Tom,

I have had some co-workers try your program as well.  It worked fine in all cases.

It might also be a problem with the SEP separator.  The current separator can be checked by printing X_OBJ'SEP$ after instantiating the X_OBJ object.

Setting X_OBJ'VISIBLE = 1 shows the Excel application and might help to see what it looks like immediately after the WRITE function is completed.

Version 16 is no longer supported.  If the issue is still unresolved, you could download a newer version and retry your program using a demo activation.  Assuming the issue still occurs, you could then open a support ticket.  We would be interested in screen shots of the program as well as the results in excel etc.


11
Programming / Re: Create/Update Excel Workbook
« on: June 07, 2023, 11:14:04 AM »
Hi Tom,

I tried this with our current version and with PxPlus 2019 (version 16) of the excel object and it works fine for me.

When the workbook is created - it will use the excel default template.  Is it possible this has some sort of formatting already there for these cells?

12
Programming / Re: Create/Update Excel Workbook
« on: June 06, 2023, 04:16:46 PM »
If you are using PxPlus 2017 or newer - you can use the PxPlus Excel Object.

 ! demo program for Pxlus Excel Object
 ! retval can be checked after each command to ensure there were no errors
 !
  x_obj=NEW("*obj/excel") ! instantiate the object
 !
  path$="c:\spreadsheets\workbook_name.xlsx"
  retval=x_obj'CreateWorkbook(path$,1) ! 2nd parameter overwrites workbook_name.xlsx if it exits
  retval=x_obj'SetWorksheet(1) ! set active worksheet to 1 (not really neede - should already be 1 after creating the workbook
 !
  retVal=x_obj'write("value for cell C2","C2") ! ! Write a value to cell C2 in active worksheet
 !
  retval=x_obj'SetRange("A3:E3") ! set range to 5 cells in row 3
  new_range$="one"+SEP+"two"+SEP+"three"+SEP+"*four"+SEP+"five"+SEP
  retVal=x_obj'write(new_range$) ! write data to current range
 !
  retVal=x_obj'SaveWorkbook()
  retVal=x_obj'CloseWorkbook()
  DROP OBJECT x_obj
  END

13
Nomads / Re: Stretchable Embedded Panel
« on: November 07, 2022, 10:02:47 AM »
Hi Ron,

I tried creating an embedded panel with a rectangle shape control 2 lines high.  It did not work correctly when the embedded panel height was defined as 3 - but did work when the embedded panel was made higher (14 high).  Only the rectangle is embedded - but the height/width ratio is used when trying to compute  how to stretch the controls.

Hope this helps

14
Language / Re: Excel, .COM, and OneDrive
« on: June 02, 2022, 09:10:01 AM »
James,

I tried this again when I had book1.xlsx already opened in Excel and the x'CreateWorkbook("",1) did fail. 

Checking x'ERROR'Message$ returns the message Can not access 'Book1.xlsx'.


Susan

15
Language / Re: Excel, .COM, and OneDrive
« on: May 30, 2022, 09:19:10 AM »
James,

Perhaps this is unrelated to the update ...

Is it possible that the default Book1.xlsx file already exits and was opened or in use elsewhere?  The CreateWorkbook method  attempts to add a workbook and then tries to save it with the supplied path.  If no path is supplied, it will try to save it with the default path and may fail.  It may be easier to supply a path name - but you can also call the Create Workbook method with a second parameter - a flag telling the object to always overwrite the existing file (in this case Book1.xlsx).   

return_value=x'CreateWorkbook("",1)

Pages: [1] 2