Creating file path in RTC

DekitoDekito Member Posts: 19
edited 2013-05-10 in NAV Three Tier
Hi,

SITUATION: I copy files from 'currentPath' to 'NewFilePath' (Text variables). The file paths are in a format like this example:
C:\My Folder\MyFile.txt.

PROBLEM: In Classic Client (v5.0) this works just fine, but in RTC the '\' char is recognized as a new line char.
Any suggestions which char to use for the RTC, or maybe some different approach?

10x in advance,
Dekito

Answers

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    may be that is not the case..

    Are you getting any error message?

    Is it a 3-tier environment or single system?
  • DekitoDekito Member Posts: 19
    Well I put some test messages in the way as I create the 'NewFilePath' and every '\' char is represented as a new line in the RTC message (in CC it's OK).

    It's a 3-tier environment.
    Dekito
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Where is your txt file located? in local system i.e., client system?

    I think you know this..
    RTC searches for file in service tier system where service is installed in 3-tier architecture..
    We have to upload local txt file to temp path in service tier system and download to local system again in new path..
  • DekitoDekito Member Posts: 19
    Maybe this will have some meaning: I work with record links. I copy the attached file to a new location and set the new file path in the record link.
    In RTC when I try to attach a link this way it signals an invalid path.

    When I attach a file without this functionality it works fine.
    Dekito
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Have a look at base reports 9171 and 9172 how they are working..
  • DekitoDekito Member Posts: 19
    Well 10x Mohana, you were right I needed to UPLOAD and DOWNLOAD the files.

    And it's recommended to use Codeunit 419 '3-Tier Automation Mgt.';
    functions 'SilentUpload' and 'DownloadToFile' will do the job.
    Dekito
  • maheshmahesh Member Posts: 115
    I'm also facing similar very issue but can't use upload or download function.

    I'm working in NAV2009 R2. I want to save report as PDF (using Bullzip PDF printer) and send it by email automatically.
    Report doesn't have RTC layout so it runs Classic report only from RTC & wants to print it using Bullzip printer.

    Problem is that It works perfectly in Classic Version but it considers '\' as new Line character in RTC.
    I need to give some file path to Bullzip printer to save file.

    Any solution please?

    Thanks,
    Mahesh Jain
    Best Regards,
    Mahesh Jain
    mahesh@reliconservices.com
  • Rob_HansenRob_Hansen Member Posts: 296
    What makes you think the RTC is interpreting '\' as a new line character? Is it because you're showing a message or confirm prompt to see the path and the path has line breaks there? That is a function of the way you're producing the message/confirm prompt...so what you see there does not reflect what the RTC is seeing for the path.

    If you're getting invalid path errors, look at where the logic is executing and code it accordingly. If it's executing on the server you can use the classic EXISTS and FILE.OPEN, etc. functions. If it's on the client, you need to upload and download, or use .net librairies instantiated client-side. In NAV 2013 there are functions for most things you will need to do client side in codeunit 419.
  • sbssbs Member Posts: 27
    Hi

    I had the same problem. The biggest problem was not the filename... but to run a classic report from code in rtc.
    I solved it by creating an RTC layout and then use the function REPORT.SAVEASPDF

    /sbs
    mahesh wrote:
    I'm also facing similar very issue but can't use upload or download function.

    I'm working in NAV2009 R2. I want to save report as PDF (using Bullzip PDF printer) and send it by email automatically.
    Report doesn't have RTC layout so it runs Classic report only from RTC & wants to print it using Bullzip printer.

    Problem is that It works perfectly in Classic Version but it considers '\' as new Line character in RTC.
    I need to give some file path to Bullzip printer to save file.

    Any solution please?

    Thanks,
    Mahesh Jain
  • maheshmahesh Member Posts: 115
    Thanks for reply.
    rdhansen wrote:
    What makes you think the RTC is interpreting '\' as a new line character?
    I'm able to get saved PDF file in specified path successfully in Classic without any message but Bullzip asks me where to save file in RTC.

    Below is my code to save report in PDF.
    IF ISCLEAR(BullZipPDF) THEN
    CREATE(BullZipPDF);

    FileDirectory := 'C:\PDF Email\';
    FileName := 'Invoice-' + "No." + '.pdf';

    FileName := FileDirectory+FileName;
    BullZipPDF.Init;
    BullZipPDF.LoadSettings;
    RunOnceFile := BullZipPDF.GetSettingsFileName(TRUE);
    BullZipPDF.SetValue('Output',FileName);
    BullZipPDF.SetValue('Showsettings', 'never');
    BullZipPDF.SetValue('ShowPDF', 'no');
    BullZipPDF.SetValue('ShowProgress', 'no');
    BullZipPDF.SetValue('ShowProgressFinished', 'no');
    BullZipPDF.SetValue('SuppressErrors', 'yes');
    BullZipPDF.SetValue('ConfirmOverwrite', 'no');
    BullZipPDF.WriteSettings(TRUE);

    SerInvHeader2 := Rec;
    SerInvHeader2.SETRECFILTER;
    REPORT.RUNMODAL(50014,FALSE,FALSE,SerInvHeader2);
    TimeOut := 0;
    WHILE EXISTS(RunOnceFile) AND (TimeOut < 10) DO BEGIN
    SLEEP(1000);
    TimeOut := TimeOut + 1;
    END;

    and when i accesss printed file to send email after printing in RTC, it gives me below error. where it seems '\' has been considered as new character. Above code works perfectly in Classic
    "Microsoft Dynamics NAV

    Attachment C:
    PDF Email
    Invoice-SEI-13-01018.pdf does not exist or can not be accessed from the program.
    OK

    My question is that
    Can Bullzip printer be used to print PDF report in RTC where report doesn't have RTC layout??
    If No then should i assume that SAVEASPDF is only solution to get PDF file of report in "RTC" ? Of course, i will have to create RTC layout to user SAVEASPDF.

    Best Regards,
    Mahesh Jain
    Best Regards,
    Mahesh Jain
    mahesh@reliconservices.com
  • sbssbs Member Posts: 27
    Hi

    I understand that You can´t run a classic report in code from RTC - and therefore you cant use bullzip :-(
    Its not fun to make the rtc-layout but you have to do it anyway sooner or later if they want to upgrade in the future :-)

    /sbs
Sign In or Register to comment.