Forum Discussion

ssmith-nova's avatar
ssmith-nova
New Contributor III
9 months ago

Exporting data to a Flat File in the OneStream File System using C#

This seems like it should be a no brainer, but I've spent a couple hours trying to figure it out and googling for a solution and I have nothing. I am trying to export data to a file, but my BR is w...
  • RobbSalzmann's avatar
    9 months ago

    C# is case sensitive.  Use AppServerConfigSettings instead of AppserverConfigSettings.

    I also removed the unnecessary If statements:

    AppServerConfigSettings configSettings = AppServerConfig.GetSettings(si);
    string folderPath = FileShareFolderHelper.GetDataManagementExportUsernameFolderForApp(si, true, configSettings.FileShareRootFolder, si.AppToken.AppName) + "\\" + DateTime.UtcNow.ToString("yyyyMMdd") + "\\Extracts";
    Directory.CreateDirectory(folderPath);
    string filePath = folderPath + "\\AppTypes.xml";
    File.Delete(filePath);
    File.WriteAllText(filePath, outer.accountRecs.ToString());