- 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)
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)