Forum Cross Platform with Xamarin

Save XLSX file to local drive and attach in an email (Android)

Hi All,
I am new to Xamarin and stuck with something. Please get me an idea how to solve this...

Details:
1. Create and Save a Excel file (I have successfully created one by using ISave and Xamarin.Forms.DependencyService.Get().SaveAndView("GettingStared.xlsx", "application/msexcel", stream);
2. I dont get any error message and hence I assume that it has been created in my root directory
3. Then I am trying to either attach that file as an email attachment (UNABLE TO DO SO ???)
4. I have an exercise of converting my data in a ObservableCollection into a CSV file and attached that file into email and successfully sent an email after attaching the same csv file. I have also verified my mailbox and the csv file has been attached successfully in my email mailbox
5. Now, I am trying the same with excel file. I have used XLSIO library of SyncFusion and done the coding but can not attach the excel file

My main objective:
I have a standalone application which allows user to upload an excel file. Once a file is choosen by user, the application successfully reads the data and shows in a form. Then user performs editing the data and after all edit is done, then I want the user to save the data back in somewhere. The only way I did was to send an email by converting my latest data into a csv file and attach that file in email and allow user to send that email. I have attached my gmail account to do so and everything works. But I want to extend my solution by playing with excel. I can successfully read the excel file and load data from 3 sheets. Then user edits the data and my final data is in my observable collection. Then while creating a excel file dynamically and attaching as an attachment, I FAILED. I just want to save the data back to my storage somehow or send a copy in an email attachment.

Any help will be much appreciated pleaseeee.
Kind regards

Tagged:

Posts

  • RaajveeRaajvee Member

    Hi @bhabani_sahoo2012
    Can you please explain or if its possible for you, share the code for the implementation of this 4th point, where you are converting observable collection data to csv file.

    1. I have an exercise of converting my data in a ObservableCollection into a CSV file and attached that file into email and successfully sent an email after attaching the same csv file. I have also verified my mailbox and the csv file has been attached successfully in my email mailbox
Sign In or Register to comment.