NAV 2009 XMLport Export-not saving file to specified path

aleealee Member Posts: 6
edited 2011-08-26 in NAV Three Tier
Purpose: in RTC, run xmlport, export file to the one specified in code
issues:
1) it works but it seems to only work in direct call of the xmlport i.e.
OutFile.CREATE('c:\temp\exportfile.xml');
OutFile.CREATEOUTSTREAM(OutStream);
XMLPORT.EXPORT(50000, OutStream);
OutFile.CLOSE;

When run it in RTC, it creates the file c:\temp\exportfile.xml ok, however, it doesn't show the Required Filter Fields dialog box before run?! Am I doing something wrong?

Whereas
2) if I define the xmlport varible and call it like:
OutFile.CREATE('c:\temp\exportfile.xml');
OutFile.CREATEOUTSTREAM(OutStream);
XMLExportObj.SETDESTINATION(OutStream);
XMLExportObj.RUN;
OutFile.CLOSE;

In RTC, The Required Filter Fields Dialog box shows up, but then it doesn't recognize the specified file path. It totally ignores the Outfile lines of code (I could even comment those lines out, just call the XMLExportObj.RUN and it would still run correctly), but has to bring up the SAVE AS window common dialog (defaulting to c:\Documents & Settings\Networkservice\Local Settings\Temp folder).

Seems like I can't have both (filter dialog box and save export to the specified path without window common dialog) or is there something wrong with the RTC setup?

I'd spent many hours on the web and blogs, but not going anywhere. Would someone give me a pointer of what is going on? :-k many thanks in advance.

Comments

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    May I know from where you are calling this xmlport? (report/Codeunit)

    If it is report, you can give filter options in request form and pass them as a variable to xmlport.export
  • kinekine Member Posts: 12,562
    In my opinion it is by design.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • aleealee Member Posts: 6
    Ah, I didn't know I could call the XMLport from Report. I followed an article I found to create a CU for calling the xmlport. Thanks for the idea, I'll give it a try. :)
  • aleealee Member Posts: 6
    unless I misunderstood the use of a report calling the xmlport, I still need to assign an xmlport variable, then call it to set the filter before run, don't I? ... which again, the filter is not a problem on using an xmlport variable, it is the export file path designation. I even tried hard code the file path in the xmlport FILENAME property or using CURXMLPORT.FILENAME assignment in the calling agent (codeunit/report), it just plain ignore the Outfile, OUTSTREAM lines of code (as listed in the initial post of the issue) and all file path assigment when I use xmlport as an variable.

    I do, however, appreciate your time in giving me pointers and ideas. I welcome and will keep exploring workarounds, if there's any ... ](*,)
  • krikikriki Member, Moderator Posts: 9,116
    [Topic moved from 'Navision Financials' forum to 'NAV Three Tier' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.