Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

scheduling an email to deliver a vb created excel file

Status
Not open for further replies.

crogers111

Technical User
Jan 23, 2004
158
US
BOE XI

I use BOE quite a bit to schedule .rpt files but am now looking to schedule an .exe that will create an .xls file to be emailed.

I am not a VB developer but had someone in the office provide me with a simple test .exe file that I have successfully added to BOE using the CMC. It runs and outputs successfully to a path on the network as the code defines the path.

The code is basically as follows which is very simple just for testing purposes:

exportFileName = "//Server1/Reports/Filename_" & Format$(Now, "mmddyyyy") & ".xls"
Open exportFileName For Output As #1

Print #1, "This is a test"

HERE'S WHAT HAPPENS

When I try to schedule & run the above .exe to be emailed in BOE, the .xls IS written to the path defined in the code (which makes sense). An email is generated with all of the content I setup in BOE (email body, email submtect filename etc) but the attachment is a blank .txt file... It's like each proccess is running independently as they both parts do work.

HERE'S WHAT I WANT.

I want to use BOE to schedule the .exe to run (which is working) and deliver the .xls via an email.

in BOE, there is not an option to define the output type (xls, csv etc) as there is when adding an .rpt. Is there a way to have BOE deliver the format of the file that is set in the .exe ? Do I need to add something to VB code so it 'talks' to BOE ? other ?

Thanks in advance.
 
BOE can't do that. It can only send emails with files that were generated through one of the standard BO tools. However, if you're creating the .exe, you could always add a step to email from there. You could pass the email address or list of email addresses into the program as a parameter from BO.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Thanks for info. Scanning thru the help files and settings had me thinking this may not be possible as you mention. I will look into the option you mention.

I currently use BOE's 'specific email recipients' option which requires a 'TO' recipient and allows me to set the email subject, cc, body etc. for mass emailing to different clients with different instances.

I can't picture how having the vb code handle the emailing & pulling the email addresses via BOe parameter will change these other portions of the email.

I'm guessing I will not be able to use the 'specific email repients' option and the VB code will need to handle the email subject, cc & body as well.



 
Yes, the VB code will have to handle everything around the emailing of the reports. However, when you set a program to run in BO, you have an option to pass parameters into it. What I might do is have a "configuration" file for each email that contains the addresses, subject, cc, and body information. You would pass the name of the config file from BO to the program. The program would then read the config file to get all of that information.

Good luck!

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
There are 3rd party tools, which could schedule a report (or even multiple reports), export the result to an excel and e-mail it to a hardcoded or dynamic e-mail address(es). If your data is not formatted you can even retrieve the data and export it without developing a crystal report first.
Check this list for some of the available products: I guess it will be cheaper to use an existing and tested application instead of develop your own from scratch. There are some free options too.

Viewer, scheduler and report manager for Crystal reports and SSRS.
Send your report everywhere.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top