web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Exception while trying to read a stream in ax 7

(0) ShareShare
ReportReport
Posted on by

Hi, I am getting the following exception "A disk error occurred during a write operation. (Exception from HRESULT: 0x8003001D (STG_E_WRITEFAULT))" while i am trying to read a stream. I got the exception at the Line which is having read font. Can any one help me out?

            FileUpload fileUploadControl     = dialog.formRun().control(dialog.formRun().controlId('Upload'));

            FileUploadTemporaryStorageResult fileUploadResult = fileUploadControl.getFileUploadResult();

 
            memoryStream = fileUploadResult.openResult();
            fileurl=fileUploadResult.getDownloadUrl();
            filename=fileUploadResult.getFileName();
               

            if (fileUploadResult != null && fileUploadResult.getUploadStatus())

            {
                [splitFilepath,splitFilename,splitFileExt] = filenameSplit(filename);
                if ( splitFileExt== '.xls' || splitFileExt== '.csv' )
                {
                    
              
                    using (ExcelPackage Package = new ExcelPackage(memoryStream))

                    {.......


*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,961 Most Valuable Professional on at

    Is the content really an Excel spreadsheet? It seems that your code will try to create an Excel package even for text files...

    If it is, it is the Open XML format (.xlsx) or the old one?

  • Community Member Profile Picture
    on at

    I am using the format (.xls) Excel file. I need to read the file of .xls extension. Could you tell me why this exception is occurred?

  • Verified answer
    Martin Dráb Profile Picture
    237,961 Most Valuable Professional on at

    I don't think you will be able to use the OpenXML API for non-OpenXML files. Either you'll find an API that can work with the old format, or you'll have to use another format.

  • Community Member Profile Picture
    on at

    So,this is like i can only use .xlsx file in this open XML. Am i right? 

    Is there anyother way to read a .xls file?

  • Verified answer
    Martin Dráb Profile Picture
    237,961 Most Valuable Professional on at

    Yes, only .xlsx uses Open XML format. The old formats were something proprietary.

    There surely can be found ways to read other formats, but I wouldn't invest time into it. .xlsx is around for more than 12 years and you can export data from .xls to commonly understandable formats if you have to deal with imports of something really old.

  • Community Member Profile Picture
    on at

    Yes, I am exporting data from .xls by converting it into .csv file and updating a table through this .csv file.  I have no idea how to read a .xls file.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans