I am making an application which first imports the data from the Excel file and then uses it in the deployment of a CDF. But is it possible to change the data of the Excel file and see its corresponding CDF without executing the code in the notebook?
I have imported y1 and y2 from an excel file. Here is the code.
CDFDeploy[
ToFileName["C:\\Users\\murali\\Desktop","demo2thomson.cdf"],
{DynamicModule[{y =
Import["C:\\Users\\murali\\Desktop\\demo.xlsx"], y1 = y[[1, 1]], y2 = y[[1, 2]], q1, q2},
Panel@Column[{Spacer[70] Text[
Style["iPhone and iPad quarterly sales- units, million", Bold,
18]], Column[{Spacer[70],
Text[Style["Click on/off:", Bold, 14]], q1 = True; q2 = True;
Row[{Labeled[
Button[" ", q1 = ! q1, Background -> Blue,
Appearance -> "Frameless"], "iPhone", {Right}],
Spacer[19],
Labeled[Button[" ", q2 = ! q2, Background -> Orange,
Appearance -> "Frameless"], "iPad", {Right}]}],
Column[{Dynamic@
BarChart[
Table[{If[q1, y1[[i]], 0], If[q2, y2[[i]], 0]}, {i, 1, 22,
1}], BarSpacing -> 0.8, ChartStyle -> {Blue, Orange},
ImageSize -> {600, 280},
GridLines -> {None, Automatic}]}]}]}]]}]
I am importing these values just as default and want that the end user can change these values. i.e.
I don't want the end user to go to the code and execute again and again if he wants to change some of the values of y1 and y2.
Is it possible that he can change value and see the difference in the CDF itself?
FileNameJoin[{"C","Users","murali","Desktop","demo2thomson.cdf"}]
instead ofToFileName
. This makes sure your code works the same on OSX, Linux and windows. Additionally, it's better to make the path relative to the directory where your application resides in usingNotebookDirectory[]
. $\endgroup$FileDate
(to check when a file was last modified) andCreateScheduledTask
(toImport
the file if it has been changed). I'll try to post an answer later on. $\endgroup$Import
will return$Failed
if used within cdf player with a local file. I think it is possible toImport
from a public URL, but you would have to test that (I haven't). If the receipient does have a full Mathematica or a PlayerPro this is actually not really a CDF specific question and you might get more people interested if you ask forImport
within aDynamicModule
which all comments and answers so far do actually treat (only). $\endgroup$