ggreen86 / XLSX-Workbook-Class

VFP Class to Create an XLSX Workbook without Excel Automation or Installed
45 stars 16 forks source link

Trying to add an Image via AddImage #82

Open nmossvfp opened 1 year ago

nmossvfp commented 1 year ago

Hello

I am trying to add an image which is a legend to a specific row and column of my spreadsheet. All aspects of creating my Excel using this class are succesful except for the Image add via the AddImage() method.

lcImageFile = "e:\graphics\newreport\legend.jpg" lnWb = 1 THISFORM.vfpxlsx.AddImage(lnWb, 1, lcImageFile, "O",, 3, 0, 30, 0) && Positioned C30 cell

After tracing back to the Parent class I discoverered that _screen.SYSTEM does not exist, always returns "U" and therefore the bailout at RETURN 0

Code below from AddImage() IF !PEMSTATUS(_SCREEN, "System", 5) .OR. VARTYPE(_SCREEN.System) <> "O" RETURN 0 ENDIF

Any advice is appreciated. Thanks

ggreen86 commented 1 year ago

You need to first execute the system.app file for Win32 support.

From: nmossvfp @.> Sent: Sunday, April 2, 2023 10:35 AM To: ggreen86/XLSX-Workbook-Class @.> Cc: Subscribed @.***> Subject: [ggreen86/XLSX-Workbook-Class] Trying to add an Image via AddImage (Issue #82)

Hello

I am trying to add an image which is a legend to a specific row and column of my spreadsheet. All aspects of creating my Excel using this class are succesful except for the Image add via the AddImage() method.

lcImageFile = "e:\graphics\newreport\legend.jpg" lnWb = 1 THISFORM.vfpxlsx.AddImage(lnWb, 1, lcImageFile, "O",, 3, 0, 30, 0) && Positioned C30 cell

After tracing back to the Parent class I discoverered that _screen.SYSTEM does not exist, always returns "U" and therefore the bailout at RETURN 0

Code below from AddImage() IF !PEMSTATUS(_SCREEN, "System", 5) .OR. VARTYPE(_SCREEN.System) <> "O" RETURN 0 ENDIF

Any advice is appreciated. Thanks

— Reply to this email directly, view it on GitHubhttps://github.com/ggreen86/XLSX-Workbook-Class/issues/82, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGWB33LWZAZ4GGCFW7BRUJ3W7GFANANCNFSM6AAAAAAWQK5AAE. You are receiving this because you are subscribed to this thread.Message ID: @.**@.>>

nmossvfp commented 1 year ago

Perfect! Had no idea this was required.

Thank You.