Posts

Showing posts from February, 2021

OAF page to UPLOAD the data from excel sheet to the database table

Image
   UPLOAD BUTTON (logic below): Excel sheet column structure: Table Structure: Code inside Controller: public void processFormRequest(OAPageContext  pageContext,  OAWebBean    webBean) {      super.processFormRequest(pageContext, webBean);      OAApplicationModule  am = (OAApplicationModule)pageContext.getApplicationModule(webBean);      String   filename   = null;      String   fname       = null;      String   ext            = null;     pageContext.writeDiagnostics(this,"Inside PFR..",1);      if(pageContext.getParameter("UploadBtn") != null)   //ID of the Upload button       {                DataObject   upload  =  pageContext.getNamedDataObject("FileUpload");  //import oracle.cabo.ui.data.DataObject; //"FileUpload" is the ID of the item with style "messageFileUpload".                 try {                       filename = (String)upload.selectValue(null, "UPLOAD_FILE_NAME");                       int mid =  filename.lastIn