ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

create XML from RPG read as EXCEL

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • GLS400
    replied
    Re: create XML from RPG read as EXCEL

    How can I open the IFS file without the trailing blanks in the file name?
    you don't ...... if it can't be opened normally by you it can't be opened normally by anyone else.
    you need to name it correctly to begin with.


    you also need to delete the file with the space in the name.
    try using wild cards .... something like this (not tested and probably wrong)
    rmvlnk \mypath\*myfile.xml*

    Best of luck
    GLS

    Leave a comment:


  • JonBoy
    replied
    Re: create XML from RPG read as EXCEL

    Originally posted by deweys View Post
    Yes it does appear there is. How can I open the IFS file without the trailing blanks in the file name?
    The "normal" approach is to have the prototype that specifies the file name parm coded with Options(*String). That causes the RPG compiler to append X'00' to the end of the name string. I would then define the file name as a variable length field and ensure that trailing spaces are trimmed off when loading the field.

    Another option is to simple specify %TrimR(fileName) when you pass the parm.

    We can advise better if you show us the relevant prototype and the field definition.

    Leave a comment:


  • deweys
    replied
    Re: create XML from RPG read as EXCEL

    Originally posted by GLS400 View Post
    Hi Deweys:

    Just a guess but is there a space after .xml? {myfile.xml }

    GLS
    Yes it does appear there is. How can I open the IFS file without the trailing blanks in the file name?

    Leave a comment:


  • GLS400
    replied
    Re: create XML from RPG read as EXCEL

    Hi Deweys:

    Just a guess but is there a space after .xml? {myfile.xml }

    GLS

    Leave a comment:


  • JonBoy
    replied
    Re: create XML from RPG read as EXCEL

    Originally posted by deweys View Post
    ..., but when I try to open the file via EXCEL (or WORDPAD), Windows responds by saying it cannot find the file.

    ... Also, Windows Explorer doesn't list the file as an XML file. It's as if the system can't interpret the file as an XML file even through the extension is ".XML". Any ideas?

    Drew
    This is a bit contradictory. If you can see it in Explorer such that you can see it is not recognized (not that unusual in Explorer by the way) how can it not be found?

    If you can see it in Explorer then see if you can launch it in Excel from the Explorer context menu.

    Leave a comment:


  • deweys
    replied
    Re: create XML from RPG read as EXCEL

    I am using your program as the basis for creating a spreadsheet. I can create the XML file and can view it view the green screen, but when I try to open the file via EXCEL (or WORDPAD), Windows responds by saying it cannot find the file.

    I compared the XML file I generate against your sample and it looks similar. Also, Windows Explorer doesn't list the file as an XML file. It's as if the system can't interpret the file as an XML file even through the extension is ".XML". Any ideas?

    I am using EXCEL 2013.

    Thanks for any help.

    Drew

    Leave a comment:


  • JonBoy
    replied
    Re: create XML from RPG read as EXCEL

    Originally posted by soup_dog View Post
    LOL! I understand! Really I do! The only reason I am headed this way is because our largest customer (whose name rhymes with MalWart) wants us to send our quotes to them using an Excel spreadsheet that they have specifically designed and contains special formatting.

    I figured if I need to do it for them, I might as well provide the tools for other opportunities down the road.
    Actually the fact that someone else controls the design of the spreadsheet would make me go the CGIDEV2/XML template approach. Unless of course you are copying the base sheet supplied by the customer and then using the POI ability to update it. That would make sense.


    Jon P.

    Leave a comment:


  • littlepd
    replied
    Re: create XML from RPG read as EXCEL

    No 'blem.

    -M

    Leave a comment:


  • soup_dog
    replied
    Re: create XML from RPG read as EXCEL

    YAY!


    The POI approach is working. It isn't the friendliest front end for some of the junior programmers so I think I will put a nice generic front end on it. If it ends up being decent, I will post it for you.

    Thanks littlepd!

    Leave a comment:


  • kitvb1
    replied
    Re: create XML from RPG read as EXCEL

    Originally posted by vernond
    In my estimation it would take a user less time to create stylesheets than to continuously have developers farting about in the engine room because they've specified exactly the wrong shade of red on a negative number in the range 1.23 to 6.990004.
    I agree with vernond... we let our users mostly do what the want with the spreadsheet.
    Originally posted by soup_dog
    The only reason I am headed this way is because XXXX wants us to send our quotes to them using an Excel spreadsheet that they have specifically designed and contains special formatting.
    like Group as well. For this, we said "sod this for a laugh" and bought some software with which one can set up templates, workbooks, coloured cells, fonted cells, whatever the heart desires, and emails it as well. Best of all it doesn't cost an arm and a leg.

    Leave a comment:


  • itp
    replied
    Re: create XML from RPG read as EXCEL

    for a RPG native (non-Java) approach...

    Leave a comment:


  • soup_dog
    replied
    Re: create XML from RPG read as EXCEL

    Originally posted by vernond View Post
    Indeed, for the fancy bits it would probably be easier to work through POI. I purposely excluded formatting from my rpg to excel thingy 'cos that overhead is what I hate about using POI.

    Must confess I've not yet personally matured to the point where it is necessary to format cells and all and all. If the data is there then the users are free do what they will after the fact. I find it difficult to sell this idea though...

    In my estimation it would take a user less time to create stylesheets than to continuously have developers farting about in the engine room because they've specified exactly the wrong shade of red on a negative number in the range 1.23 to 6.990004.

    I guess I'm just not user-centric enough.

    LOL! I understand! Really I do! The only reason I am headed this way is because our largest customer (whose name rhymes with MalWart) wants us to send our quotes to them using an Excel spreadsheet that they have specifically designed and contains special formatting.

    I figured if I need to do it for them, I might as well provide the tools for other oppourtunities down the road.

    Leave a comment:


  • vernond
    replied
    Re: create XML from RPG read as EXCEL

    Indeed, for the fancy bits it would probably be easier to work through POI. I purposely excluded formatting from my rpg to excel thingy 'cos that overhead is what I hate about using POI.

    Must confess I've not yet personally matured to the point where it is necessary to format cells and all and all. If the data is there then the users are free do what they will after the fact. I find it difficult to sell this idea though...

    In my estimation it would take a user less time to create stylesheets than to continuously have developers farting about in the engine room because they've specified exactly the wrong shade of red on a negative number in the range 1.23 to 6.990004.

    I guess I'm just not user-centric enough.

    Leave a comment:


  • littlepd
    replied
    Re: create XML from RPG read as EXCEL

    Originally posted by soup_dog View Post
    Ok, here is a question for you. I want to move some of this functionality into a service program with calls like "AddWorksheet", "AddCell" etc etc etc...


    But I would like to add formatting options to each of these calls, which means I would like to tie the formatting to a particular cell in the spreadsheet instead of to a style sheet.

    What is the format for specifying the font, color, background, border, etc. etc. to a particular cell? (If it's possible.)
    Excel Spreadsheets from RPG with POI

    Leave a comment:


  • soup_dog
    replied
    Re: create XML from RPG read as EXCEL

    yeah, I think I'm going to need to do something like that. the only problem is I need to come up with any possible combination of bold, underline, italics, colors, fonts, etc that the user could possibly want.


    Which could be big! LOL

    Leave a comment:

Working...
X