mierlp Posted December 27, 2012 Share Posted December 27, 2012 Hi, Within my application i have a form which contains a listbox with all tables. The user can select a table he wants to export. When he hits the export button the following code will be executed: // Database if NOT dmArtist.Artist.Active then dmArtist.Artist.Active:=TRUE; // Excel export scExcelExport.DataSet:=dmArtist.Artist; scExcelExport.WorksheetName:='Artiesten'; scExcelExport.HeaderText.text:='Artiesten per ' +DateToStr(Date) ; scExcelExport.ExcelVisible:=false; try scExcelExport.ExportDataset; ExportFile:='Artiesten per ' +FormatDateTime('hhmmss', Time) ; scExcelExport.SaveAs(UniServerModule.FilesFolderPath+ExportFile,ffXLS) finally scExcelExport.Disconnect; // Save export UniSession.SendFile(UniServerModule.FilesFolderPath+ExportFile+'.xls', 'Artiesten.xls'); end; end; I save the file to UniServerModule.FilesFolderPath and every file will be created. Sometimes after 3 or 5 export actions (files are created) i got the followin message : 'Cannot open file C:\Data\Delphi\UniGui\myEventWeb\cache\Artiesten per 133412.xls' The process has no access to the file because it's used by a other proces See attachement...it's in Dutch but the translation is above. I test i local as you can see by the path names. Regards Peter Quote Link to comment Share on other sites More sharing options...
albertovesx Posted December 27, 2012 Share Posted December 27, 2012 Hi, Within my application i have a form which contains a listbox with all tables. The user can select a table he wants to export. When he hits the export button the following code will be executed: // Database if NOT dmArtist.Artist.Active then dmArtist.Artist.Active:=TRUE; // Excel export scExcelExport.DataSet:=dmArtist.Artist; scExcelExport.WorksheetName:='Artiesten'; scExcelExport.HeaderText.text:='Artiesten per ' +DateToStr(Date) ; scExcelExport.ExcelVisible:=false; try scExcelExport.ExportDataset; ExportFile:='Artiesten per ' +FormatDateTime('hhmmss', Time) ; scExcelExport.SaveAs(UniServerModule.FilesFolderPath+ExportFile,ffXLS) finally scExcelExport.Disconnect; // Save export UniSession.SendFile(UniServerModule.FilesFolderPath+ExportFile+'.xls', 'Artiesten.xls'); end; end; I save the file to UniServerModule.FilesFolderPath and every file will be created. Sometimes after 3 or 5 export actions (files are created) i got the followin message : 'Cannot open file C:\Data\Delphi\UniGui\myEventWeb\cache\Artiesten per 133412.xls' The process has no access to the file because it's used by a other proces See attachement...it's in Dutch but the translation is above. I test i local as you can see by the path names. Regards Peter Well, I am not sure, but maybe you need to add: procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject); begin MimeTable.AddMimeType('xls', 'Excel'); end; Quote Link to comment Share on other sites More sharing options...
mierlp Posted December 27, 2012 Author Share Posted December 27, 2012 Hi, When running the apps I got the message: 'Extension already exists' Regards Peter Well, I am not sure, but maybe you need to add: procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject); begin MimeTable.AddMimeType('xls', 'Excel'); end; Quote Link to comment Share on other sites More sharing options...
mierlp Posted December 30, 2012 Author Share Posted December 30, 2012 Hi, When running the apps I got the message: 'Extension already exists' Regards Peter Hi And the problem is still there even when i add the code: procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject); begin MimeTable.AddMimeType('xls', 'Excel'); end; After 3-5 download the file i get the error message. Regards Peter Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted December 31, 2012 Administrators Share Posted December 31, 2012 It seems that XLS file is still in use. In next build I will modify code so you can send it even if file is still in use. Quote Link to comment Share on other sites More sharing options...
mierlp Posted December 31, 2012 Author Share Posted December 31, 2012 Thanks Farshad...would be nice Quote Link to comment Share on other sites More sharing options...
mmurgas Posted April 26, 2013 Share Posted April 26, 2013 Estimates, and had the same problem for some time, I could indicate if this problem had a solution? , Is used to export to excel so your help would be very valuable greetings and thanks mmurgas Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted April 26, 2013 Administrators Share Posted April 26, 2013 Estimates, and had the same problem for some time, I could indicate if this problem had a solution? , Is used to export to excel so your help would be very valuable greetings and thanks mmurgas You must make sure before you call SendFile export is completed and/or file is not opened exclusively by any other process. Quote Link to comment Share on other sites More sharing options...
mmurgas Posted April 27, 2013 Share Posted April 27, 2013 for me this code is correct, but I broke my head trying to export my data // Database if NOT dmArtist.Artist.Active then dmArtist.Artist.Active:=TRUE; // Excel export scExcelExport.DataSet:=dmArtist.Artist; scExcelExport.WorksheetName:='Artiesten'; scExcelExport.HeaderText.text:='Artiesten per ' +DateToStr(Date) ; scExcelExport.ExcelVisible:=false; try scExcelExport.ExportDataset; ExportFile:='Artiesten per ' +FormatDateTime('hhmmss', Time) ; scExcelExport.SaveAs(UniServerModule.FilesFolderPath+ExportFile,ffXLS) finally scExcelExport.Disconnect; // Save export UniSession.SendFile(UniServerModule.FilesFolderPath+ExportFile+'.xls', 'Artiesten.xls'); end; end; Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted April 27, 2013 Administrators Share Posted April 27, 2013 for me this code is correct, but I broke my head trying to export my data // Database if NOT dmArtist.Artist.Active then dmArtist.Artist.Active:=TRUE; // Excel export scExcelExport.DataSet:=dmArtist.Artist; scExcelExport.WorksheetName:='Artiesten'; scExcelExport.HeaderText.text:='Artiesten per ' +DateToStr(Date) ; scExcelExport.ExcelVisible:=false; try scExcelExport.ExportDataset; ExportFile:='Artiesten per ' +FormatDateTime('hhmmss', Time) ; scExcelExport.SaveAs(UniServerModule.FilesFolderPath+ExportFile,ffXLS) finally scExcelExport.Disconnect; // Save export UniSession.SendFile(UniServerModule.FilesFolderPath+ExportFile+'.xls', 'Artiesten.xls'); end; end; What error code or message do you receive? uniGUI version? What type of component scExcelExport is? Quote Link to comment Share on other sites More sharing options...
mmurgas Posted May 15, 2013 Share Posted May 15, 2013 Thanks Farshad finally perform the export as a file natively. CSV and it worked perfect. Here is the link (recommended at all) to perform this task Thanks for everything http://www.delphiaccess.com/forum/trucos-y-consejos-16/exportar-ado-a-csv/ Quote Link to comment Share on other sites More sharing options...
Ki Sung Kim Posted January 18 Share Posted January 18 There are Windows environments where the following applies. There's an environment that doesn't work. MimeTable.AddMimeType('gbr', 'gbr'); MimeTable.AddMimeType('pptx', 'pptx'); - the summit Windows 10 Pro - Problematic environment Windows Server 2016 Standard Ver : 1607 Whether there are other settings or what needs to be installed. Please let me know. Quote Link to comment Share on other sites More sharing options...
Ki Sung Kim Posted January 19 Share Posted January 19 I checked the log and it says Access Denied. I'll ask you where to check. hyper_server.exe: 00000778: 09:38:42 [HandleFileRequest[]]:Access denied: D:\HyperServer\bin64\cache\connectvd_exe\n1\1_t7l22QsIvY10BE53054\$$$\5.시스템분과_230112081142_230112090227_230119093822.PPTX. hyper_server.exe: 00000560: 09:39:16 [HandleFileRequest[]]:Access denied: D:\HyperServer\bin64\cache\connectvd_exe\n1\1_t7l22QsIvY10BE53054\$$$\[IATEC] BN41-02990B(22.03.04)_BOT_230118123313.GBR. Quote Link to comment Share on other sites More sharing options...
Ki Sung Kim Posted January 19 Share Posted January 19 If you change the extension to the A.pptx=>A.ppt file and upload it, it will download successfully. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 19 Share Posted January 19 1 hour ago, Ki Sung Kim said: There are Windows environments where the following applies. Hello, Where? What type of application, deployment? Quote Link to comment Share on other sites More sharing options...
Ki Sung Kim Posted January 19 Share Posted January 19 Hello The same symptoms appear in both OS environments. Please confirm. - Windows Server 2016 Standard Ver : 1607 - Windows Server 2008 R2 Enterprise Service Pack 1 ============================================================================================================ Uploading files is fine. No response when downloaded in edge environment. The server log file displays an "Access denied" log. hyper_server.exe: 00000778: 09:38:42 [HandleFileRequest[0.0.0.0]]:Access denied: D:\HyperServer\bin64\cache\connectvd_exe\n1\1_t7l22QsIvY10BE53054\$$$\5.시스템분과_230112081142_230112090227_230119093822.PPTX. hyper_server.exe: 00000560: 09:39:16 [HandleFileRequest[0.0.0.0]]:Access denied: D:\HyperServer\bin64\cache\connectvd_exe\n1\1_t7l22QsIvY10BE53054\$$$\[IATEC] BN41-02990B(22.03.04)_BOT_230118123313.GBR. ============================================================================================================= - enquiry . Check if regedit Path is wrong in Windows NT environment. I will ask you where and how to add it. It's urgent. Quote Link to comment Share on other sites More sharing options...
Ki Sung Kim Posted January 20 Share Posted January 20 There is a problem with the version of your Windows environment. Please tell me how to take action. - ppt file Not downloaded after pptx file upload Files with gbr extension will not be downloaded Quote Link to comment Share on other sites More sharing options...
Ki Sung Kim Posted January 20 Share Posted January 20 The gbr file is text. Changing the extension does not work Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 20 Share Posted January 20 Hello @Ki Sung Kim Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.