Skip to main content
Solved

Read Excel on Cloud

  • April 15, 2021
  • 4 replies
  • 81 views

Forum|alt.badge.img+2

I wanted to know how is one supposed to take input from excel sheet when I publish my app on Cloud. I have tried uploading the excel sheet on cloud but I’m not sure how to locate the file on cloud and read data from that. Could you please guide me through this? Thanks.

I have attached some screenshots for your reference.

Best answer by mohansx

@vishweshpatil The FileSelect function will not work with WebUI apps.

Replace FileSelect with FileExists instead and your procedure should work. 

 

Also, make sure that you are opening the correct workbook in the procedure pr_readInputMasterDataFromExcel. 

 

You are checking for the file ``excelFileName`` but later on opening the file ``excelFileNameMaster``. 

 

In the upload widget procedure, you are copying the file to central storage with path ``sp_PublicDataExchangeFileName``. I think you should be checking the existance of this file and then open it to read data from it. 

 

if not FileExists(sp_PublicDataExchangeFileName) then

return;

endif;

 

axll::closeallworkbooks;

axll::openworkbook(sp_PublicDataExchangeFileName);

4 replies

Patrick
Administrator
Forum|alt.badge.img+6
  • Administrator
  • 54 replies
  • April 15, 2021

To upload an excel :https://documentation.aimms.com/webui/upload-widget.html and then act on the file through the standard AXLL functions.

https://how-to.aimms.com/Articles/85/85-using-axll-library.html
 

hope this helps


mohansx
Forum|alt.badge.img+5
  • Former AIMMSian
  • 223 replies
  • Answer
  • April 15, 2021

@vishweshpatil The FileSelect function will not work with WebUI apps.

Replace FileSelect with FileExists instead and your procedure should work. 

 

Also, make sure that you are opening the correct workbook in the procedure pr_readInputMasterDataFromExcel. 

 

You are checking for the file ``excelFileName`` but later on opening the file ``excelFileNameMaster``. 

 

In the upload widget procedure, you are copying the file to central storage with path ``sp_PublicDataExchangeFileName``. I think you should be checking the existance of this file and then open it to read data from it. 

 

if not FileExists(sp_PublicDataExchangeFileName) then

return;

endif;

 

axll::closeallworkbooks;

axll::openworkbook(sp_PublicDataExchangeFileName);


Forum|alt.badge.img+2
  • Author
  • AIMMS Partner
  • 1 reply
  • April 16, 2021

I also wanted to know, when we upload a file to cloud central storage vis upload widget (Eg:"pro:/PublicData/ExchangeFilename"), how can we access that file? Assuming it is an excel file and we need to read it via AXLL Library.


mohansx
Forum|alt.badge.img+5
  • Former AIMMSian
  • 223 replies
  • April 16, 2021

@vishweshpatil 

 

you are already using pro::SaveFileToCentralStorage to copy files on there. You can use the companion function pro::RetrieveFileFromCentralStorage to do the opposite. 

 

AIMMS PRO and Data Management — AIMMS Documentation



Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator