Emailing report through CMS (ScheduleToSMTP) - Need Multi-format support

Hi All,
I have implemented the ScheduleToSMTP method for sending my crystal report as an email attachment to the users. This has been done as described in the below link(s):
http://devlibrary.businessobjects.com/businessobjectsxi/en/en/BOE_SDK/boesdk_dotNet_doc/doc/boesdk_net_doc/html/NETHowTos92.html
http://devlibrary.businessobjects.com/businessobjectsxi/en/en/BOE_SDK/boesdk_dotNet_doc/doc/boesdk_net_doc/html/NETHowTos95.html
Now, I would like to know if it is possible to have the report attached in two formats (PDF and Excel) in a single email while emailing it by the above method.
Also, I would like to understand if I can add any additional attachments (an image maybe) to this email that goes out through the CMS.
I am new to the Crystal SDK and will appreciate if the response is a little descriptive.
Thanks in advance for the help!
Regards
Ankit

I'm not sure if the below approach will work for you, but in a nut shell, you'd export the report to disk, then  mail the exported report as an attachment. I have done this with a single attachment when I was fooling around with this couple of years ago, not sure if it will work with multiple attachments... Some think to keep in mind too; the reports can get quite large. A report larger then 5 megs is nothing out of the ordinary, so emailing the rpt may be an issue from that perspective. Anyhow, here is the code to attach a file to email:
Visual Basic Example (C## is also provided below)
'Add the following namespaces
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System.IO
' Code for exporting the report to PDF and
' attaching the exported file to an email.
Dim crExportOptions As ExportOptions
Dim crDiskFileDestinationOptions As
DiskFileDestinationOptions
Dim ExportPath As String
' Create an instance of the Report
Dim oRpt As New NameOfYourReport()
' Or open a report file
Dim oRpt1 As New ReportDocument()
oRpt1.Load(Request.PhysicalApplicationPath +
"\YourReport.rpt";,
OpenReportMethod.OpenReportByTempCopy)
' Create the directory path if it does not already
' exist
ExportPath = Request.PhysicalApplicationPath +
"Exported\"
If Directory.Exists(ExportPath) = False Then
Directory.CreateDirectory(Request.PhysicalApplicatio
nPath + "Exported\")
End If
Dim fname As String
fname = ExportPath + "Portabledoc.pdf";
' Set the path for the exported report
crDiskFileDestinationOptions = New
DiskFileDestinationOptions()
crDiskFileDestinationOptions.DiskFileName = fname
' Set the options to export the report to PDF format
crExportOptions = oRpt.ExportOptions
With crExportOptions
.DestinationOptions =
crDiskFileDestinationOptions
.ExportDestinationType =
ExportDestinationType.DiskFile
.ExportFormatType =
ExportFormatType.PortableDocFormat
End With
' Export the report
oRpt.Export()
Response.Write("report exported to: " & fname)
' Create a new mail attachment and add the
' exported report
Dim att As New Mail.MailAttachment((fname))
Dim oMsg As New System.Web.Mail.MailMessage()
oMsg.Attachments.Add(att)
' Set the To, From, And subject for the email
oMsg.To = "someonesemail at email.com"; // the system will not let me use real email
oMsg.From = "myemail at mail.com "
oMsg.Subject = "You have been sent a Crystal Report"
' Connect to the server and send the message
' For example this is the Hotmail smtp Server("")
Mail.SmtpMail.SmtpServer =
"lyris01.hosting.innerhost.com";
System.Web.Mail.SmtpMail.Send(oMsg)
Response.Write("<br>")
Response.Write("Message sent to: " &
oMsg.To.ToString)
' Delete the exported report file
File.Delete(fname)
C# Example
// Add the following namespaces
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System.IO;
// Code for exporting the report to PDF and
// attaching the exported file to an email
ExportOptions crExportOptions;
DiskFileDestinationOptions
crDiskFileDestinationOptions;
String ExportPath;
// Create an instance of the Report
NameOfYourReport oRpt = new NameOfYourReport();
// Or open a report file
ReportDocument oRpt1 = new ReportDocument();
oRpt1.Load(Request.PhysicalApplicationPath +
YourReport.rpt";,
OpenReportMethod.OpenReportByTempCopy);
// Create the directory path if it does not
// already exist
ExportPath = Request.PhysicalApplicationPath +
"Exported
if (Directory.Exists(ExportPath) == false)
Directory.CreateDirectory(Request.PhysicalApplicat
ionPath + "Exported
String fname;
fname = ExportPath + "Portabledoc.pdf";;
// Set the path for the exported report
crDiskFileDestinationOptions = new
DiskFileDestinationOptions();
crDiskFileDestinationOptions.DiskFileName = fname;
// Set the options to export the report to PDF
// format
crExportOptions = oRpt.ExportOptions;
crExportOptions.DestinationOptions =
crDiskFileDestinationOptions;
crExportOptions.ExportDestinationType =
ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType =
ExportFormatType.PortableDocFormat;
// Export the report
oRpt.Export();
Response.Write("report exported to: " + fname);
// Create a new mail attachment and add the
// exported report
System.Web.Mail.MailAttachment att = new
System.Web.Mail.MailAttachment((fname));
System.Web.Mail.MailMessage oMsg = new
System.Web.Mail.MailMessage();
oMsg.Attachments.Add(att);
// Set the To, From, And subject for the email
oMsg.To = "someonesemail at email.com";;
oMsg.From = "myemail at email.com ";
oMsg.Subject = "You have been sent a Crystal
Report";
// Connect to the server and send the message
// For example this is the Hotmail smtp Server("")
System.Web.Mail.SmtpMail.SmtpServer =
"lyris01.hosting.innerhost.com";;
System.Web.Mail.SmtpMail.Send(oMsg);
Response.Write("<br>");
Response.Write("Message sent to: " +
oMsg.To.ToString());
// Delete the exported report file
File.Delete(fname);
Ludek
Edited by: Ludek Uher on Nov 4, 2008 8:11 AM

Similar Messages

  • IPad needs multi user support NOW

    I believe Apple will sell more iPad if they enable multi user support for these devices.
    Since it's currently a single user device tied to your iTune and MobileMe/Exchange, it's not something you could share between family. I thought buying an extra iPad for the wife would solve the problem, but I was wrong. Now we have two iPads, it's still not working out very well. We'd leave them in different places of the house, and we'd still grab the nearest iPad regardless who it belongs to.
    Had Apple made the iPad multi user, I would more likely to buy one or two more. One for the kitchen, one for the living room, one for the family room and one for the master bathroom. That would make life so much easier as I don't have to take my iPad with me. I could pick one up wherever I am.
    Now without multi user support, I'd have to buy a total of 8 iPads and my house would look ridicules with two ipads in each room. Suppose if I have a few teenage kids in the house, I'd have to buy 16 or 20 iPads. That's just mad!
    So instead, I wait. For now I'll just have to cope with 2 iPads, one of which configured for the wife. 50% of the time, I use an iPad with my wife's emails, music and books on it.

    Tell Apple - http://apple.com/feedback. We're just users like you.
    It seems so far that Apple has had absolutely no problem selling iPads at this point.

  • Is it possible to send the Pdf format of WebI linking report through email?

    Hi All,
    I have created linking between 2 WebI reports through OpenDocument. I can schedule the parent report and send it to User Email as PDF format, But when the user click the link in parent report its not opening the PDF format of child report after passing the parameter from Parent report. It throws following error.
    Is it possible to send the linked reports(without breaking the functionality of passing the parameter to Child report) to user who don't have access to BO environment? Please help me out.
    User needs to get the Parent PDF report in email, once they click the link it should pass the parameter to child report and the corresponding child report should open in PDF format. (In Infoview "View Mode" i can able to achieve this, how about in Email?).
    Thanks and Regards,
    Tharini Prabhu

    So to achieve my requirement, according to my understanding I have to do the following steps.
    Please correct me if I am wrong.
    1.     Without BO credentials the user can’t able to access the Link and child report created using OpenDoc.
    2. To overcome this I have to create one reserved userid through Admin and assign to all set of Users who will use the Reports.
    3. Have to use Single Sign on function through SDK to avoid the popping window for entering credentials right ?
    I can’t able to find the Sap Note 1326701 in http://www.sapossnotes.com/
    Could you please provide me the details how to implement that?

  • Sending email with HTML report through a button

    Hi,
    I've noticed in APEX 4 there is a default option (through Action Menu -> Download Formats: email) to send an email with report in HTML format...
    may I know how to accomplish it using a Button... seems like APEX is using javascript:gReport.email.show(); function to accomplish it but I don't know how to implement it...
    Please advice
    Thanks in advance

    qwe12654 wrote:
    GokhanAtil,
    I've posted a sample on APEX.ORACLE.COM... LOGIN DETAILS ARE SAME AS ABOVE...
    ON the page now I have both the SQL based report and interactive report...
    On the top right you may see 2 icons.. one for downloading report in PDF (using SQL Report as the source) and the second for sending email (using interactive report, similar logic as what you've recommended)...
    Is there a way I may be able to send report via email, using SQL report as the source (rather than interactive report)...?
    You can always use APEX_MAIL to send emails.
    http://download.oracle.com/docs/cd/E10513_01/doc/apirefs.310/e12855/apex_mail.htm
    or the alternative option would be:
    to convert all my SQL reports into interactive, would require a bit of efforts (I'll go with it if the above option is not available)... but would need to know how to download INTERACTIVE reports in PDF, excel and CSV formats using a button ... similar logic to what you've done for sending emails
    Thanks again for all your assistanceIt's very easy to make buttons for downloading the interactive reports in HTML, CSV or PDF.
    I have created a PDF button and put the link:
    http://apex.oracle.com/pls/apex/f?p=40418:11:1316531694094700:PDF
    "1316531694094700" is the value of p_instance. You can find it from HTML codes of your page:
    <input type="hidden" name="p_instance" value="1316531694094700" id="pInstance">
    You can change PDF to CSV or HTMLD (so your visitor download the report in CSV or HTML)
    Best Regards,
    Gokhan
    If this question is answered, please mark appropriate posts as correct/helpful and the thread as closed. Thanks

  • Scheduling Report through InfoView - Destination Email

    My question pertains to InfoView in Crystal Report Server 2008.  I am trying to set up a scheduled report to run once, and be emailed as a pdf to my own email address.  I am using the administrator account and can successfully do this through the CMC, but when I try to schedule the report through InfoView, the destination always reverts back to the Inbox destination rather than the email destination.  The job has a successful status, but the destination is always the Inbox.
    I am fairly confident my job servers are set up with the proper SMTP information since I am successful when trying this through the CMC and I am setting everything the same through InfoView. 
    Any ideas?

    Hello,
    This is Crystal Report Server 2008 and I guess Business Objects Enterprise 3.0.  
    When scheduling a report through InfoView I do the following:
    Recurrence - Now
    Format - I choose PDF, although it doesn't really matter for the problem I am having.  
    Destination - I choose email from the dropdown, there is no checkbox to ignore the defaults.  I have to input my own information.  I populate the From, To, and Subject boxes.  I also choose to have an attachment sent.  
    I click the Schedule button and I am taken to the History window.  The job has a status of Running.  I choose refresh and the job completes with a status of Success.  However, when I click the status and the Instance Details are shown, the external destination line reads as Inbox and no email is delivered.  The report is delivered to the InfoView user's inbox, but not in an email as I selected.  
    This process works when performed through the CMC, but not through InfoView.
    Edited by: vtrujillo on Oct 8, 2009 5:13 PM

  • ERROR WHILE SENDING REPORT THROUGH EMAIL .....

    DEAR ALL
    i have one problem . i am trying to send my report through e-mail.i am working with forms 5.0 and report 3.0 . i am calling report from form.when a client click on the button a report will be generated and this will be send to a specific person in a specific format either in html or pdf.
    but when i click on button it initialize the report and gives the error
    rep-4201 : error occured while initialize the mail subsystem.
    rep-4220 : there is a problem with the mail subsystem.
    if anyone of u have the solution for this please send to me.it will be very much helpfull if you send me the code.
    thanks in adv.
    D prasad.
    null

    well you will have to configure a default mail client on your machine. you can do this by going to control panel->mail in windows os.
    you might also need a .dll file mapi*.dll something. you will need this .dll file in your client machine.
    best of luck

  • Sending Early Watch Alert Report through Email

    Hi All,
    For sending the Early Watch Alert Report through Email, I have completed the configuration. After adding the desired Email Address in Path Solution_manager-->goto--
    > Automatic Email Transmission, do i need to create a Zjob in SCOT T-code or this is sufficient.
    waiting for ur quick responses.
    Regards,
    Prashant.

    Dear
    You have to make sure your mailing of SCOT is being sent out.
    Regular SCOT job for mailing is sufficient, it does not require additional one (INT option).
    Kind regards
    Tom
    Edited by: Tom on Sep 4, 2008 9:44 AM

  • What is the way to send a report through email?

    Dear all
    i am working with report3.0. i want to send the report through email.will aneyone plese tell me what are the steps needed to do this.
    report is already generated.but when i am clicking on mail option it gives error
    rep-4201 : error occured while initialize the mail subsystem.
    rep-4220 : there is a problem with the mail subsystem.
    thanks in adv.
    dp
    null

    hello,
    i would try DESTYPE=MAIL and the DESNAME would be the receipient.
    but be aware that on windows the desname must be a valid entry in the addressbook of your mail client (restriction of some MAPI clients)
    regards,
    the oracle reports team

  • Hello All. I am working on a form, but I need to format the leading in a multi-line text-field.

    Hello All. I am working on a form, but I need to format the leading in a multi-line text-field. The options for the text-field only show a font size option, but no other styling options. Is there a way to format the leading? Thanks!

    Not within ID, and I'm not sure it can be done in Acrobat afterward either.

  • I receive both My husbands emails and mine through my ipad. We both have gmail accounts.  His emails are coming down on the ipad but not mine.  I haven't received mail since Saturday and as we use the email for business I desperately need it.

    I receive both My husbands emails and mine through my ipad. We both have gmail accounts.  His emails are coming down on the ipad but not mine.  I haven't received mail since Saturday. We use the email for business I desperately need it and I don't have a laptop anymore as it is broken.   In my wisdom I desired to buy an ipad instead,  what a mistake.

    The iPad will support multiple Gmail accounts, but of course you have to set each one up individually.  Did you set up both accounts?  Go into Settings/ Mail, Contacts, Calendars to confirm both accounts exist.  If they do, also familiarize yourself on how to navigate between accounts to make sure you can view your Inbox.  You may also want to check your settings to make sure that you have the default account set up as you expect for Mail, Contacts, Calendar, and Notes (if you're using all those features).  That is important only when initiating something new, you have to have a default account to do such a thing so make sure the default is your account since it is your iPad (assuming that's what you want).
    Alternatively, install the free Gmail app and then use only his (or your) account with that app and use the standard iOS Mail app for the other account.

  • Email a Report through Report Parameter

    Hi
    I want to email a report through MAPI. There is Mail Parameter available in Destination Type list but when I run report after giving this Mail Parameter then message "Mail Sub System Initialization error" comes.
    Pl help me out.
    Thanks & Regards
    Preeti

    I have same problem. Can you send me the solution if you are solved. Here's my mail -ID : [email protected]

  • My problem is trying to restore my iphone 4s. The icloud password is from a defunct email account through an ISP that I no longer use. I have upgraded to an iphone5s . I want to give the iphone4s to a special needs child that can make good use of it.

    My problem is trying to restore my iphone 4s. The icloud password is from a defunct email account through an ISP that I no longer use. I have upgraded to an iphone5s . I want to give the iphone4s to a special needs child that can make good use of it.I am at the point of despair. I can prove where I got the 4s etc. which seems to be a requirement from postings on forums. IT IS BREAKING THIS KIDS HEART AND BREAKING MINE. PLEASE SOMEONE HELP !!

    Welcome to the Apple community.
    This feature has been introduced to make stolen phones useless to those that have stolen them.
    However it can also arise when the user has changed their Apple ID details with Apple and not made the same changes to their iCloud account/Find My Phone on their device before upgrading to iOS 7, or if you restore from a previous back up made before you changed your details.
    The only solution is to change your Apple ID back to its previous state with Apple at My Apple ID, verify the changes, enter the password as requested on your device and then turn off "find my phone".
    You should then change your Apple ID back to its current state, verify it once again, delete the iCloud account from your device and then log back in using your current Apple ID. Finally, turn "find my phone" back on once again.
    This article provides more information about Activation Lock.

  • Need RG23APART1 report through Item Group Wise

    Hi All..
    The scenario is In the XL reporter add RG23A PART 1 report is only date and Location wise but i need the report through ItemGroup wise so how can i do that...
    Thanks

    Closed my self

  • Multi format report using BI Analytics

    Hi,
    I would like to know if it is possible to design and build a multi format report (each format on a different page) using BI Analytics.
    For eg if i have to display a report containing performance details of a single portfolio belonging to a customer. So in terms of formats - first page may contain information like customer id, name, portfolio id,etc. There may also be some static text. Second page may contain aggregated information about the portfolio performance. And so on. Last page may have information in tabular format.
    can we have such multiiple formats in a single Analytics report ?
    Thanks
    Nusrat

    Hi,
    Is my undertsanding correct - I create a new dashboard and in that i add a new page for each section of the report.
    Thanks
    Nusrat

  • HT201320 I have an email account through yahoo. I am having trouble setting it upon my iPhone and can't receive or send emails!!!! I contacted Rogers and they said I need to find out the host name of the incoming server, in other words yahoos host name. H

    I have an email account through yahoo. I am having trouble setting it upon my iPhone and can't receive or send emails!!!! I contacted Rogers and they said I need to find out the host name of the incoming server, in other words yahoos host name. Help!!

    Yahoo's servers are notoriously unreliable. Use the "Yahoo" account type when setting it up. If it doesn't work, and you are positive the credentials are correct, wait a while and try again.
    While you're waiting, set up a free gmail or iCloud email account.

Maybe you are looking for