Solved

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

Posted on 2004-10-01
5
323 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 101

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 101

Expert Comment

by:mlmcc
ID: 12205870
Glad i could help

mlmcc
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

726 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