Problems Connecting to Crystal Reports table

Joined
Jun 27, 2007
Messages
7
Reaction score
0
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top