Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nik Bennett 4 posts 34 karma points
    Jun 26, 2017 @ 15:42
    Nik Bennett
    0

    ExportToFile function

    Has anyone had any luck in using the ExportToFile function? I'm trying to setup a scheduled export of form data but with the code below all I get is an excel file that has the correct headers but no datarows, any thoughts?

    var excelProvider = Umbraco.Forms.Core.Providers.ExportTypeProviderCollection.Instance.GetProviderInstance(Guid.Parse(Umbraco.Forms.Core.Constants.ExportTypes.Excel));
            var formFilter = new RecordExportFilter
            {
                StartDate = DateTime.Today.AddDays(-14),
                EndDate = DateTime.Today,
                Form = GuidHelper.GetGuid("ffda27cf-0337-436f-a7de-3f57196531bb"),
            };
    
            var formLocation = HostingEnvironment.MapPath("~/App_Data/NewsletterExport.xlsx");
            excelProvider.ExportToFile(formFilter, formLocation);
    

    Nik

  • Preethi 32 posts 99 karma points
    Aug 04, 2017 @ 17:05
    Preethi
    0

    I am having a similar issue. It exports an empty file with headers in a submissions worksheet. Have tried changing filter settings to no avail. Any updates please

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies