Send spreadsheet as an email attachment.

I am importing a spreadsheet that is a template for the user to fill in. There are other input items on the form with the spreadsheet control. I want to send the spreadsheet as an attachment for an email when the user clicks on the form submit button.

1 Reply 1 reply marked as answer

SP Sangeetha Priya Murugan Syncfusion Team May 19, 2021 01:42 PM UTC

Hi Michal, 
 
Thank you for contacting Synfusion support. 
 
We have checked your reported requirement and we would like to let you know that we can able to send the spreadsheet saved JSON data using saveAsJSON in the form post as like as below. By using this you use the spreadsheet saved JSON according to your need. 
 
 
    <ej:Spreadsheet ID="Spreadsheet" AllowFormulaBar="false" ShowRibbon="false" EnableContextMenu="false" runat="server"> 
        </ej:Spreadsheet> 
       
        <input type="button" onclick="sbmForm()" value= "Submit"> 
     
    <script type="text/javascript"> 
         
         
        function sbmForm() { 
            var ssObj = $("#MainContent_Spreadsheet").data("ejSpreadsheet"), jsonData = JSON.stringify(ssObj.saveAsJSON()); 
            var formData = new FormData(); 
            formData.append( 
                "JSONData", 
                jsonData 
            );  // append the spreadsheet saved JSON data in form data 
            console.log(formData.get('JSONData')); 
        } 
    </script> 
 
 
Could you please check the above links and get back to us, if you need any further assistance on this. 
 
Regards, 
Sangeetha M 


Marked as answer
Loader.
Up arrow icon