PDF CREATOR WITH NAVISION APPLICATION SERVER

vsalot
vsalot Member Posts: 47
Hello!!!!

I am trying to run the below code using NAS. But no PDF file is getting generated. Pls suggest.

The same code is working fine while running the same directly from Classic Client.

IF ISCLEAR(PDFCreator) THEN
CREATE(PDFCreator);

IF ISCLEAR(PDFCreatorError) THEN
CREATE(PDFCreatorError);

filedir := 'D:\';
filename := 'Finish Goods Stock';
PDFCreatorError := PDFCreator.cError;

IF PDFCreator.cStart('/NoProcessingAtStartup',TRUE) = FALSE THEN
ERROR('Status: Error: ' + PDFCreatorError.Description);
filename1 :=CONVERTSTR(FORMAT(filename),'.','_');
fn := CONVERTSTR(FORMAT(filename1),'/','_');
attachlocation := 'D:'+'\'+fn+'.pdf';

PDFCreatorOption := PDFCreator.cOptions;
PDFCreatorOption.AutosaveDirectory := filedir;
PDFCreatorOption.AutosaveFilename := fn;
PDFCreatorOption.UseAutosave := 1;
PDFCreatorOption.UseAutosaveDirectory := 1;
PDFCreatorOption.AutosaveFormat := 0;
PDFCreator.cOptions := PDFCreatorOption;
PDFCreator.cClearCache();
DefaultPrinter := PDFCreator.cDefaultPrinter;
PDFCreator.cDefaultPrinter := 'PDFCreator';
PDFCreator.cPrinterStop := FALSE;
REPORT.RUNMODAL(50084,FALSE,TRUE,Item);

Thanks,

Comments

  • ara3n
    ara3n Member Posts: 9,258
    make sure the nas user is local admin on the box and nas is running on same box where pdfcreator is installed.
    Also make sure you are using the same creator version.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • vsalot
    vsalot Member Posts: 47
    Thanks Rashed!!

    I have checked all the settings. Everything seems perfect. But still no result with NAS..
  • jup
    jup Member Posts: 7
    Did you try to run the report from the Classic Client, but with the NAS user?
    -- Jup --
  • ara3n
    ara3n Member Posts: 9,258
    start the nas from CMD prompt and see if it works.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • kine
    kine Member Posts: 12,562
    Sometime there is problem with the functionality checking new version of PDF Creator. You need to disable it, else it could stuck on the dialog opened when PDFCreator is started (the "There is new version of PDF Create, do you want to download it..." or something similar).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ScottJones
    ScottJones Member Posts: 44
    I have the same issue ](*,) ... Did you manage to resolve? I have already disabled updates.
  • ara3n
    ara3n Member Posts: 9,258
    did you try and start nas from command prompt?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • ScottJones
    ScottJones Member Posts: 44
    Just tried stopping my service, ran NAS in a command prompt. It ran picked up the job queue entry but still no joy.

    (The command prompt window show the MESSAGE('Running report') I put in the code so i can see it executed the code to run the report)

    PDFCreator never generated the .pdf file in my subdirectory on server. It's like the PDFCreator isn't intercepting the print job.