Difference between revisions of "Spreadsheets in ACP1 - Old"
(Created page with "Spreadsheet functions that read from and write data to Excel in Analytica can also be used in ACP. This means that models in ACP can read from and write data to Excel spreadsh...") |
|||
Line 11: | Line 11: | ||
SpreadsheetOpen(filename, ''showDialog'') | SpreadsheetOpen(filename, ''showDialog'') | ||
− | If a spreadsheet with the appropriate ''filename'' is present in the ACP folder, then ACP will | + | If a spreadsheet with the appropriate ''filename'' is present in the ACP folder and the «showDialog» parameter is either omitted or set to False, then ACP will open the spreadsheet without prompting the user to upload the spreadsheet file. If there is no spreadsheet present matching the filename parameter or if «showDialog» is set to ''True'', ACP will ask the user if they would like to upload a spreadsheet that will be opened after uploading. This spreadsheet is then uploaded to ACP with its existing filename in the same directory as the model. Like in Desktop Analytica, the user does not have to select a spreadsheet with the same filename as the «filename» parameter but after the session is ended Analytica will not remember any filenames aside from what is used in the «filename» parameter. |
Unlike Desktop Analytica, ACP will only prompt a user to upload a spreadsheet once per session. If you would like Analytica to prompt a user multiple times, the definition of the SpreadsheetOpen() variable must be reset. For example, if Va1 calls SpreadsheetOpen(), you can create a duplicate of Va1 called Va2 and use a button script to set the definition of Va1 as the definition Va2 like so: | Unlike Desktop Analytica, ACP will only prompt a user to upload a spreadsheet once per session. If you would like Analytica to prompt a user multiple times, the definition of the SpreadsheetOpen() variable must be reset. For example, if Va1 calls SpreadsheetOpen(), you can create a duplicate of Va1 called Va2 and use a button script to set the definition of Va1 as the definition Va2 like so: |
Revision as of 10:47, 4 April 2015
Spreadsheet functions that read from and write data to Excel in Analytica can also be used in ACP. This means that models in ACP can read from and write data to Excel spreadsheets that have been uploaded to ACP. If the appropriate spreadsheet is not found, ACP can prompt the user to upload a spreadsheet. ACP can also allow the user to download spreadsheets straight from the model.
For more information about spreadsheet functions in Desktop Analytica, please see: Functions To Read Excel Worksheets Functions to Write Data to Excel Worksheets
Reading Spreadsheets in ACP
ACP will process the SpreadsheetOpen() function just like in Desktop Analytica, except the «showDialog» parameter will instead determines whether Analytica will prompt the user to upload a spreadsheet:
SpreadsheetOpen(filename, showDialog)
If a spreadsheet with the appropriate filename is present in the ACP folder and the «showDialog» parameter is either omitted or set to False, then ACP will open the spreadsheet without prompting the user to upload the spreadsheet file. If there is no spreadsheet present matching the filename parameter or if «showDialog» is set to True, ACP will ask the user if they would like to upload a spreadsheet that will be opened after uploading. This spreadsheet is then uploaded to ACP with its existing filename in the same directory as the model. Like in Desktop Analytica, the user does not have to select a spreadsheet with the same filename as the «filename» parameter but after the session is ended Analytica will not remember any filenames aside from what is used in the «filename» parameter.
Unlike Desktop Analytica, ACP will only prompt a user to upload a spreadsheet once per session. If you would like Analytica to prompt a user multiple times, the definition of the SpreadsheetOpen() variable must be reset. For example, if Va1 calls SpreadsheetOpen(), you can create a duplicate of Va1 called Va2 and use a button script to set the definition of Va1 as the definition Va2 like so:
Definition of Va1: SpreadsheetOpen('example.xls',True) Definition of Va2: SpreadsheetOpen('example.xls',True) OnClick for Reset Button Definition of Va1 := Definition of Va2;
After pressing the Reset button, the user will be able to upload a new spreadsheet when Va1 is evaluated regardless if a spreadsheet has already been uploaded.
Downloading Spreadsheets in ACP
To download a spreadsheet in ACP, simply add "download_spreadsheet" to the CloudPlayerStyles Attribute of a button. When the button is pressed in ACP, a pop-up will open that redirects the user to download the open spreadsheet file.
Enable comment auto-refresher