Solved

Specifiying the name of a Crystal Report being exported out of a VB project to Email.

Posted on 2004-10-01
5
322 Views
Last Modified: 2012-08-13
I have a VB app Using Crystal 8.5 Developer to run and then export a report to mail addresses. Currently the name of the exported file is a number. How do I specifiy what I want the exported reports file name to be? And is it possible to name it the current date?

                        crptWeeklyBriefing.ExportOptions.DestinationType = crEDTEMailMAPI
                        crptWeeklyBriefing.ExportOptions.MailToList = "MyName@Yahoo.com"
                        crptWeeklyBriefing.ExportOptions.MailSubject = "Daily Briefing Report"
                        crptWeeklyBriefing.ExportOptions.MailMessage = _
                           "Attached please find the Daily Briefing Report. "
                        crptWeeklyBriefing.ExportOptions.FormatType = crEFTPortableDocFormat
                        crptWeeklyBriefing.Export (False)
0
Comment
Question by:DavidNPD
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 13

Expert Comment

by:vidru
ID: 12202297
crptWeeklyBriefing.ExportOptions.DiskFileName = "YourFileName.pdf"

To save it with the date as the file name, make sure that the date is in a valid format for a file name:

crptWeeklyBriefing.ExportOptions.DiskFileName = Format(Date, "MM-DD-YYYY") & ".pdf"

-dave
0
 

Author Comment

by:DavidNPD
ID: 12202472
I put this code in but it doesnt seem to make any difference, no errors but the file comes in the email named "241.pdf" and then the second time i tried 291.pdf.

0
 
LVL 100

Accepted Solution

by:
mlmcc earned 50 total points
ID: 12202556
I believe you will have to actually export it to a disk file then send it through mail.  Crystal doesn't use the diskfilename unless it creates a permanent file.

mlmcc
0
 
LVL 13

Expert Comment

by:vidru
ID: 12202796
Whoops, shoud've tested that first...

As mlmcc stated, that will only work if actually exporting to disk, then attaching the file.

-dave
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 12205870
Glad i could help

mlmcc
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question