Excel + WebGadget

Everything else that doesn't fall into one of the other PB categories.
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Excel + WebGadget

Post by Marco2007 »

Hi,

I have following small code:

Code: Select all

excelfile1.s="Mappe1.xls"
excelfile2.s="Mappe2.xls"

If OpenWindow(0, 220, 0, 600, 400, "Test",  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
  WebGadget(0, 35, 30, 525, 150, excelfile2)
  WebGadget(1, 35, 215, 525, 150, excelfile1)
EndIf

Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
Does anyone know, why the design of those "embedded Excel-files" doesn`t look like the same?
Image
Win7 Sp1 + Office2007

thx
PureBasic for Windows
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Excel + WebGadget

Post by IdeasVacuum »

Perhaps the xls files are defined by different versions of Excel (even slightly different)? Perhaps one of those versions does not create the file format a 100% compatible with HTML/Javascript (or which ever method Microsoft uses)?

Could you upload the sample files?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Re: Excel + WebGadget

Post by Marco2007 »

It`s the same empty Excel-file...just copied the first and renamed the second.
Just try it with two empty Excel-Files...
PureBasic for Windows
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Excel + WebGadget

Post by IdeasVacuum »

You are right - seems to be some sort of Gadget or Window re-draw issue, if you add a Delay between the creation of the Web Gadgets, you can see that the first WebGadget() is drawn correctly, then 'corrupted' during the drawing of the second WebGadget(). SetGadgetState() does not cure this conflict - for example, SetGadgetState(2,#PB_Web_Refresh) seems to re-draw the first WebGadget() and the second is then not displayed correctly. Apply SetGadget() to both, neither is displayed correctly:

Code: Select all

excelfile1.s="C:\Book1.xls"
excelfile2.s="C:\Book2.xls"

If OpenWindow(0, 220, 0, 600, 400, "Test",  #PB_Window_SystemMenu | #PB_Window_TitleBar )
       WebGadget(1, 35, 30, 525, 150, excelfile1)
  SetGadgetState(1,#PB_Web_Refresh)
           Delay(1000)
       WebGadget(2, 35, 215, 525, 150, excelfile2)
  SetGadgetState(2,#PB_Web_Refresh)
EndIf

Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
Switching to the Mozilla ActiveX makes no difference either. If only one WebGadget is displayed, it always works fine. If you run the two-gadget version multiple times, both Web Gadgets then fail to display correctly.

Edit: Ah, just tried again, this time with both xls files containing field values and the files not being identical. Click on a field in Web Gadget 1, the value pops-up in the edit field of Web Gadget 2! :cry:
So, not simply a re-draw issue, I think it may be to do with how the fields are identified on a web page - perhaps this is a Microsoft issue rather than a PB issue.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply