|
-
Mar 29th, 2007, 12:56 AM
#1
Thread Starter
Lively Member
VB code to email Crystal report
Hi,
Anyone could help me for VBcode to send Crystal report by email? I have the code to print out the crystal report, but now i need the report can be email directly.
Below is my Print out sample:-
Public Sub ShowSalesInv(ByVal blnPreview As Boolean, ByVal sInvRefNo As String)
Dim SalesInvReport As Report
Dim Db As Database
Dim strTitle As String
Set SalesInvReport = New ICRSalesInv
Set Db = SalesInvReport.Database
SalesInvReport.RecordSelectionFormula = " {tbl_Sales.InvRefNo}='" & sInvRefNo & " '"
If blnPreview = True Then
Set frmCrystalViewer.mRptReport = SalesInvReport
frmCrystalViewer.Caption = strTitle & "Invoice"
frmCrystalViewer.Show 1
Else
SalesInvReport.PrintOut True does any code could replace here for email?
End If
End Sub
Would appreciate for any help. Thanks.
-Ana-
Last edited by anatasia; Mar 29th, 2007 at 03:51 AM.
-
Mar 29th, 2007, 03:52 AM
#2
Re: VB code to email Crystal report
Looks like you may be using the CR Viewer control on your form? If so you can just package the emailing dependancies so the user can just click the export button and select email.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 29th, 2007, 04:09 AM
#3
Thread Starter
Lively Member
Re: VB code to email Crystal report
may i know how and where to get the emailing dependancies file??
-
Mar 29th, 2007, 04:11 AM
#4
Re: VB code to email Crystal report
In the Runtime.hlp help file that is included with CR Developer version. They are on your install of CR. Just so many of them and all are about a total of 20 MBs so you need to pick only what you need.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 29th, 2007, 04:28 AM
#5
Thread Starter
Lively Member
Re: VB code to email Crystal report
did u mean i have to re-install certain file from my CR software?
-
Mar 29th, 2007, 04:33 AM
#6
Re: VB code to email Crystal report
No, what version of CR 8.5 do you have? Is it the developer version? The help file only comes with Developer.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 29th, 2007, 05:11 AM
#7
Thread Starter
Lively Member
Re: VB code to email Crystal report
i'm using Crystal report IX developer version
-
Mar 29th, 2007, 10:42 AM
#8
Re: VB code to email Crystal report
I dont have that version but have you searched on the CR site?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 29th, 2007, 12:33 PM
#9
Re: VB code to email Crystal report
Set all the appropriate ExportOptions and then call the Export method.
Code:
If blnPreview = True Then
Set frmCrystalViewer.mRptReport = SalesInvReport
frmCrystalViewer.Caption = strTitle & "Invoice"
frmCrystalViewer.Show 1
Else
SalesInvReport.ExportOptions.DestinationType= crEDTMicrosoftExchange
SalesInvReport.ExportOptions.MailToList = "....
SalesInvReport.Export
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|