PauloMongo
Programmer
Hi,
I am looking at running a report and then exporting this out to email, the exporting I have working but can not get the report to refresh. Sorry I am new to this, but please advise what events are needed for this to happen. Here is what I have so far.
'declare the application and report
Dim crxApplication As New CRAXDDRT.Application
Public report As New CRAXDDRT.report
Private Sub CmdClose_Click()
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Are you sure you wish to exit ?" ' Define message.
Style = vbYesNo + vbCritical + vbDefaultButton2 ' Define buttons.
Title = "Exit Export" ' Define title.
Help = "DEMO.HLP" ' Define Help file.
Ctxt = 1000 ' Define topic
' context.
' Display message.
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then ' User chose Yes.
Unload Me ' Perform some action.
End If
'Unload Me
End Sub
Private Sub CmdExport_Click()
report
For i = 1 To report.Database.Tables.Count
report.Database.Tables(i).SetLogOnInfo _
"Commercial Live", "", "sysprogress", "sysprogress"
Next i
With report.ExportOptions
.DestinationType = crEDTEMailMAPI
.FormatType = crEFTExcel80
.MailToList = "p.valentine@uk.intrum.com"
.MailSubject = "This is a test to see how good I am"
.MailMessage = "bunting, you are my bitch"
.DiskFileName = App.Path & "\Exportrpt.xls"
End With
report.Export False
'CRViewer1.ReportSource = report
'CRViewer1.ViewReport
End Sub
Private Sub Form_Load()
Set report = crxApplication.OpenReport(App.Path & "\exportrpt.rpt"
'Screen.MousePointer = vbHourglass
'Screen.MousePointer = vbDefault
End Sub
I am looking at running a report and then exporting this out to email, the exporting I have working but can not get the report to refresh. Sorry I am new to this, but please advise what events are needed for this to happen. Here is what I have so far.
'declare the application and report
Dim crxApplication As New CRAXDDRT.Application
Public report As New CRAXDDRT.report
Private Sub CmdClose_Click()
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Are you sure you wish to exit ?" ' Define message.
Style = vbYesNo + vbCritical + vbDefaultButton2 ' Define buttons.
Title = "Exit Export" ' Define title.
Help = "DEMO.HLP" ' Define Help file.
Ctxt = 1000 ' Define topic
' context.
' Display message.
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then ' User chose Yes.
Unload Me ' Perform some action.
End If
'Unload Me
End Sub
Private Sub CmdExport_Click()
report
For i = 1 To report.Database.Tables.Count
report.Database.Tables(i).SetLogOnInfo _
"Commercial Live", "", "sysprogress", "sysprogress"
Next i
With report.ExportOptions
.DestinationType = crEDTEMailMAPI
.FormatType = crEFTExcel80
.MailToList = "p.valentine@uk.intrum.com"
.MailSubject = "This is a test to see how good I am"
.MailMessage = "bunting, you are my bitch"
.DiskFileName = App.Path & "\Exportrpt.xls"
End With
report.Export False
'CRViewer1.ReportSource = report
'CRViewer1.ViewReport
End Sub
Private Sub Form_Load()
Set report = crxApplication.OpenReport(App.Path & "\exportrpt.rpt"
'Screen.MousePointer = vbHourglass
'Screen.MousePointer = vbDefault
End Sub