EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only
Expand all | Collapse all

export data from grid to excel file

Discussion Topic

Discussion TopicThu May 21, 2015 07:07 AM

Discussion Topic

Discussion TopicThu May 21, 2015 07:18 AM

  • 1.  export data from grid to excel file

    Posted Thu May 07, 2015 07:30 AM

    Hello, 

    Is it possible to export data from datagrid egl to an excel file by clicking a button in a richui handler?

    Thanks 

    michaeldefox


  • 2.  Re: export data from grid to excel file

    Posted Thu May 07, 2015 11:32 AM

    I don't have a way to generate an excel on the frontend (rui), but I have encapsulated some parts of Apache POI library to generate excel files.

    I have immitated the ease of operation from a datagrid. (The function accepts an array of type any and an array of columns and returns the excel file)

     

    If you could find a way to do it in javascript, you might be able to do it in the frontend.

     

    Kind regards,

     

    Bram

    Bram_Callewaert


  • 3.  Re: export data from grid to excel file

    Posted Fri May 08, 2015 01:27 AM

    Is there a sample code  to understand Apache POI library and how you generated excel files?

    Thanks

    michaeldefox


  • 4.  Re: export data from grid to excel file

    Posted Fri May 08, 2015 01:46 AM

    Due to lack of time I'll just paste the code bits I currently use. It might be too complex, because we store the generated files on our as400 ifs and add references to the database. Retrieving the file is a separate process.

        function createExcelFromArray(arr any[] in, columns ExcelColumnRec[] in, filename string in, omschrijving string in, headerString String? in, laatsteRij String[] in) returns(decimal(8))        wb Workbook = new HSSFWorkbook();        createHelper CreationHelper = wb.getCreationHelper();        sheet Sheet = wb.createSheet("Pag 1");        rowCounter int = 0;         row Row = sheet.createRow(rowCounter);        if (headerString != null)            headerCs CellStyle = wb.createCellStyle();            headerCs.setAlignment(CellStyle.ALIGN_CENTER);             c Cell = row.createCell(0);                 c.setCellStyle(headerCs);                 c.setCellValue(createHelper.createRichTextString(headerString));                sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, columns.getSize() - 1));                 rowCounter += 1;                 row = sheet.createRow(rowCounter);         end                csDate CellStyle = wb.createCellStyle();        csDate.setDataFormat(createHelper.createDataFormat().getFormat("m/d/yy"));        csWrap CellStyle = wb.createCellStyle();        csWrap.setWrapText(true);                 for(i int from 1 to columns.getSize())            c Cell = row.createCell(i - 1);            c.setCellValue(createHelper.createRichTextString(columns[i].title));        end        for(i int from 1 to arr.getSize())                rowCounter += 1;             row = sheet.createRow(rowCounter);            for(j int from 1 to columns.getSize())                c Cell = row.createCell(j - 1);                waarde any = getCellValue(i, columns[j].name, arr);                 strval string;                 try                        strval = waarde;                                onException(exception AnyException)                                                                        end                case                    when(waarde isa date)                        c.setCellValue((waarde as date) + 1);                        c.setCellStyle(csDate);                    when(waarde isa date?)                        if((waarde as date?) == null)                            c.setCellValue(createHelper.createRichTextString(""));                        else                            c.setCellValue((waarde as date) + 1);                            c.setCellStyle(csDate);                        end                    when(waarde isa String[])                        sArr String[] = waarde as String[];                         s String;                         for (z int from 1 to sArr.getSize())                                if (z == 1)                                        s += sArr[z];                                else                                        s += "\n" + sArr[z];                                end                        end                        c.setCellValue(createHelper.createRichTextString(s));                        c.setCellStyle(csWrap);                     when(waarde isa string)                        s string = waarde;                        c.setCellValue(createHelper.createRichTextString(waarde));                    when(strval is numeric)                        c.setCellValue(waarde as int);                    otherwise                                ispunt boolean = false;                                 try                                                        q decimal(10,4) = waarde as decimal(10,4) + 1;                                    c.setCellValue(waarde as decimal(10,4));                                                onException(exception AnyException)                                                end                end             end        end        if (laatsteRij.getSize() != 0)                rowCounter += 1;             row = sheet.createRow(rowCounter);            for (i int from 1 to laatsteRij.getSize())                c Cell = row.createCell(i - 1);                s string = laatsteRij[i];                c.setCellValue(createHelper.createRichTextString(s));            end        end                for (i int from 1 to columns.getSize())                sheet.autoSizeColumn(i-1);         end                f File = new File(filename);        SysLib.writeStdout(f.getCanonicalPath());        fos FileOutputStream = new FileOutputStream(f);        wb.write(fos);        fos.java_close();                pdfFile File = new File(f.getCanonicalPath());        bestandTypeRec UIBestandTypeRec{};        bestandTypeRec = BestandLib.getBestandType(0); // geentype        bestand UIBestandExtRec{bestandrec = new UIBestandRec{DatumWijz = datetimelib.currentTimeStamp(), omschr = omschrijving, origBestandNaam = filename, extensie = "xls"}, types =[bestandTypeRec                ]};        BestandLib.addBestand(bestand);        fDest File;        if(GeneralOperations.getHostname() == "AS40071.MOL.LOCAL")            fDest = new File(FileBasicOperations.movePathToQNC(bestand.bestandrec.pad));        else            fDest = new File(bestand.bestandrec.pad);        end        FileBasicOperations.copyFile(pdfFile, fDest);        FileBasicOperations.removeFile(pdfFile);        return(bestand.bestandrec.id);    end

     

    This requires the following classes from Apache Poi

    • Cell
    • CellRangeAddress
    • CellStyle
    • CreationHelper
    • HSSFWorkbook
    • Row
    • Sheet
    • Workbook

    to be created as external types like this:

    externaltype Cell type JavaObject{packageName = "org.apache.poi.ss.usermodel", javaName = "Cell"}    function setCellValue(value boolean in);         function setCellValue(text RichTextString in);        function setCellValue(value float in);                 function setCellStyle(style CellStyle in);         end
    Externaltype CellRangeAddress extends CellRangeAddressBase type JavaObject{packageName = "org.apache.poi.ss.util", javaName = "CellRangeAddress"}    constructor(firstRow int in, lastRow int in, firstCol int in, lastCol int in); end
    Externaltype CellStyle type JavaObject{packageName = "org.apache.poi.ss.usermodel", javaName = "CellStyle"}            static ALIGN_CENTER smallint;                 function setDataFormat(format smallint in);        function setWrapText(wrapped boolean in);        function setAlignment(alignment smallint in);   end
    externaltype CreationHelper type JavaObject{packageName = "org.apache.poi.ss.usermodel ", javaName = "CreationHelper"}            function createRichTextString(text String in) returns (RichTextString);        function createDataFormat() returns (DataFormat); end
    externaltype HSSFWorkbook extends POIDocument, Workbook type JavaObject{packageName = "org.apache.poi.hssf.usermodel", javaName = "HSSFWorkbook"}    constructor();         end
    externaltype Row type JavaObject{packageName = "org.apache.poi.ss.usermodel", javaName = "Row"}    function createCell(column int in) returns (HSSFCell); end
    externalType Sheet type JavaObject{packageName = "org.apache.poi.ss.usermodel", javaName = "Sheet"}     function createRow(rowNum int in) returns (HSSFRow);        function addMergedRegion(region CellRangeAddress in);        function autoSizeColumn(column int in);  end
    externaltype Workbook type JavaObject{packageName = "org.apache.poi.ss.usermodel", javaName = "Workbook"}    function getCreationHelper() returns (CreationHelper);        function createSheet(name String in) returns (HSSFSheet);        function write(outStream OutputStream in);              function createCellStyle() returns (CellStyle); end
    ExternalType OutputStream extends Object type JavaObject{packageName = "java.io", javaName = "OutputStream"}    function flush();        function java_close(){JavaName = "close"};end
    ExternalType FileOutputStream extends OutputStream type JavaObject{packageName = "java.io", javaName = "FileOutputStream"}    constructor(pad String in);        constructor(f File in);end

    This is a quick example, just let me know if I can help refine it or translate some of the variable names.

     

    Kind regards,

    Bram

    Bram_Callewaert


  • 5.  Re: export data from grid to excel file

    Posted Fri May 08, 2015 01:47 AM

    and of course you will need the apache poi jar in your project.

    Bram_Callewaert


  • 6.  Re: export data from grid to excel file

    Posted Mon May 11, 2015 06:51 AM

    Could you explain me the input arguments of this function:

        function createExcelFromArray(arr any[] in, columns ExcelColumnRec[] in, filename string in, omschrijving string in, headerString String? in, laatsteRij String[] in) ?

     

    And which file I should download from this site https://poi.apache.org/download.html#POI-3.11?

    Thanks

    michaeldefox


  • 7.  Re: export data from grid to excel file

    Posted Mon May 11, 2015 07:25 AM

    Hi Michael,

     

    arr is an array of records (cast to type any). this is similar to the data parameter of the DataGrid

    columns is an array of ExcelColumnRec's, similar to the DataGridColumn on a DataGrid. It specifies which field in the record (from the first parameter) is to be put in this column.

    filename is used to define the name of the generated file.

    omschrijving is Dutch for description. I believe it is only used for adding the file to the database, but has no real impact on the generation of the file.

    headerString is a text put at the top of the excel file. it is put in a cell spanning all columns.

    laatsterij is Dutch for lastRow. it is an array of texts to put on the last row of the excel file. I use this for displaying totals.

     

    Kind regards,

     

    Bram

    Bram_Callewaert


  • 8.  Re: export data from grid to excel file

    Posted Mon May 11, 2015 07:35 AM

    Thanks a lot!

    Sorry but which file I should download from this site https://poi.apache.org/download.html#POI-3.11?

    Thanks

    michaeldefox


  • 9.  Re: export data from grid to excel file

    Posted Mon May 11, 2015 08:19 AM

    the bin zipped files contain the packaged jar files required.

    the src zipped files would require you to build the jars yourself. --> I recommend the bin file

    You can choose .zip or .tar.gz

    I believe .zip wil be easiest.

     

    Kind regards,

     

    Bram

    Bram_Callewaert


  • 10.  Re: export data from grid to excel file

    Posted Tue May 12, 2015 02:20 AM

    Hi Bram,

    what do you mean by:

    This requires the following classes from Apache Poi

    • Cell
    • CellRangeAddress
    • CellStyle
    • CreationHelper
    • HSSFWorkbook
    • Row
    • Sheet
    • Workbook

    to be created as external types like this:

    I have copied your external types in to my project and added the poi jar to my java buildpath..

    But i get the error 'can not be resolved', please take a look at the screenshot.

     

    Marcel-D

    Attachments



  • 11.  Re: export data from grid to excel file

    Posted Tue May 12, 2015 08:52 AM

    Hi Marcel,

     

    I forgot to mention the dependency classes, which also have to be coded as an externaltype.

    I have added the sources in attachment

    Bram_Callewaert


  • 12.  Re: export data from grid to excel file

    Posted Tue May 12, 2015 09:38 AM

    Thank you very much Bram!!!

    But what about the type 'File' ?

     

    Kind regards!

    Marcel-D

    Attachments



  • 13.  Re: export data from grid to excel file

    Posted Wed May 13, 2015 03:48 AM

    Sorry, it's an externaltype dependency from another package. It's not so easy to spot when everything is set up.

    Here's the code:

    package com.molcy.webservices.externaltypes.java.io;externalType File extends Object type JavaObject{packageName = "java.io", javaName = "File"}    constructor(pad String in);        function exists() returns (boolean);        function getCanonicalPath() returns (String);        function length() returns (bigint);        function getName() returns (String);end

    Please let me know if I missed something.

    Bram_Callewaert


  • 14.  Re: export data from grid to excel file

    Posted Wed May 13, 2015 04:36 AM

    Hi Bram,

    thank you for your help!

    Only the "getCellValue" function and the "FileBasicOperations" externaltype is missing.

    Marcel-D


  • 15.  Re: export data from grid to excel file

    Posted Wed May 13, 2015 05:30 AM

    Thanks for being patient with me. Here are the missing bits.

    This is in the same file as the excel function:

        private function getCellValue(row int in, fieldName string in, data any[] in) returns(any)        object any = data[row];        if(object == null)            return("");        end        velden String[] = getTokens(fieldName, ".");                try                        veldnaam String = velden[1];                        b any = data[row][velden[1]];                        for (i int from 2 to velden.getSize())                                b = b[velden[i]];                                veldnaam = velden[i];                        end                        case                                 when (b isa String[])                                         return (b as String[]);                                 otherwise                                        return (b);                        end                        //veldwaarde String = b as String;                        //return (b);                onException(exception AnyException)                        SysLib.writeStdout(exception.message);                         return ("");                end        end                private function getTokens(source String in, delimiter String in) returns (String[])                max int = strLib.byteLen(source);                i int = 1;                 tokens String[0];                 token String? = "";                 // end processing when the getNextToken function returns a null                while(i < max && token != null)                   token = StrLib.getNextToken(source, i, delimiter);                   if (token != null)                              tokens.appendElement(token);                   end                end                return (tokens);         end

     

     

    FileBasicOperations is a custom Externaltype (meaning I created the java code, not a library, so you need to add the file below in EGL, and the next under the "Java Resouces/src"

    package com.molcy.webservices.externaltypes.java.io;externalType FileBasicOperations type JavaObject{packageName = "com.molcy.fileoperations", javaName = "FileBasicOperations"}            static function copyFile(fSource File in, fDest File in);                static function removeFile(rFile File in);                static function movePathToQNC(winPad String in) returns (String);                static function MovePathToWindows(as400Pad String in) returns (String);                static function movePathToTmp(winPad String in) returns (String);                static function getExtension(pad String in) returns (String);                static function getFilePathsInFolder(pad String in) returns (String[]);                static function zipIt(zipPad String in, bestandpaden String[] in, namen String[] in);end

     

    package com.molcy.fileoperations;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.util.ArrayList;import java.util.List;import java.util.zip.ZipEntry;import java.util.zip.ZipOutputStream;import org.apache.commons.io.FileUtils;import org.apache.commons.io.FilenameUtils;import org.apache.commons.io.filefilter.TrueFileFilter;public class FileBasicOperations {            public final static void copyFile (File fSource, File fDest){                try{                        InputStream in = new FileInputStream(fSource);                                          //For Append the file.                        //  OutputStream out = new FileOutputStream(f2,true);                        //For Overwrite the file.                        OutputStream out = new FileOutputStream(fDest);                        System.out.println("starting copy");                        byte[] buf = new byte[1024];                        int len;                        while ((len = in.read(buf)) > 0){                                out.write(buf, 0, len);                        }                        System.out.println("copy finished");                        in.close();                        out.close();                        //System.out.println("File copied.");                } catch(FileNotFoundException ex){                        System.out.println(ex.getMessage() + " in the specified directory.");                        //System.exit(0);                } catch(IOException e){                        System.out.println(e.getMessage());                  }                    }                public final static void removeFile(File rFile){                rFile.delete();        }                                                public static String movePathToQNC(String origPath) {                return origPath.replace("\\", "/").replace("//mol.local/Intern/Documenten/", "/QNTC/Molcy15/");        }                public static String MovePathToWindows(String origPath) {                return (origPath.replace("/QNTC/Molcy15/", "//mol.local/Intern/Documenten/").replace("/", "\\"));        }                public static String movePathToTmp(String origPath) {                return origPath.replace("\\", "/").replace("//mol.local/Intern/Documenten/", "/tmp/");        }        public static String getExtension(String path){                        return (FilenameUtils.getExtension(path));                /*                int dotInd = path.lastIndexOf('.');        String extension = (dotInd > 0 && dotInd < path.length()) ? path.substring(dotInd + 1) : null;                return (extension);                */        }                    public static List<String> getFilePathsInFolder(String rootpath){                List<String> retval = new ArrayList<String>();                File rootDir = new File(rootpath);                List<File> bestanden = (List<File>) FileUtils.listFiles(rootDir, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);                for (File f : bestanden){                        try {                                retval.add(f.getCanonicalPath());                        } catch (Exception e) {                                System.out.println("Fout bij opzoek van pad voor een van de bestanden");                        }                }                return retval;        }                public static void zipIt(String zipPad, List<String> bestandPaden, List<String> namen) {                byte[] buffer = new byte[1024];                try {                        FileOutputStream fos = new FileOutputStream(zipPad);                        ZipOutputStream zos = new ZipOutputStream(fos);                        //System.out.println("Output to Zip : " + zipPad);                        //int i;                         for (int i = 0; i<bestandPaden.size(); i++){                        //for (String file : bestandPaden) {                                //System.out.println("File Added : " + namen);                                try {                                        //String extension = FilenameUtils.getExtension(bestandPaden.get(i));                                        ZipEntry ze = new ZipEntry(namen.get(i));// + "." + extension);                                        //System.out.println("adding from file " + bestandPaden.get(i) + " to " + namen.get(i));                                        zos.putNextEntry(ze);                                        FileInputStream in = new FileInputStream(bestandPaden.get(i));                                        int len;                                        while ((len = in.read(buffer)) > 0) {                                                zos.write(buffer, 0, len);                                        }                                        in.close();                                } catch (Exception e) {                                        System.out.println("Fout bij toevoegen van bestand " + bestandPaden.get(i) + " " + e.getMessage());                                }                        }                        zos.closeEntry();                        zos.close();                        System.out.println("Done");                } catch (IOException ex) {                        ex.printStackTrace();                }        }                        }

     

    The FileBasicOperations contains some other functions as well (like zipping a bunch of files)

    I tried to quickly scan the code for other required files. Give me a shout if I missed something.

    Kind regards,

     

    Bram

    Bram_Callewaert


  • 16.  Re: export data from grid to excel file

    Posted Wed May 13, 2015 07:17 AM

    Hi,

    tank you for your time.

    i think it's complete now.

    But which type is the file which contains the excel and the getcellvalue function?!

     

    Kind regards!

    Marcel-D


  • 17.  Re: export data from grid to excel file

    Posted Thu May 14, 2015 01:51 AM

    Where do you call function  createExcelFromArray in project?

    And where should I put all external types and where I should define java classes like class FileBasicOperations? I m a little confused. 

    I should create a new package in the service project and put all egl files there?

    Thanks.

    michaeldefox


  • 18.  Re: export data from grid to excel file

    Posted Thu May 14, 2015 04:22 AM

    Hi Michael and Marcel,

    I realize my posts above might be confusing. I didn't have the time to create a complete working example, so I tried to post some code snippets.

    The urgent problems at work are fixed now, and with two holidays in Belgium, I've made some time to create a separate project for you to try.

    I've also removed the code to store the file in a database (which simplifies things a bit). You will still need to find a way to get the file from the webserver to the end-user. Let me know if you need help with this.

    I hope this creates some clarity. Let me know if you want some more details.

     

    Kind regards,

     

    Bram

    Bram_Callewaert


  • 19.  Re: export data from grid to excel file

    Posted Thu May 14, 2015 04:25 AM

    Just some small comment. I've had a lot of difficulties posting on this forum the last couple of days.

    Today I had some problems uploading the project. I therefore removed the FDA7.jar from the lib folder to reduce the file size.

    Please copy the fda7.jar from another web project into the webcontent/web-inf/lib folder.

    Bram_Callewaert


  • 20.  Re: export data from grid to excel file

    Posted Thu May 14, 2015 09:48 AM

    Bram,

    I want to thank you for all your contributions to the forum and in helping other customers.  The sharing you and others do is invaluable.

     

    Mark

    markevans


  • 21.  Re: export data from grid to excel file

    Posted Thu May 14, 2015 10:02 AM

    I created a service project from your zip file but I don't know how can I test it. Could you give more info, please? And is it the right way to create it as service project ?

    I get these errors in egl genetarion results:

     Generating part OfficeServices with build descriptor OfficeServicesWebBuildOptions from file \OfficeServices\EGLSource\OfficeServices.eglbld.
    The project OfficeServices specified as the genProject must be a web project.
     Generation failed for OfficeServices.

     

    I found that you have to define filePath variable but what should I put?

     

    Thanks 

    michaeldefox


  • 22.  Re: export data from grid to excel file

    Posted Fri May 15, 2015 08:26 AM

    Hi Michael,

    I would select file - import , and then select the root directory where you extracted the zip file.

    I had to remove the web.xml file and the generated sources (everything under eglgen/javasource folder) when I wanted to deploy on tomcat instead of websphere liberty profile.

    The filepath is the path to where you would like to store the file. eg. c:\test.xls for windows or /tmp/test.xls on linux.

     

    Kind regards,

     

    Bram

    Bram_Callewaert


  • 23.  Re: export data from grid to excel file

    Posted Mon May 18, 2015 01:40 AM

    I tested the ExcelService.wsdl file with Web service explorer but i get that error when I put the path:

    IWAB0135E An unexpected error has occurred.404Not Found

     

    michaeldefox


  • 24.  Re: export data from grid to excel file

    Posted Mon May 18, 2015 02:53 AM

    What web server did you run your program on and on what port is it running?

    The wsdl uses port 10 000, because that's where our web server runs on.

    Bram_Callewaert


  • 25.  Re: export data from grid to excel file

    Posted Mon May 18, 2015 04:39 AM

    I use Websphere server and I 've changed port to mine.

    michaeldefox


  • 26.  Re: export data from grid to excel file

    Posted Mon May 18, 2015 04:43 AM

    I developed and tested the project on Tomcat.

    Have you changed the target runtime of the project to point to your websphere server?

    Have you removed the web.xml and the generated Java sources, and then cleaned?

     

    Kind regards,

     

    Bram

    Bram_Callewaert


  • 27.  Re: export data from grid to excel file

    Posted Wed May 20, 2015 05:22 AM

    How can I change the target runtime of the project ?

    michaeldefox


  • 28.  Re: export data from grid to excel file

    Posted Wed May 20, 2015 05:26 AM

    right-click the project, then under target runtime select the appropriate server runtime.

    Bram_Callewaert


  • 29.  Re: export data from grid to excel file

    Posted Wed May 20, 2015 07:46 AM

    After I test it with web services explorer and put  c:\test.xls what will be the output? I should see something in this file ?

    And what about the value of status ? 

    michaeldefox


  • 30.  Re: export data from grid to excel file

    Posted Thu May 21, 2015 02:10 AM

    There should be an excel file in the location you spicified.

    Is your websphere running on windows?

    I don't know what you mean by "the value of status".

    Bram_Callewaert


  • 31.  Re: export data from grid to excel file

    Posted Thu May 21, 2015 02:41 AM

    I forgot the screenshot

    Bram_Callewaert

    Attachments



  • 32.  Re: export data from grid to excel file

    Posted Thu May 21, 2015 07:07 AM

    This status here. (see the screenshot)

     

    PS: Maybe it is wrong to create OfficeServicesWeb. tell me if it will cause me trouble.  And I m running on Windows. Thanks

    michaeldefox

    Attachments



  • 33.  Re: export data from grid to excel file

    Posted Thu May 21, 2015 07:12 AM

    This means the service is not running on the address http://localhost:9082/OfficeServices.
    The service did not run.

    There could be a lot of reasons why it didn't.

    Have you got any experience with web services through EGL?

    Bram_Callewaert


  • 34.  Re: export data from grid to excel file

    Posted Thu May 21, 2015 07:18 AM

    How can I configure the address?

    michaeldefox


  • 35.  Re: export data from grid to excel file

    Posted Thu May 21, 2015 07:19 AM

    Where is websphere running and on what port?

    Did you run the application on websphere?

    Bram_Callewaert


  • 36.  Re: export data from grid to excel file

    Posted Thu May 21, 2015 07:29 AM

    9082 is my profile and i 'm running the project on websphere.

    michaeldefox


  • 37.  Re: export data from grid to excel file

    Posted Thu May 21, 2015 08:17 AM

    Did you get any errors in the generation log or build log?

    Is the server running on the same machine as your rbd installation?

    Bram_Callewaert


  • 38.  Re: export data from grid to excel file

    Posted Thu May 21, 2015 08:24 AM

    Yes generation completed for OfficeServices with no errors and yes for the server. How can I see the build log?

     

    michaeldefox


  • 39.  Re: export data from grid to excel file

    Posted Thu May 21, 2015 08:29 AM

    Sorry, I meant Deployment log.

    what do you see when you got to the following url with your web browser:

    http://localhost:9082/OfficeServices/services

    It should display a list of available web services and their functions. If it doesn't display then the service is not running on your web server. That should first be corrected. Perhaps the web server logs will give you more information.

    Bram_Callewaert


  • 40.  Re: export data from grid to excel file

    Posted Thu May 21, 2015 08:33 AM

    Do I have to deploy this service project to see the results? I only generate the service project. and link(http://localhost:9082/OfficeServices/services)

      gives me that :

    SRVE0255E: A WebGroup/Virtual Host to handle /OfficeServices/services has not been defined.

    SRVE0255E: A WebGroup/Virtual Host to handle localhost:9082 has not been defined.

    IBM WebSphere Application Server

    if I must deploy the project I have to create a web file project, right?

    michaeldefox


  • 41.  Re: export data from grid to excel file

    Posted Thu May 21, 2015 08:37 AM

    If you clean the project it should generate entires in the deployment log.

    I don't think it is necessary to deploy the project.

    It should however be run on a webserver, so right-clicking the project and selecting "run on server" is required.

    Bram_Callewaert


  • 42.  Re: export data from grid to excel file

    Posted Thu May 21, 2015 08:43 AM

    As what type do I run the project?

    michaeldefox


  • 43.  Re: export data from grid to excel file

    Posted Thu May 21, 2015 08:45 AM

    It should be a web project

    Bram_Callewaert


  • 44.  Re: export data from grid to excel file

    Posted Thu May 21, 2015 09:18 AM

    Error 404: com.ibm.ws.webcontainer.servlet.exception.NoTargetForURIException: No target servlet configured for uri: /OfficeServices/services

    I get this error now.

    michaeldefox


  • 45.  Re: export data from grid to excel file

    Posted Thu May 21, 2015 09:26 AM

    I'm afraid I can't really solve this via the forum. The problem you are having is with getting the service running on your Websphere installation. Perhaps you could try tomcat and the project as I supplied it in a separate workspace.

     

    Have you used webservices before on your websphere installation?

     

    Bram_Callewaert


  • 46.  Re: export data from grid to excel file

    Posted Fri May 22, 2015 03:00 AM

    Is there a useful guide to understand the whole process for the websphere server?

    michaeldefox


  • 47.  Re: export data from grid to excel file

    Posted Fri May 22, 2015 07:04 AM

    I only found this:

    http://www-01.ibm.com/support/knowledgecenter/SSMQ79_9.1.1/com.ibm.egl.richui.sql.tutorial.doc/topics/egl_richui_sql_abstract.html

    but it's for tomcat.

    The process for Websphere is very similar.

    Perhaps somebody from IBM can point you to a tutorial that's more suited for your needs.

     

    kind regards,

     

    Bram

    Bram_Callewaert


  • 48.  Re: export data from grid to excel file

    Posted Mon May 25, 2015 02:30 AM

    Thanks for the guide.

    Do you have any idea about these errors in the screenshot?

    Thanks

     

     

    michaeldefox

    Attachments



  • 49.  Re: export data from grid to excel file

    Posted Tue May 26, 2015 02:31 AM

    It gives an error on your class.

    Is it generated under EGLGen/JavaSource?

    Bram_Callewaert