activex Crystal Report problem

Just to followup up a bit on my own post.

I tried using the new wxActiveX class, but I am stymied by a similar problem:
Using genaxmodule to generate the wrapper file (which I called
cReports.py), here is the setter method for the item:
    def _set_ReportSource(self, ReportSource):
        self.SetAXProp('ReportSource', ReportSource)

down farther in the file is:

# PROPERTIES
# --------------------
# reportsource
# type:VT_UNKNOWN arg:VT_UNKNOWN canGet:True canSet:True

···

#

Can I set/get something that is of type VT_UNKNOWN?
___________________________________________________________

Now my test panel is as follows:

import wx.activex
import wx

import win32com.client

from cReports import cReports

class CrystalPanel2(wx.Panel):
  def __init__(self, parent):
     wx.Panel.__init__(self, parent, -1)

     sizer = wx.BoxSizer(wx.VERTICAL)

     self.crView = cReports(self)
     print str(self.crView)

     cr = win32com.client.Dispatch("CrystalRuntime.Application")
     report = cr.OpenReport("\\Projects\\inman\\AllergyList.rpt",1)

     print str(report)
     print str(cr)

     self.crView._set_EnableToolbar(1)
     self.crView._set_ReportSource(report)

     self.crView.ViewReport()
     sizer.Add(self.crView, 1, wx.EXPAND)
     self.SetSizer(sizer)
     self.SetAutoLayout(1)
______________

This results in the following error:

<cReports.cReports; proxy of C++ wxActiveXWindow instance at
_100be101_p_wxActiveXWindow>
<COMObject OpenReport>
<COMObject CrystalRuntime.Application>
Traceback (most recent call last):
  File "C:\Projects\inman\MainWindow.py", line 155, in OnItemActivated
    titleString)
  File "C:\Projects\inman\PatientNotebookFrame.py", line 42, in __init__
    panel1 = PatientObservations(self.notebook, self.newBackColor)
  File "C:\Projects\inman\PatientObservations.py", line 243, in __init__
    self.cPanel = CrystalPanel2(self)
  File "C:\Projects\inman\CrystalPanel2.py", line 31, in __init__
    self.crView._set_ReportSource(report)
  File "C:\Projects\inman\cReports.py", line 179, in _set_ReportSource
    self.SetAXProp('ReportSource', ReportSource)
  File "C:\Python23\Lib\site-packages\wx\activex.py", line 313, in SetAXProp
    return _activex.ActiveXWindow_SetAXProp(*args, **kwargs)
TypeError: Unsupported object type in _PyObj2Variant

Any ideas?

Thanks!
Hubert Hickman

Hubert Hickman wrote:

Just to followup up a bit on my own post.

I tried using the new wxActiveX class, but I am stymied by a similar problem:
Using genaxmodule to generate the wrapper file (which I called
cReports.py), here is the setter method for the item:
    def _set_ReportSource(self, ReportSource):
        self.SetAXProp('ReportSource', ReportSource)

down farther in the file is:

# PROPERTIES
# --------------------
# reportsource
# type:VT_UNKNOWN arg:VT_UNKNOWN canGet:True canSet:True
#

Can I set/get something that is of type VT_UNKNOWN?

Not yet. I think that more can be done in the new activex module that would allow it to do more COM things like that, but so far it only handles real basic stuff. If anybody wants to help out with it I would really appreciate it as my COM knowledge is fairly limited.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!