Can RTC open Crystal report ?

SINOEUNSTEVENNEANGSINOEUNSTEVENNEANG Member Posts: 202
edited 2011-11-24 in NAV Three Tier
Can RTC open Crystal report ?
if can . could you please advise me how?

Waiting for your kindly reply ?

Comments

  • SogSog Member Posts: 1,023
    It cannot.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • SavatageSavatage Member Posts: 7,142
    It depends on what you want to do.

    Open it and pass parameters -> i've been struggling with that for years.

    But you can create a Link or attachment to the report(s) to simply open it.
    we use hyperlink & SHELL for example. RTC might do it differently...

    http://msdn.microsoft.com/en-us/library/dd301304.aspx

    we've also created out own table to hold all the paths of the crystal reports with a description field & open on a click.
    We made it ourselves but "links" are now standard in nav
    viewtopic.php?t=23783
  • ecokeyecokey Member Posts: 5
    Hello,


    First of all, nice to find this community here .

    I am now installing and setup Dynamics Nav in the company i work.
    And i had the same problem. Crystal Reports is way better then Navision reports.
    To start the report from RTC or Classic is not a big problem. The problem is to pass parameters to that report.

    So , i found/made the solution :

    I made an program that will pass the parameters to report. From NAV i execute the program with parameters ... then everything works like a charm.


    Here is the steps to make it done :

    1. Download this application : https://rapidshare.com/files/154355060/report.zip

    2. copy the report.exe from that zip to Classic and RTC folder
    Ex:
    C:\Program Files\Microsoft Dynamics NAV\60\RoleTailored Client
    and C:\Program Files\Microsoft Dynamics NAV\60\Classic
    This have to be done on every client.
    3. Open report.exe and set the path where the Crystal reports files are located (i recommend a network path). Then close the application report.exe
    4. NAV report setup :
    Create a new report.

    Set these Globals :
    Name / Data Type / Subtype / Length
    Vbs / OCX / ScryptControl Object /
    code1 / text / / 250
    tctCR / text / / 30
    params/ text / / 250


    Select the DataItem ( Ex: Sales Invoice Header - for a invoice)

    The code
    Sales Invoice Header - OnAfterGetRecord()
    //      params like : reportname parm1 param2 param3 
    //      use espace between params - reportname is allways the first param
    
            params := 'facture.rpt '+ "Sales Invoice Header"."No.";
    
     // --> execute script - do not modify
            Vbs.Language := 'VBScript';
            txtCR := '';
            txtCR[1] := 13;
            code1 := code1 + 'sub OpenFile()' + txtCR;
            code1 := code1 + 'dim objShell' + txtCR;
            code1 := code1 + 'Set objShell = CreateObject("Wscript.Shell")' + txtCR;
            code1 := code1 + 'strArgument = "report.exe " & chr(34) & _' + txtCR;
            code1 := code1 + '"'+params+'" & chr(34)' + txtCR;
            code1 := code1 + 'objShell.Run strArgument' + txtCR;
            code1 := code1 + 'set objShell = Nothing' + txtCR;
            code1 := code1 + 'End Sub'+ txtCR;
            Vbs.AddCode(code1);
            Vbs.ExecuteStatement('OpenFile()'+ txtCR );
     // <-- execute script - do not modify
    
Sign In or Register to comment.