Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • При экспорте в excel компанет всегда создаёт временный файл внезависимости от того что при вызове метода указано не создавать файл. Данный файл создаётся во временной директории и если у пользователя из под которого запущен код экспорта в ексел нет прав то происходит ошибка.
                                    Эта ошибка появляетс при использовани экспорта грида в sharepoint. Причём внутри у вас стоит проверка на возможность создания файла - она проходит но у пользователя нет прав на запись и возникает exception.

                                0

                                via translate.google.com:

                                >>
                                When exporting to excel kompanet always creates a temporary file vnezavisimosti from what is specified in the call to not create the file. This file is created in the temporary directory, and if the user from running code under which the export eksel no human error occurs.
                                 This error when using export poyavlyaets grid in sharepoint. And inside you have a check on the possibility of creating a file - it runs but you do not have permission to write and there is exception.
                                >>

                                0

                                Hello Gennady,

                                Thank you for your report. I have translated your description into English because there is a chance that our customers might find our conversation.

                                I have discussed this issue with our team:

                                I am afraid we do not understand the following statement: And inside you have a check on the possibility of creating a file.
                                We do not create temporary files in our code. All temporary information is stored in the server's memory.

                                Maybe, you need to use the ASPxGridViewExporter.WriteXls method to export the grid into MemoryStream. After that, you will be able to send a file to the server response as in the ASPxGridViewExporter.WriteXlsToResponse method).

                                Thanks.
                                Vest

                                0

                                You write
                                "I am afraid we do not understand the following statement: And inside you have a check on the possibility of creating a file.
                                We do not create temporary files in our code. All temporary information is stored in the server's memory."

                                namespace DevExpress.XtraExport {
                                     public class XlsxPackage {
                                          #region inner classes
                                          class StreamProviderCreator {
                                               bool? canUseFileStream;
                                               bool CanUseFileStream {
                                                    get {
                                                         if(!canUseFileStream.HasValue) {
                                                              try {
                                                                   using(FileStreamProvider provider = new FileStreamProvider()) {
                                                                        System.Diagnostics.Debug.Assert(provider.Stream != null);
                                                                   }
                                                                   canUseFileStream = true;
                                                              } catch(System.Security.SecurityException) {
                                                                   canUseFileStream = false;
                                                              }
                                                         }
                                                         return canUseFileStream.Value;
                                                    }
                                               }
                                               public StreamProvider Create() {
                                                    return CanUseFileStream ? new FileStreamProvider() : new StreamProvider();
                                               }
                                          }

                                .....

                                class FileStreamProvider : StreamProvider {
                                               string path = string.Empty;
                                               protected override Stream CreateStream() {
                                                    path = Path.GetTempFileName();
                                                    return File.Create(path);
                                               }
                                               public override void Dispose() {
                                                    base.Dispose();
                                                    if(!string.IsNullOrEmpty(path)) {
                                                         File.Delete(path);
                                                         path = string.Empty;
                                                    }
                                               }
                                          }

                                0

                                path = Path.GetTempFileName();
                                                    return File.Create(path);
                                In Sharepoint this string return TRUE but when file created throws exception ( file dir not found or same)

                                0

                                Gennady,

                                Thank you for your clarification. We will try to reproduce the issue locally.
                                Your patience is highly appreciated.

                                Thanks,
                                Vest

                                0

                                Its reproduced in sharepoint if account witch run export to excel not LOCAL user in server
                                ( reminde that code in sharepoint run from curent loged user)

                                0

                                if run export with elevant privelege ( from acount sharepoint pool) export to excel work.

                                0

                                Hello Gennady:

                                We assume that this problem is caused by an exception in the SharePoint. Would you please provide us with additional information about this exception and also SharePoint log files as mentioned in report Q149826? They will help us identify this error.

                                Thanks
                                Kate.

                                0

                                Server Error in '/' Application.
                                --------------------------------------------------------------------------------

                                The directory name is invalid.
                                Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

                                Exception Details: System.IO.IOException: The directory name is invalid.

                                Source Error:
                                An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

                                Stack Trace:

                                [IOException: The directory name is invalid.
                                ]
                                  System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +10547621
                                  System.IO.Path.GetTempFileName() +169
                                  DevExpress.XtraExport.FileStreamProvider.CreateStream() +14
                                  DevExpress.XtraExport.FileStreamProvider..ctor() +45
                                  DevExpress.XtraExport.StreamProviderCreator.get_CanUseFileStream() +56
                                  DevExpress.XtraExport.StreamProviderCreator.Create() +10
                                  DevExpress.XtraExport.XlsxPackage.AddToArchive(ZipArchive archive, String path, XmlNode node) +41
                                  DevExpress.XtraExport.XlsxPackage.CreateXlsxFile() +149
                                  DevExpress.XtraExport.ExportXlsxProvider.DevExpress.XtraExport.IExportProvider.Commit() +556
                                  DevExpress.XtraPrinting.Export.XLS.XlsExportProviderBase.CreateDocument(LayoutControlCollection layoutControls, Boolean correctImportBrickBounds) +98
                                  DevExpress.XtraPrinting.PrintingSystemBase.ExportToXlsx(Stream stream, XlsxExportOptions options) +41
                                  DevExpress.Web.ASPxGridView.Export.ASPxGridViewExporter.WriteXlsxCore(Stream stream, ExportOptionsBase exportOptions) +114
                                  DevExpress.Web.ASPxGridView.Export.ASPxGridViewExporter.WriteToResponse(String fileName, Boolean saveAsFile, String fileFormat, ExportToStream getStream, ExportOptionsBase options) +82
                                  DevExpress.Web.ASPxGridView.Export.ASPxGridViewExporter.WriteXlsxToResponse() +131
                                  GTSMECoreBranding.ControlTemplates.GTSMEReportControls.OverdueRW.ASPxButtonExcel_Click(Object sender, EventArgs e) +127
                                  DevExpress.Web.ASPxEditors.ASPxButton.OnClick(EventArgs e) +99
                                  System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
                                  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981

                                0

                                Hello Gennady:

                                Thank you for this information. We will discuss this issue with our team and let you know our decision. Please accept our apologies for the delay in responding.

                                Thanks
                                Kate.

                                0

                                Hello Gennady:

                                Would you please provide the version of Sharepoint used on your side.
                                I apologize that I have not requested this information before.

                                Thanks
                                Kate.

                                0

                                Hello Gennady:

                                I am closing this report with the "Can't reproduce" status since we are not able to reproduce this problem due to the unknown version or sharepoint.
                                You can reactivate this ticket once you can provide this information.

                                Thanks
                                Kate.

                                0

                                sharepoint 2010 portal (sharepoint foundation same arror)

                                0

                                Let me explain again. There is no need to reproduce this bug in SharePoint environment. Code review shows that there is NO WriteXlsxToResponse() overload with option to choose type of underlying stream to use. Method have nondeterministic behavior, type of underlying stream depends on undocumented OS settings.

                                Look at bug call stack:
                                [14] System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +10547621
                                [13] System.IO.Path.GetTempFileName() +169
                                [12] DevExpress.XtraExport.FileStreamProvider.CreateStream() +14
                                [11] DevExpress.XtraExport.FileStreamProvider..ctor() +45
                                [10] DevExpress.XtraExport.StreamProviderCreator.get_CanUseFileStream() +56
                                [9] DevExpress.XtraExport.StreamProviderCreator.Create() +10
                                [8] DevExpress.XtraExport.XlsxPackage.AddToArchive(ZipArchive archive, String path, XmlNode node) +41
                                [7] DevExpress.XtraExport.XlsxPackage.CreateXlsxFile() +149
                                [6] DevExpress.XtraExport.ExportXlsxProvider.DevExpress.XtraExport.IExportProvider.Commit() +556
                                [5] DevExpress.XtraPrinting.Export.XLS.XlsExportProviderBase.CreateDocument(LayoutControlCollection layoutControls, Boolean correctImportBrickBounds) +98
                                [4] DevExpress.XtraPrinting.PrintingSystemBase.ExportToXlsx(Stream stream, XlsxExportOptions options) +41
                                [3] DevExpress.Web.ASPxGridView.Export.ASPxGridViewExporter.WriteXlsxCore(Stream stream, ExportOptionsBase exportOptions) +114
                                [2] DevExpress.Web.ASPxGridView.Export.ASPxGridViewExporter.WriteToResponse(String fileName, Boolean saveAsFile, String fileFormat, ExportToStream getStream, ExportOptionsBase options) +82
                                [1] DevExpress.Web.ASPxGridView.Export.ASPxGridViewExporter.WriteXlsxToResponse() +131

                                Look at line [9]: DevExpress.XtraExport.StreamProviderCreator.Create() - this is the place where code hiddenly decide to use FileStream instead of MemoryStream.
                                Snippet from ..\DevExpress 2011.1\Components\Sources\DevExpress.XtraPrinting\DevExpress.Printing.Core\Export\ExportToExcel2007\XslxDom\XlsxPackage.cs:
                                public StreamProvider Create() {
                                     return CanUseFileStream ? new FileStreamProvider() : new StreamProvider();
                                }

                                Look at line [10]: DevExpress.XtraExport.StreamProviderCreator.CanUseFileStream - this property returns true, if DevExpress.XtraExport.FileStreamProvider constructor does not raise SecurityException.
                                Snippet from ..\DevExpress 2011.1\Components\Sources\DevExpress.XtraPrinting\DevExpress.Printing.Core\Export\ExportToExcel2007\XslxDom\XlsxPackage.cs
                                bool CanUseFileStream {
                                     get {
                                          if(!canUseFileStream.HasValue) {
                                               try {
                                                    using(FileStreamProvider provider = new FileStreamProvider()) {
                                                         System.Diagnostics.Debug.Assert(provider.Stream != null);
                                                    }
                                                    canUseFileStream = true;
                                               } catch(System.Security.SecurityException) {
                                                    canUseFileStream = false;
                                               }
                                          }
                                          return canUseFileStream.Value;
                                     }
                                }

                                Look at line [12]: DevExpress.XtraExport.FileStreamProvider.CreateStream() - this method returns System.IO.FileStream as result of File.Create call.
                                Snippet from ..\DevExpress 2011.1\Components\Sources\DevExpress.XtraPrinting\DevExpress.Printing.Core\Export\ExportToExcel2007\XslxDom\XlsxPackage.cs
                                protected override Stream CreateStream() {
                                     path = Path.GetTempFileName();
                                     return File.Create(path);
                                }

                                As shown, behavior is nondeterministic. In case of SecurityException at line [10], DevExpress.XtraExport.StreamProvider have to be instantiated instead of DevExpress.XtraExport.FileStreamProvider. In that case line [12] call DevExpress.XtraExport.StreamProvider.CreateStream() - this method returns System.IO.MemoryStream.
                                Snippet from ..\DevExpress 2011.1\Components\Sources\DevExpress.XtraPrinting\DevExpress.Printing.Core\Export\ExportToExcel2007\XslxDom\XlsxPackage.cs
                                protected virtual Stream CreateStream() {
                                     return new MemoryStream();
                                }

                                I think it is real bug. Behavior has to be deterministic: type of stream has to be parameterized (or use MemoryStream by default), also security requirements for FileStream have to be well-documented.

                                0

                                So your statement "We do not create temporary files in our code. All temporary information is stored in the server's memory" (7/19/2011 7:01:25 PM) is not right.

                                0

                                Hello Gennady:

                                Thank you for additional information. This bug is reproduced on our side and passed to our R&D Team. I will keep you informed of any progress.

                                Thanks
                                Kate.

                                You must  log in  or  register  to leave an answer

                                Is your intention to post an answer to your own question?

                                • If so, then proceed.
                                • If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
                                • If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.

                                To start a chat you should create a support ticket


                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Your Privacy - Legal Statements

                                Copyright © 1998-2013 Developer Express Inc.
                                ALL RIGHTS RESERVED
                                All trademarks or registered trademarks
                                are property of their respective owners