Solved

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

Posted on 2004-10-01
5
314 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now