Problems Connecting to Crystal Reports table and changing field values

Michael Dorrian michael.a.dorrian at gmail.com
Thu Aug 23 09:14:21 EDT 2007


Below  is the my code so far. I have one table with 7 fields in my report
and i want to clear these fields and then save the report as a different
name and then print. The saving and printing part seem fine but i cannot
seem to access the connection properties at all. I have the
ConnectionProperties lines commented out because they give an error and
there is no password or user name so thats not the problem it just gives an
error saying connection properties was not recognized function name which it
should be??. Also finally how can i change these field names inside the
"tbl" table below.


import sys
from win32com.client import Dispatch

server="C:\\xxxxxx" #only an example

app = Dispatch('CrystalRunTime.Application')
rep = app.OpenReport('C:\\testers.rpt')
rep.ReadRecords()
tbl = rep.Database.Tables.Item(1)
#prop = tbl.ConnectionProperties('Data Source')
#prop.Value = 'server'

rep.ExportOptions.FormatType = 1
rep.ExportOptions.DestinationType = 1
rep.ExportOptions.DiskFileName = "C:\\Testerss.rpt"
rep.Export(False)
rep.PrintOut(promptUser=False)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070823/e26c1f54/attachment.html>


More information about the Python-list mailing list