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

  • #46
    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!

    Comment


    • #47
      Re: create XML from RPG read as EXCEL

      No 'blem.

      -M
      "Time passes, but sometimes it beats the <crap> out of you as it goes."

      Comment


      • #48
        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.

        Comment


        • #49
          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

          Comment


          • #50
            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.

            Comment


            • #51
              Re: create XML from RPG read as EXCEL

              Hi Deweys:

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

              GLS
              The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

              Comment


              • #52
                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?

                Comment


                • #53
                  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.

                  Comment


                  • #54
                    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
                    The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

                    Comment

                    Working...
                    X