mierlp Posted December 27, 2012 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
AlbertoVesx Posted December 27, 2012 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
mierlp Posted December 27, 2012 Author 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
mierlp Posted December 30, 2012 Author 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
Administrators Farshad Mohajeri Posted December 31, 2012 Administrators 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
mmurgas Posted April 26, 2013 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
Administrators Farshad Mohajeri Posted April 26, 2013 Administrators 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
mmurgas Posted April 27, 2013 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
Administrators Farshad Mohajeri Posted April 27, 2013 Administrators 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
mmurgas Posted May 15, 2013 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
Ki Sung Kim Posted January 18, 2023 Posted January 18, 2023 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
Ki Sung Kim Posted January 19, 2023 Posted January 19, 2023 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
Ki Sung Kim Posted January 19, 2023 Posted January 19, 2023 If you change the extension to the A.pptx=>A.ppt file and upload it, it will download successfully. Quote
Sherzod Posted January 19, 2023 Posted January 19, 2023 1 hour ago, Ki Sung Kim said: There are Windows environments where the following applies. Hello, Where? What type of application, deployment? Quote
Ki Sung Kim Posted January 19, 2023 Posted January 19, 2023 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
Ki Sung Kim Posted January 20, 2023 Posted January 20, 2023 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
Ki Sung Kim Posted January 20, 2023 Posted January 20, 2023 The gbr file is text. Changing the extension does not work Quote
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.