Getting started with Crystal Reports...little help in the far court.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mudcat

    Getting started with Crystal Reports...little help in the far court.

    I am not that familiar with Crystal Reports, but having read some other
    posts I know that the way to integrate the API with Python is through
    the COM interface provide by win32all.

    However, I have been unable to find any other information on how to get
    started. I've used the COM interface before in integrating Excel and a
    couple of other things. So I am familiar with how that works. But there
    are at least 40 options dealing with Crystal and Business Objects. I
    have no idea which makepy file to create or which one provides the
    functionality I need.

    I'm not looking to do much. All I'm really trying to do is provide one
    application where a list of crystal reports can be selected and ran in
    series. Right now we have a lot of reports that all have to be run
    manually (takes a while). So I think all I need api access to is server
    selection, parameter selection, and output formats.

    Any pointers in the right direction would be helpful.

    Thanks,
    Marc

  • Amaury Forgeot d'Arc

    #2
    Re: Getting started with Crystal Reports...littl e help in the farcourt.

    Good evening,

    Mudcat a écrit :
    I am not that familiar with Crystal Reports, but having read some other
    posts I know that the way to integrate the API with Python is through
    the COM interface provide by win32all.
    >
    However, I have been unable to find any other information on how to get
    started. I've used the COM interface before in integrating Excel and a
    couple of other things. So I am familiar with how that works. But there
    are at least 40 options dealing with Crystal and Business Objects. I
    have no idea which makepy file to create or which one provides the
    functionality I need.
    >
    I'm not looking to do much. All I'm really trying to do is provide one
    application where a list of crystal reports can be selected and ran in
    series. Right now we have a lot of reports that all have to be run
    manually (takes a while). So I think all I need api access to is server
    selection, parameter selection, and output formats.
    >
    Any pointers in the right direction would be helpful.

    In my previous job we had to to almost the same thing.
    If I remember correctly, for batch printing or file export it was enough
    to start with the "CrystalRuntime .Application" class.

    It was something along these lines (sorry I don't have any way to test
    it now.):
    app = win32com.client .dynamic.Dispat ch("CrystalRunt ime.Application ")
    report = app.OpenReport( "c:/path/to/file.rpt")
    for table in report.Database .Tables:
    table.Connectio nInfo.Password = "passwd"
    ...
    The rest is modeled after Visual Basic. There are tons of examples on
    the net.

    If you want to show the report on the screen then it is another story.
    I only remember the following:
    - the application must be a mfc application
    - I had to "makepy" a class. I think it was "CrystalReports Viewer".
    - create a class derived from both pywin.mfc.activ ex.Control and
    CrViewer (look at the script generated by makepy).
    - create a pywin.mfc.Frame , and put there an instance of the previous class.

    Voilà, it's not much.
    In the hope that you can do something with it.
    But don't give up. At the end, it works...

    --
    Amaury

    Comment

    • Brian

      #3
      Re: Getting started with Crystal Reports...littl e help in the far court.

      Mudcat wrote:
      I am not that familiar with Crystal Reports, but having read some other
      posts I know that the way to integrate the API with Python is through
      the COM interface provide by win32all.
      .....
      Any pointers in the right direction would be helpful.
      Like Armury, I worked on Crystal stuff quite a long time ago. Here's a
      script I was able to dig up. Edited to protect the innocent. ;-)

      import sys
      from win32com.client import Dispatch

      app = Dispatch('Cryst alRunTime.Appli cation')
      rep = app.OpenReport( 'foo.rpt')
      tbl = rep.Database.Ta bles.Item(1)

      prop = tbl.ConnectionP roperties('Pass word')
      prop.Value = sys.argv[1]

      prop = tbl.ConnectionP roperties('Data Source')
      prop.Value = 'server'

      # tbl.TestConnect ivity() should return 1

      # clear and set 3 parameters
      params = rep.ParameterFi elds
      p1 = params(1)
      p2 = params(2)
      p3 = params(3)

      for param in (p1,p2,p3): param.ClearCurr entValueAndRang e()

      p1.AddCurrentVa lue(123)
      p2.AddCurrentVa lue(456)
      p3.AddCurrentVa lue('12/31/99')

      rep.PrintOut(pr omptUser=False)

      Comment

      • Carl Trachte

        #4
        Re: Getting started with Crystal Reports...littl e help in the far court.

        Marc,

        I've been able to get some Business Objects COM functionality in
        Business Objects 6.5 (the logging in functionality I have to do through a
        call to an Excel VBA macro; otherwise things appear to work for what I'm
        doing).

        Unfortunately, I don't have experience with Python in Business Objects
        XI or Crystal Reports. I did have to play with makepy on a couple Business
        Objects files to get something useful. I believe I eventually struck
        paydirt with busobj.exe (but don't quote me on it - it's been a while).

        This information probably isn't terribly useful. The best advice I can
        give is to try the respective Crystal Reports and Business Objects XI
        executable files with makepy. If there's no joy there, start working with
        the dll's and see if they yield something that works.

        Hopefully someone with a bit more win32 or BO XI experience will chime
        in. In the meantime, good luck.

        Carl T.

        "Mudcat" <mnations@gmail .comwrote in message
        news:1168293388 .349793.256790@ s80g2000cwa.goo glegroups.com.. .
        I am not that familiar with Crystal Reports, but having read some other
        posts I know that the way to integrate the API with Python is through
        the COM interface provide by win32all.
        >
        However, I have been unable to find any other information on how to get
        started. I've used the COM interface before in integrating Excel and a
        couple of other things. So I am familiar with how that works. But there
        are at least 40 options dealing with Crystal and Business Objects. I
        have no idea which makepy file to create or which one provides the
        functionality I need.
        >
        I'm not looking to do much. All I'm really trying to do is provide one
        application where a list of crystal reports can be selected and ran in
        series. Right now we have a lot of reports that all have to be run
        manually (takes a while). So I think all I need api access to is server
        selection, parameter selection, and output formats.
        >
        Any pointers in the right direction would be helpful.
        >
        Thanks,
        Marc
        >

        Comment

        Working...