1. shoaib siddiqui
  2. PowerServer Mobile (Obsolete)
  3. Friday, 18 May 2018 15:14 PM UTC

 

I have some constant data rows that I want to display from CSV file, and I have included CSV file  in the bundle during deployment in "additional files" tab.

It works fine in desktop but cannot  read from file in app because I am not sure whats the current path in IPad environment

it in the the datawindow constructor code...

SetPointer(hourglass!)
string ss_path, ss_filename = '\matl_list.csv'
ss_path = GetCurrentDirectory ( )
if ss_path>'' then
else
ss_path = "\appeon\hisample"
end if
ss_filename =ss_path + ss_filename
This.Importfile(ss_filename , csv!)
SetPointer(Arrow!)
 
Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 18 May 2018 15:24 PM UTC
  2. PowerServer Mobile (Obsolete)
  3. # Permalink

Hi Shoaib;

   In PowerServer Web and/or Mobile, you cannot use the GetCurrentDirectory() method. Instead, have a look at the of_getcachedir ( ) method in the "AppeonExtfuncs " object instead. You can get more information on his in the PowerServer Help.

HTH

Regards ... Chris

Comment
  1. shoaib siddiqui
  2. Friday, 18 May 2018 15:32 PM UTC
Thanks Chris.

  1. Helpful
  1. shoaib siddiqui
  2. Friday, 18 May 2018 15:59 PM UTC
So If bundle  a CSV or text file in a app(during deployment wizard), how do I access it at run time in the code. 

For example if I want to Import that file in a datawindow, what would be the path ?

  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 18 May 2018 17:28 PM UTC
The the of_getcachedir ( ) method should give you the files location. Depending on the way you deploy your CSV files, they could also be in the "PlugIn" sub-folder. Again, there is more information on this in the PS Help file.



FYI ...



    appeonextfuncs        lo_appeon                                                                            // Load Appeon interface

    lo_appeon            =    CREATE  appeonextfuncs                                                        // Instantiate it

    is_appl_path        =  lo_appeon.of_getcachedir ( )

    IF  go_ac.of_get_client_type( ) = "MOBILE" THEN                                                        // Mobile?

        is_appl_path    +=    "/"                                                                                        // YES=>Set Mobile Separator

    else

        is_appl_path    +=    "\"                                                                                        // NO=>Set DOS Separator

    END IF

  1. Helpful
There are no comments made yet.
Andres Slachevsky Accepted Answer Pending Moderation
  1. Friday, 18 May 2018 15:23 PM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 1

The file directory in iOS and Android is different from that of Windows, therefore, the directory functions such as ChangeDirectory, CreateDirectory, DirectoryExists, RemoveDirectory etc. are unsupported.
have toy try to use the Appeon FileServer for that?

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.