Submitting forms as PDF - filename attachment

Hi there, I created a form with a submit button that sends the pdf fine. This is a rather minor cosmetic thing, but the trouble is when the file attachment appears, the filename includes all the “%20″ in place of the spaces. So when I send the pdf file, the filename on the attachment appears as “SOP0xx%20Change%20Note%20Procedure.” How can I make the attachment's filename appear normal without all the "%20s"?
Using LiveCycle Designer 8.2.1 in conjunction with Acrobat 9.3.2 Pro.
Thanks!

Hi,
Here is a form with three email buttons. The first two will return the form in PDF format. The third will return the data as an XML file. In all three cases the email attachment name is not affected (eg spaces in names, without replacement with %20). Give this a try and see what happens: https://acrobat.com/#d=2W4mi8OiEHBYfsXEWJcMcA.
If it still inserts the %20 then I think it is an operating system / email client issue.
I have tested in a Windows environment using MS Outlook 2007 and a Mac environment using MS Entourage 2008.
Good luck,
Niall

Similar Messages

  • Form as PDF file attachment

    I am trying to create a cover letter type of PDF file which I can attach with several other PDF files.  The recipient will open, fill in fields and return.  I seem to have this created but when I manually attach as a single file and send the recipient cannot fill out text fields.  If I use the wizard to distribute it does not allow me to attach other files.  Not all attached files are in PDF form. Thanks in advance.

    Hi Lanka,
    Thank you. I checked application V1, it says "MAIL" is for internal output. I want to send the form as attachment to external email id's. How do I do this. Is the following code correct ? Where should I add email id's.
    Thanks
    Veni.
    FORM PRINT_FORM.
      ITCPO-TDIMMED = 'X'.
      ITCPO-TDDELETE = 'X'.
      ITCPO-TDPROGRAM = SY-REPID.
      ITCPO-TDDEST = '5_A1'.
      CALL FUNCTION 'OPEN_FORM'
           EXPORTING
                FORM     = 'Z_SHIPPERS'
                LANGUAGE = SY-LANGU
                OPTIONS  = ITCPO
                DEVICE   = 'MAIL'         "Veni
           EXCEPTIONS
                CANCELED = 1
                DEVICE   = 2
                FORM     = 3
                OPTIONS  = 4
                UNCLOSED = 5
                OTHERS   = 6.
      LOOP AT ITAB_ZMAT.
        CALL FUNCTION 'WRITE_FORM'
            EXPORTING
                 ELEMENT       = 'ITEM_DATA'
                 FUNCTION      = 'SET'
                 TYPE          = 'BODY'
                 WINDOW        = 'MAIN'
       IMPORTING
            PENDING_LINES =
             EXCEPTIONS
                  ELEMENT       = 1
                  FUNCTION      = 2
                  TYPE          = 3
                  UNOPENED      = 4
                  UNSTARTED     = 5
                  WINDOW        = 6
                  OTHERS        = 7.
      ENDLOOP.
      CALL FUNCTION 'CLOSE_FORM'
           EXCEPTIONS
                UNOPENED = 1
                OTHERS   = 2.
      IF SY-SUBRC EQ 0.
        MESSAGE I355 WITH FTAB-VBELN.
      ENDIF.
    ENDFORM.                               " PRINT_FORM

  • Convert filled out InfoPath form to PDF

    Hi all
    I have this basic setup:
    An InfoPath formular is deployed to Forms Server, and a user fills it out. When the user submits the form, I need to somehow convert the form to PDF and attach it to an email sent to the user.
    Now, this should be done in .NET code. I am still not quite sure if I will do it as an event handler on the Forms Server og if I will let the document go through BizTalk and let it to the conversion... but in any case, what I have is an .XML file that is actually the filled out form and I need to convert it to PDF that matches how the form looks like, naturally.
    I have seen this thread:
    http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/9f43f377-dfd6-4c6e-a361-315bf30f3c91 about it, and I ahve tried doing what it says. But I can't get it working.
    I have installed this one:
    http://www.microsoft.com/downloads/details.aspx?familyid=4D951911-3E7E-4AE6-B059-A2E79ED87041&displaylang=en and it seems to work - I can now save as PDF in Word, Excel and so on.
    Then I created a Winforms program (it wont always be in a winforms program, but for testing purposes...) and I did this:
    1. Add the InfoPath Form control to the toolbox (C:\Program Files\Microsoft Office\Office12\Microsoft.Office.InfoPath.FormControl.dll)
    2. Drag the Control which now appears in my tool box to my winform.
    Then I added this code to some event of the form:
    string file = "";
    formControl.Open(file);
    formControl.XmlForm.CurrentView.Export(".pdf", Microsoft.Office.InfoPath.ExportFormat.Pdf);
    Now, the issue is, that the "Export" method and the "ExportFormat" enum are not recognized and therefore give compile errors.
    The only difference between my using statements and the ones in the thread above is that I do not have this one:
    using Microsoft.Office.InfoPath.FormControl;
    since that name space does not seem to exist - I only have the Microsoft.Office.InfoPath name space. Yes, the Microsoft.Office.InfoPath.FormControl.dll is referenced in my project.
    Any thoughts?
    My setup:
    Visual Studio 2008 with .NET 3.5 SP1
    Office 2007, English
    Windows XP
    Thanks
    eliasen, representing himself and not the company he works for.
    MVP and three times MCTS in BizTalk.
    Blog: http://blog.eliasen.dk

    I got your sample project, it compiles without any errors nor warnings.
    And then I made some changes to the code so it can actually work:
    using System;
    using System.IO;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using InfoPath = Microsoft.Office.InfoPath;
    namespace TestInfoPathFormControl
    public partial class Form1 : Form
    public Form1()
    InitializeComponent();
    private void Form1_Load(object sender, EventArgs e)
    string template = Path.Combine(
    Path.GetDirectoryName(Application.ExecutablePath),
    "Template1.xsn");
    this.formControl1.NewFromFormTemplate(template);
    private void button1_Click(object sender, EventArgs e)
    this.formControl1.XmlForm.CurrentView.Export(@"D:\test.pdf", Microsoft.Office.InfoPath.ExportFormat.Pdf);
    Then I hit F5, the app runs and I can get my test.pdf.
    Don't know why it doesn't compile on your side.
    I tried on:
    Visual Studio 2008 SP1
    Office 2007 SP2 (Beta)
    Windows 7 Beta
    And
    Visual Studio 2008 SP1
    Office 2007 SP1
    Windows Vista SP1
    The file version of Microsoft.Office.InfoPath.dll is 12.0.4518.1014, assembly version is 12.0.0.0.
    Could you also check that assembly on your side?
    Can you see the following memebers from your project's object browser?
    They should live in Microsoft.Office.InfoPath.dll.
    Regards,
    Jie
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    The CodeFx Project
    My Blog (CHS)

  • How do I submit my form as PDF in email?

    I just completed a PDF form with a Submit by email button, I was able to set the email id but when i press Submit by Email button, it attaches an XML. How do I make LiveCycle Designer save the form as pdf and attach it to the set email id? Help please

    Open your form in Acrobat Professional.  Using the Advanced pull down menu choose, "Extend Features in Adobe Reader".  You'll get a warning message which includes the following note - "Once reader enabled, certain functions,such as editing document content or inserting and deleting pages will be restricted." Read so you are sure this is what you want then choose Save Now.  Reader rights are now enabled.
    To answer your question on usage rights, I went right to the acrobate users group and copied their indepth explanation
    "To summarize the EULA as it relates to enabling PDFs, you are granted permission for enabling a PDF for a maximum of 500 uses. This means that if you post a PDF enabled form on your Web site and 500 people fill out the form, you're within the licensing agreement. If you enable a form where more than 500 people fill out and submit the form back to you, you're not complying with the licensing in the EULA. There are many uses for staying within the 500 limit. You might want to enable files used as a purchase order form, a travel expense form, a vacation leave form, etc. The form can be used by several Adobe Reader users many times, but needs to stay within the 500 use limitation.
    For a huge number of appliications this new enabling feature is designed for people who don't have industrial strength needs for forms distribution that require purchase of LRES. A charity golf tournament, a small conference, a PTA event, etc. are all likely candidates for using the new enabling features in Acrobat Professional."

  • Email with attachement as pdf of submitted form

    Hi all,
    Can anyone suggest me how to get an email as an acknowledge ment with the submiteed form as an pdf format.?
    I want to get an acknowledgement mail after submitting the form through the work space..
    and email should contain the submitted form as an attachment in a PDF format
    Please assist...
    Thank you

    You can add an email submit button in your form to achieve this.
    Check this - http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?content=000323.html and http://help.adobe.com/en_US/livecycle/10.0/DesignerHelp/WS107c29ade9134a2c5324ea7712a81c8d a6b-8000.html
    Som more pointers which could help
    https://groups.google.com/forum/#!topic/livecycle/81OXCQfsNys
    http://livecycleapps.wordpress.com/2008/07/28/a-submit-button-that-will-send-an-entire-pdf /
    ~ Varun

  • Acrobat 9: Error when PDF form submit with file attachment

    Hi all,
    Hope you can provide some help with my PDF form submit issue. I am getting this error "There is no PDDoc associated with this CosDoc." in Acrobat 9 (Reader and Pro) when I try to submit a PDF form with a file attachment field (the file is specified). The same PDF form works fine in Acrobat 7 or 8 (Reader and Pro) with file attachment.
    If no file attachment is specified (user did not select a file) then the PDF form submits fine in acrobat 9. The form data submission format is in FDF. Same problem if I change to XFDF.
    There are no differences in the problem if the PDF form is created in Acrobat 7 or Acrobat 9, the same submit issue exists in Acrobat 9 but not in the older Acrobat versions.
    Is this a known issue and are there any workarounds/solutions?
    Thanks.

    Sounds like a bug to me. Please report it: http://www.adobe.com/support/feature.html
    George

  • Error submitting form for Distribution: "The filename you specified is not valid because it does not

    Error submitting form for Distribution:
    "The filename you specified is not valid because it does not include a .pdf extension, contains one or more invalid characters or teh path preceding it refers to a protected system location."
    Tried removing dashes from filename, shortenign filename, moving to root directory. No changes. File ends with a .pdf extension.
    This is my first attempt to distribute via acrobat.com

    I found that I got that same message using Acrobat Professional to send out a document for shared review.  I had an exclamation mark in the title of the PDF. When I took out the exclamation mark, it worked.
    So maybe try taking out anything "unusual" (parentheses, dashes, exclamation marks, etc.) in the file name and see if that helps.
    Good luck,
       Philip.

  • BExBroadcasting - manipulate pdf mail-attachment filename

    we are broadcasting BW-reports via BExBroadcaster and generated PDFand sending mail-attachements to some BW-users.
    is there any chance to change or manipulate the filename of these generated PDF mail-attachements ?
    e.g.  shorter filename with lower-case Characters (less than 32 char)

    we are broadcasting BW-reports via BExBroadcaster and generated PDFand sending mail-attachements to some BW-users.
    is there any chance to change or manipulate the filename of these generated PDF mail-attachements ?
    e.g.  shorter filename with lower-case Characters (less than 32 char)

  • CRM ONLINE 2013: On Approval Of Quotation, Run Report, Generate PDF and Send an Email With PDF as attachment

    Hi,
    I am using CRM ONLINE 2013.
    How to automate below process?
    1. On Approval Of Quotation, Run Report.
    2. Generate PDF.
    3. Send an Email With PDF as attachment.
    As i have gone through many forums for this topic, but creating a plugin code for generating Report PDF is not possible in CRM ONLINE.
    So, What is the alternate way to do this..?
    Thanks.

    This is my entire code mentioned below:-
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
        <script type="text/javascript">
            if (typeof (SDK) == "undefined")
            { SDK = { __namespace: true }; }
            SDK.JScriptRESTDataOperations = {
                _context: function () {
                    if (typeof GetGlobalContext != "undefined")
                    { return GetGlobalContext(); }
                    else {
                        if (typeof Xrm != "undefined") {
                            return Xrm.Page.context;
                        else { return new Error("Context is not available."); }
                _getServerUrl: function () {
                    var serverUrl = this._context().getServerUrl()
                    if (serverUrl.match(/\/$/)) {
                        serverUrl = serverUrl.substring(0, serverUrl.length - 1);
                    return serverUrl;
                _ODataPath: function () {
                    return this._getServerUrl() + "/XRMServices/2011/OrganizationData.svc/";
                _errorHandler: function (req) {
                    return new Error("Error : " +
      req.status + ": " +
      req.statusText + ": " +
      JSON.parse(req.responseText).error.message.value);
                _dateReviver: function (key, value) {
                    var a;
                    if (typeof value === 'string') {
                        a = /Date\(([-+]?\d+)\)/.exec(value);
                        if (a) {
                            return new Date(parseInt(value.replace("/Date(", "").replace(")/", ""), 10));
                    return value;
                Create: function (object, type, successCallback, errorCallback) {
                    var req = new XMLHttpRequest();
                    req.open("POST", this._ODataPath() + type + "Set", true);
                    req.setRequestHeader("Accept", "application/json");
                    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
                    req.onreadystatechange = function () {
                        if (this.readyState == 4 /* complete */) {
                            if (this.status == 201) {
                                successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d);
                            else {
                                errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
                    req.send(JSON.stringify(object));
                Retrieve: function (id, type, successCallback, errorCallback) {
                    var req = new XMLHttpRequest();
                    req.open("GET", this._ODataPath() + type + "Set(guid'" + id + "')", true);
                    req.setRequestHeader("Accept", "application/json");
                    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
                    req.onreadystatechange = function () {
                        if (this.readyState == 4 /* complete */) {
                            if (this.status == 200) {
                                successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d);
                            else {
                                errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
                    req.send();
                Update: function (id, object, type, successCallback, errorCallback) {
                    var req = new XMLHttpRequest();
                    req.open("POST", this._ODataPath() + type + "Set(guid'" + id + "')", true);
                    req.setRequestHeader("Accept", "application/json");
                    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
                    req.setRequestHeader("X-HTTP-Method", "MERGE");
                    req.onreadystatechange = function () {
                        if (this.readyState == 4 /* complete */) {
                            if (this.status == 204 || this.status == 1223) {
                                successCallback();
                            else {
                                errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
                    req.send(JSON.stringify(object));
                Delete: function (id, type, successCallback, errorCallback) {
                    var req = new XMLHttpRequest();
                    req.open("POST", this._ODataPath() + type + "Set(guid'" + id + "')", true);
                    req.setRequestHeader("Accept", "application/json");
                    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
                    req.setRequestHeader("X-HTTP-Method", "DELETE");
                    req.onreadystatechange = function () {
                        if (this.readyState == 4 /* complete */) {
                            if (this.status == 204 || this.status == 1223) {
                                successCallback();
                            else {
                                errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
                    req.send();
                RetrieveMultiple: function (type, filter, successCallback, errorCallback) {
                    if (filter != null) {
                        filter = "?" + filter;
                    else { filter = ""; }
                    var req = new XMLHttpRequest();
                    req.open("GET", this._ODataPath() + type + "Set" + filter, true);
                    req.setRequestHeader("Accept", "application/json");
                    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
                    req.onreadystatechange = function () {
                        if (this.readyState == 4 /* complete */) {
                            if (this.status == 200) {
                                successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d.results);
                            else {
                                errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
                    req.send();
                __namespace: true
        </script>
        <script type="text/javascript">
            //Create Email and link it with Order as Regarding field
            var Xrm;
            var email = new Object();
            var ownerID = "";
            var CustomerId = "";
            if (window.opener) { Xrm = window.opener.Xrm; }
            else if (window.parent) { Xrm = window.parent.Xrm; }
            //Get ownerid who send email of quotation to customer
            function GetOwnerID() {
                var owner = Xrm.Page.getAttribute("ownerid").getValue();
                ownerID = owner[0].id;
                var ownerName = owner[0].name;
                var entityType = owner[0].entityType;
                GetToEmailGUID();
            //Get customerid who receive email of quotation from owner
            function GetToEmailGUID() {
                var Customer = Xrm.Page.getAttribute('customerid').getValue();
                CustomerId = Customer[0].id;
                var CustomerName = Customer[0].name;
                var entityType = Customer[0].entityType;
                //if CustomerId is type of "Account" then get Primary Contact id of that account
                if (entityType == "account") {
                    var contact = Xrm.Page.getAttribute("customerid").getValue();
                    if (contact === null) return;
                    var serverUrl = Xrm.Page.context.getClientUrl();
                    var oDataSelect = serverUrl + "/XRMServices/2011/OrganizationData.svc/AccountSet(guid'" + contact[0].id + "')?$select=PrimaryContactId";
                    var req = new XMLHttpRequest();
                    req.open("GET", oDataSelect, false);
                    req.setRequestHeader("Accept", "application/json");
                    req.setRequestHeader("Content-Type", "application/json;charset=utf-8");
                    req.onreadystatechange = function () {
                        if (req.readyState === 4) {
                            if (req.status === 200) {
                                var retrieved = JSON.parse(req.responseText).d;
                                CustomerId = retrieved.PrimaryContactId.Id;
                            else {
                                alert(this.statusText);
                    req.send();
            function CreateEmail() {
                GetOwnerID();
                email.Subject = "Email with Report Attachment";
                //Set The current order as the Regarding object
                email.RegardingObjectId = {
                    Id: Xrm.Page.data.entity.getId(),    //Get the current entity Id , here OrderId
                    LogicalName: Xrm.Page.data.entity.getEntityName()//Get the current entity name, here it will be “salesOrder”
                //Create Email Activity
                SDK.JScriptRESTDataOperations.Create(email, "Email", EmailCallBack, function (error) { alert(error.message); });
            // Email Call Back function
            function EmailCallBack(result) {
                email = result; // Set the email to result to use it later in email attachment for retrieving activity Id
                var activityPartyFrom = new Object();
                // Set the From party of the ActivityParty to relate an entity with Email From field
                activityPartyFrom.PartyId = {
                    Id: CustomerId, //"79EBDD26-FDBE-E311-8986-D89D6765B238",  // id of entity you want to associate this activity with.        
                    LogicalName: "contact"
                // Set the "activity" of the ActivityParty
                activityPartyFrom.ActivityId = {
                    Id: result.ActivityId,
                    LogicalName: "email"
                // Now set the participation type that describes the role of the party on the activity).
                activityPartyFrom.ParticipationTypeMask = { Value: 2 }; // 2 means ToRecipients
                // Create the from ActivityParty for the email
                SDK.JScriptRESTDataOperations.Create(activityPartyFrom, "ActivityParty", ActivityPartyFromCallBack, function (error) { alert(error.message); });
                var activityPartyTo = new Object();
                // Set the From party of the ActivityParty to relate an entity with Email From field
                activityPartyTo.PartyId = {
                    Id: ownerID, //"79EBDD26-FDBE-E311-8986-D89D6765B238",  // id of entity you want to associate this activity with.        
                    LogicalName: "systemuser"
                // Set the "activity" of the ActivityParty  
                activityPartyTo.ActivityId = {
                    Id: result.ActivityId,
                    LogicalName: "email"
                // Now set the participation type that describes the role of the party on the activity).    
                activityPartyTo.ParticipationTypeMask = { Value: 1 }; // 1 means Sender
                // Create the from ActivityParty
                SDK.JScriptRESTDataOperations.Create(activityPartyTo, "ActivityParty", ActivityPartyToCallBack, function (error) { alert(error.message); });
            //ActivityParty From Callback
            function ActivityPartyFromCallBack(result) {
            //ActivityParty To Callback
            function ActivityPartyToCallBack(result) {
                GetReportId('ABM_Infotech_SalesQuote');
            //Create attachment for the created email
            function CreateEmailAttachment() {
                //get reporting session and use the params to convert a report in PDF
                var params = getReportingSession();
                //Email attachment parameters
                var activitymimeattachment = Object();
                activitymimeattachment.ObjectId = Object();
                activitymimeattachment.ObjectId.LogicalName = "email";
                activitymimeattachment.ObjectId.Id = email.ActivityId;
                activitymimeattachment.ObjectTypeCode = "email",
                    activitymimeattachment.Subject = "File Attachment";
                activitymimeattachment.Body = encodePdf(params);
                activitymimeattachment.FileName = "Report1.pdf";
                activitymimeattachment.MimeType = "application/pdf";
                //Attachment call
                SDK.JScriptRESTDataOperations.Create(activitymimeattachment, "ActivityMimeAttachment", ActivityMimeAttachmentCallBack, function (error) { alert(error.message); });
            //ActivityMimeAttachment CallBack function
            function ActivityMimeAttachmentCallBack(result) {
                var features = "location=no,menubar=no,status=no,toolbar=no,resizable=yes";
                var width = "800px";
                var height = "600px";
                window.open(Xrm.Page.context.getServerUrl() + "main.aspx?etc=" + 4202 + "&pagetype=entityrecord&id=" + email.ActivityId, "_blank", features);
                // To open window which works in outlook and IE both
                //openStdWin(Xrm.Page.context.getServerUrl() + "main.aspx?etc=" + 4202 + "&pagetype=entityrecord&id=" + email.ActivityId, "_blank", width,
    height, features);
            //This method will get the reportId based on a report name that will be used in            getReportingSession() function
            function GetReportId(reportName) {
                var oDataSetName = "ReportSet";
                var columns = "ReportId";
                var filter = "Name eq '" + reportName + "'";
                retrieveMultiple(oDataSetName, columns, filter, onSuccess);
            function retrieveMultiple(odataSetName, select, filter, successCallback) {
                var serverUrl = Xrm.Page.context.getServerUrl();
                var ODATA_ENDPOINT = "/XRMServices/2011/OrganizationData.svc";
                var odataUri = serverUrl + ODATA_ENDPOINT + "/" + odataSetName + "?";
                if (select) {
                    odataUri += "$select=" + select + "&";
                if (filter) {
                    odataUri += "$filter=" + filter;
                $.ajax({
                    type: "GET",
                    contentType: "application/json; charset=utf-8",
                    datatype: "json",
                    url: odataUri,
                    beforeSend: function (XMLHttpRequest) {
                        XMLHttpRequest.setRequestHeader("Accept", "application/json");
                    success: function (data) {
                        if (successCallback) {
                            if (data && data.d && data.d.results) {
                                successCallback(data.d.results);
                            else if (data && data.d) {
                                successCallback(data.d);
                            else {
                                successCallback(data);
                    error: function (XmlHttpRequest, errorThrown) {
                        if (XmlHttpRequest && XmlHttpRequest.responseText) {
                            alert("Error while retrieval ; Error – " + XmlHttpRequest.responseText);
            function onSuccess(data) {
                reportId = data[0].ReportId.replace('{', ").replace('}', ");
                CreateEmailAttachment(); // Create Email Attachment
            //Gets the report contents
            function getReportingSession() {
                var pth = Xrm.Page.context.getServerUrl() + "/CRMReports/rsviewer/reportviewer.aspx";
                var retrieveEntityReq = new XMLHttpRequest();
                var Id = Xrm.Page.data.entity.getId();
                var quotationGUID = Id.replace('{', ""); //set this to selected quotation GUID
                quotationGUID = quotationGUID.replace('}', "");
                var reportName = "ABM_Infotech_SalesQuote"; //set this to the report you are trying to download
                var reportID = "751089AA-74B8-E211-B52F-D8D3855B253B"; //set this to the guid of the report you are trying to download
                var rptPathString = ""; //set this to the CRMF_Filtered parameter
                var strParameterXML = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'><entity name='quote'><all-attributes /><filter type='and'><condition
    attribute='quoteid' operator='eq' uitype='quote' value='" + quotationGUID + "' /> </filter></entity></fetch>";
                retrieveEntityReq.open("POST", pth, false);
                retrieveEntityReq.setRequestHeader("Accept", "*/*");
                retrieveEntityReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
                rptPathString = "id=%7B" + reportID + "%7D&uniquename=" + Xrm.Page.context.getOrgUniqueName() + "&iscustomreport=true&reportnameonsrs=&reportName="
    +
                                reportName + "&isScheduledReport=false&p:ABMFilteredQuote=" + strParameterXML;
                //remove the part starting from &p:salesorderid if your report has no parameters
                retrieveEntityReq.send(rptPathString);
                var x = retrieveEntityReq.responseText.indexOf("ReportSession=");
                var ret = new Array();
                ret[0] = retrieveEntityReq.responseText.substr(x + 14, retrieveEntityReq.responseText.indexOf("&", x) - x - 14); //the session id
                x = retrieveEntityReq.responseText.indexOf("ControlID=");
                ret[1] = retrieveEntityReq.responseText.substr(x + 10, retrieveEntityReq.responseText.indexOf("&", x) - x - 10); //the control id
                return ret;
            var bdy = new Array();
            var bdyLen = 0;
            function concat2Bdy(x) {
                bdy[bdyLen] = x;
                bdyLen++;
            function encodePdf(params) {
                bdy = new Array();
                bdyLen = 0;
                var retrieveEntityReq = new XMLHttpRequest();
                var pth = Xrm.Page.context.getServerUrl() + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + params[0] +
                "&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + params[1] +
                "&OpType=Export&FileName=Public&ContentDisposition=OnlyHtmlInline&Format=PDF";
                retrieveEntityReq.open("GET", pth, false);
                retrieveEntityReq.setRequestHeader("Accept", "*/*");
                retrieveEntityReq.send();
                BinaryToArray(retrieveEntityReq.responseBody);
                return encode64(bdy);
            var StringMaker = function () {
                this.parts = [];
                this.length = 0;
                this.append = function (s) {
                    this.parts.push(s);
                    this.length += s.length;
                this.prepend = function (s) {
                    this.parts.unshift(s);
                    this.length += s.length;
                this.toString = function () {
                    return this.parts.join('');
            var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
            function encode64(input) {
                var output = new StringMaker();
                var chr1, chr2, chr3;
                var enc1, enc2, enc3, enc4;
                var i = 0;
                while (i < input.length) {
                    chr1 = input[i++];
                    chr2 = input[i++];
                    chr3 = input[i++];
                    enc1 = chr1 >> 2;
                    enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
                    enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
                    enc4 = chr3 & 63;
                    if (isNaN(chr2)) {
                        enc3 = enc4 = 64;
                    } else if (isNaN(chr3)) {
                        enc4 = 64;
                    output.append(keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4));
                return output.toString();
        </script>
        <script type="text/vbscript">
        Function BinaryToArray(Binary)
               Dim i
               ReDim byteArray(LenB(Binary))
               For i = 1 To LenB(Binary)
                     byteArray(i-1) = AscB(MidB(Binary, i, 1))
                     concat2Bdy(AscB(MidB(Binary, i, 1)))
             Next
              BinaryToArray = byteArray
       End Function     
        </script>
    </head>
    <body>
        <input type="button" onclick="CreateEmail();" value="Attach Report" />
    </body>
    </html>

  • Multipart/form-data and file attachment

    Hi ,
    This question has probably been asked before, but if not then here it is. Any replies will be appreciated:
    Q. When using "Enctype=Multipart/form-data", with file attachment alongwith other form fields, is it mandatory to attach a file ? What if user selects no file to attach?
    Q. If no, then how can it be possible that a form can be submitted without attaching a file since when I try to submit a form with no file attached to it, it gives me error message saying :java.lang.NullPointerException
    Q. Does it mean that I can't have a form with a blank "File" input field, if the form's Enctype is "multipart/form-data"? Since users may not select a file to attach to the form, in other words it is an optional.
    I hope I was clear enough in explaining my questions.
    Thanks in advance.

    I am using Orielly's file attachement pacakge.
    Here's what I am doing in my JSP page: It does the following:
    int maxFileSize = 10 * 1024 * 1024; // 5MB max
    String uploadDir = "/direct/files/upload/";
    String FormResults = "";
    String FileResults = "";
    String fileName = "";
    String fileName2 = "";
    String paramName="";
    String paramValue="";     
    File f;
    int filecounter=1;
    first get the form fields using following code:
    MultipartRequest multi = new MultipartRequest(request, uploadDir, maxFileSize);
    Enumeration params = multi.getParameterNames();
    //Get the form information
    while (params.hasMoreElements())
         paramName = (String) params.nextElement();     
         paramValue = multi.getParameter(paramName);
         if (paramName.equals("emailconfirm"))
              emailconfirmation = paramValue;
         else if (paramName.equals("Requester"))
              Requester = paramValue;
         else if (paramName.equals("TodaysDate"))
              TodaysDate = paramValue;
         else if (paramName.equals("Extension"))
    }//end while
    Then it gets the file information using the following code: I have two file fields in my form so that's why I am using a filecounter to find out if user has attached two files or just one:
    Enumeration files = multi.getFileNames();
    while (files.hasMoreElements())
         String formName = (String) files.nextElement();
         if (filecounter == 2)
    fileName2 = multi.getFilesystemName(formName);
         String fileType = multi.getContentType(formName);
              f = multi.getFile(formName);
         FileResults += "<BR>" + formName + "=" + fileName2 + ": Type= " + fileType + ":
    Size= " + f.length();
         else
         {     fileName = multi.getFilesystemName(formName);
              String fileType = multi.getContentType(formName);
              f = multi.getFile(formName);
              FileResults += "<BR>" + formName + "=" + fileName + ": Type= " + fileType + ":
    Size= " + f.length();
         filecounter=filecounter+1;
    Then after composing the mail message I send email with the form fields and file attachments using following code:
    Properties props = new Properties();
    MimeBodyPart mbp1 = new MimeBodyPart();
    MimeBodyPart mbp2 = new MimeBodyPart();
    MimeBodyPart mbp3 = new MimeBodyPart();
    URLDecoder urlDecoder = new URLDecoder();
    String to1 = urlDecoder.decode(toemail);
    String from1 = urlDecoder.decode(fromemail);
    String cc1 = urlDecoder.decode(ccemail);
    props.put( "mail.host", host );
    Session session1 = Session.getDefaultInstance(props, null);
    // Construct the message
    Message msg = new MimeMessage( session1 );
    msg.setFrom( new InternetAddress( from1 ) );
    msg.setRecipients( Message.RecipientType.TO, InternetAddress.parse( to1, false ) );
    msg.setRecipients( Message.RecipientType.CC, InternetAddress.parse( cc1, false ) );
    msg.setSubject( subject );
    msg.setHeader( "X-Mailer", "ExceptionErrorMail" );
    msg.setSentDate( new Date() );
    mbp1.setText(mail_message);
    mbp1.setContent(mail_message, "text/html");
    // Send the email message
    FileDataSource fds = new FileDataSource(uploadDir + fileName);
    FileDataSource fds2 = new FileDataSource(uploadDir + fileName2);
    mbp2.setDataHandler(new DataHandler(fds));
    mbp3.setDataHandler(new DataHandler(fds2));
    mbp2.setFileName(fileName);
    mbp3.setFileName(fileName2);
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp1);
    mp.addBodyPart(mbp2);
    mp.addBodyPart(mbp3);
    msg.setContent(mp);
    Transport.send( msg );
    //email sent...
    //delete the two files from the server..
    File f2 =new File(uploadDir + fileName);
    f2.delete();
    File f3 =new File(uploadDir + fileName2);
    f3.delete();     
    //End of code
    So when I don't attach a file and submit my form , I get the error message that I mentioned in my previous post.
    Any more ideas?

  • Submit Form as XML / Rename attached XML file

    Hello,
    I am using the followig script to submit a form:
    var Mailto = "[email protected]";
    var mySubject = "This is the subject";
    var myMessage  = "Please find attached my file.";
    var Mail = "mailto:" + Mailto + "?Subject=" + mySubject + "&Body=" + myMessage;
    event.target.submitForm({
    cURL: Mail,
    bEmpty: true,
    cSubmitAs: "XML"
    Unfortunately I cannot change the name of the attached XML file. It is automatically the PDF filename.
    Has anybody an idea how to change the attachement name?
    Many thanks.
    Regards,
    ra_be

    The attachment filename will always be the name of the PDF. The only way to change is to save the PDF under a different name before you email it.
    Paul

  • Error Submitting form

    Anyone getting this error while submitting form.My process looks good . Same connection works for other form but not for this form.Any help please its urgent

    Here is something new i found.The process which worked i tried to attach the form (pdf form) from my other process which showed me error while submitting form and i get the same error when i use tht form in the process which worked...
    why is this so any thoughts???

  • Entire pdf is attached to email using submit button

    Hi everyone,
    When I was using Acrobabt 9 and I enabled usage rights in adobe reader for a pdf file containing a form, if that form contained a submit by email button, the form data was the only thing that got attached to the email.
    I just tried enabling usage rights in adobe reader in Acrobat X and it seems that now when an submit by email button is pressed, the whole pdf is attached to the email.
    Is this something that's new to Acrobat X? Is Adobe now allowing the whole pdf to be attached?
    Appreciate any help.

    After creating the button, I chose the submit a form action in the properties dialogue box. I just checked and the export format is set to the complete pdf document.
    Was this available in Acrobat 9 or is it something new in X? From memory, I thought that submitting the entire document by email was not allowed in earlier versions and that you needed to purchase an enterprise solution to get it to work.
    Thanks

  • Submitting form with attachments.

    Hi,
    I have a simple need. I am stucked in it. What i need to do is:
    Step 1: User1 starts opens a pdf form inside LC Workspace, fill it, attach files (Reader Extended) and then submit it.
    Step 2: User2 receives the filled form with attcachments. Can view attachments and save them in repository.
    I am stucked at step 1. User is able to fill the form, add attachments but can't submit it. If I am not enabling the Reader Extensions for attachments (Disabling functionality to attach files) then it works fine. But when using with attachments option, it fails. It gives no error, no message and does not passed to the 2nd user.
    Is there any special requirement in developing such process/form ??
    Please help me out on it.
    Abhinav

    I've studied the HTML generated by UIX and it has following bugs and misfeatures:
    1. Misfeature: Submitting with Enter works ONLY if there is exactly one text field in the form (no submit button is actually needed), as Brian Stoler wrote. I don't understand reason for this.
    2. Bug: UIX generates javascript function "_submitOnEnter" which is called as event handler for "onKeyPress" event. But this function is erroneously generated multiple times, once for each form in the page. Browsers (Mozilla and IE) use the latest implementation. This function is different for forms with one text field and for forms with more text field, but only the first one can do the job. As a consequence of this, Enter can submit the form only if the last form on a page has single text field (which is for example not the case of search form with single field above another form...)
    Tested with UIX 2.1.7 in JDeveloper 9.0.3.3, using UIX as JSP tag library.
    Workaround:
    1. Use Opera browser: it submits form with enter key even if there is no submit button (this does not work for the first text field in the form, because it has "onkeypress" event handler).
    2. Implement this feature by hand yourself, if you really need it (see below).
    3. Use accessKey: allows to submit form with Alt+<key> combination (followed by Enter with IE).
    Implementing Enter key submits with Javascript:
    1. Put the following function to the header (or to javascript library):
    function enter(e, frm) {
    var kc;
    if(window.event) kc=window.event.keyCode;
    else if(e) kc=e.which;
    else return true;
    if(kc==13) {
    submitForm(frm,1);
    return false;
    Function copied from UIX (C).
    2. Add this event handler to each input element:
    onKeyPress="return enter(event, 'formName');"
    It is obvious that this is error prone, but it works with all browsers...
    Will this be fixed in future versions?
    Why only form with one text field can be submitted?

  • Submitted form's formats

    I have made a custom order web form.  I would like to view each submitted form as it's own pdf or sent automatically to an email with the questions and filled in answers opposed to a spreadsheet.  Is this possible?  Thanks!

    Hi;
    One feature in the Paid subscription is the ability to "Save Response as PDF Form" (in the row menu or File menu when you have a response selected on the View Responses tab) which saves an individual response as a PDF of the original form filled out.  There is not yet a way to attach this to the Email Notification but this is a popular feature request and we have it noted as such.
    Thanks,
    Josh

Maybe you are looking for