Report to Dataport

idiotidiot Member Posts: 651
Is is possible to run a report & have that report call a dataport to export?
The dataport must not be exposed to the user, ie the user needs only to perform one step - preview the report.

On the report already specified:

MyDataport.IMPORT(FALSE);
MyDataport.FILENAME(MyPath);
MyDataport.SETTABLEVIEW(MyRec);
MyDataport.RUN; or MyDataport.RUNMODAL;

The system prompts could not find MyPath, which probably means the dataport is still preparing for import...
Anything missing in the steps?
NAV - Norton Anti Virus

ERP Consultant (not just Navision) & Navision challenger

Comments

  • krikikriki Member, Moderator Posts: 9,110
    -Best use RUNMODAL. The RUN runs the dataport and continues the report without waiting for the dataport to finish.
    -Probably you must put property UseReqForm to No on the dataport.
    -You must be sure the "MyPath"-file exists.

    What you mean with this? :
    The system prompts could not find MyPath
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • idiotidiot Member Posts: 651
    kriki wrote:
    ...
    -You must be sure the "MyPath"-file exists.

    Thanks for the pointers.

    If the file does not exist then this method will not work?
    MyPathFile will not exist, the system must be able to create it.
    Can a call to OutputFile.CREATE be avoided?
    The idea is to make use to the dataport's default ability to create the file when Export is selected.
    NAV - Norton Anti Virus

    ERP Consultant (not just Navision) & Navision challenger
  • krikikriki Member, Moderator Posts: 9,110
    idiot wrote:
    kriki wrote:
    ...
    -You must be sure the "MyPath"-file exists.

    Thanks for the pointers.

    If the file does not exist then this method will not work?
    MyPathFile will not exist, the system must be able to create it.
    Can a call to OutputFile.CREATE be avoided?
    The idea is to make use to the dataport's default ability to create the file when Export is selected.
    :oops: My error, I thought it was an import-dataport. For an output-dataport, it is not necessary that the file exists.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.