Options

Menu Item & Hyperlink

SavatageSavatage Member Posts: 7,142
edited 2009-11-26 in Navision Attain
I have a bunch of Crystal Reports that I now have on a request Form. When i check it , it will run the report.

Anyway, just thinking about cleaning it up a bit so I was thinking about
Menu Buttons and adding the report names as the menu items.

An easy solution was if I could add a hyperlink code to the menu item but it appears I cannot. I can do a RunSystem and make the run command the report name & location But Now it wan't me to figure out all the proper '~1' squiggy's that come running system commands.

c:\docume~1\Crysta~1\ etc etc etc

Anybody know any other workaround to adding a hyperlink to a menu item?

Answers

  • Options
    rj5570rj5570 Member Posts: 157
    curious, what version of crystal ar eyou running, and what are you using to view the reports in?
    - So it Goes.
  • Options
    SavatageSavatage Member Posts: 7,142
    Ver 9.2.0.448

    What I did was create a phoney report call it "Crystal Reports" #50000

    Lets say I have a "new item" report I made in crystal.
    I go to designer of report 50000, View->Globals, no dataitem
    Add 1 Variable type Boolean
    B_NewItemReport
    then go into functions and add 1 function for this report
    F_NewItemReport (I name them the same other than the B&F so it's easier to find when you have 100's of reports)

    OnPreReport I Add
    If B_NewItemReport Then F_NewItemReport;
    

    Then scroll down to the function F_NewItemReport and add a HYPERLINK to the report of the location of the save report.
    HYPERLINK('M:\Crystal Reports\Inventory Reports\NewItem.RPT');
    

    Then View The requests Form of the report (Make It BIG, Screen Size)
    Click the toolbox & Drop On A CheckBox & Label.
    The Label you make the name of the report "New Item Report"
    On the SourceExp of the Checkbox you put the boolean for that report B_NewItemReport

    Save the report. Now when you run it the request form appears . you check off that report click OK and the report will open, Just repeat the steps to keep adding reports.

    Here's an old look at it from years ago. I have added many more since then.
    http://www.geocities.com/navision_attai ... eports.pdf

    It would be great to create a Mneu Button "Accounts Payable" for example then enter all the payable report in the menu item for that and have it hyperlink to the correct file..that's why I throwing it out there to see if anyone knew of a way.
  • Options
    DenSterDenSter Member Posts: 8,304
    How about you create a new table 'Crystal Reports', and you store the paths to the reports in a text field, and you create a form that hyperlinks to the stored path, and you can put code to browse to the file in an assistedit button. You could have a 'report type' field or something like that to categorize them, maybe even a table "Crystal Report Category".

    It's too bad you can't add code to menusuite items, so the trick is to figure out a generic way to open something from any area of the app.
  • Options
    SavatageSavatage Member Posts: 7,142
    Nice idea, one of the benefits of the chck boxes is that I can check off a number of them and on OK they all open instead of keeping going back and doing one at a time.

    I'll play around with the stored path table!
  • Options
    SavatageSavatage Member Posts: 7,142
    Ok so for a quick test - I created a table called "Crystal Reports" #50005
    I added some fields
    Catagory-option
    frequency-option
    name-code 100
    path=text 250
    open=boolean
    key on catagory&name

    filled in the info
    created a form Crystal Reports List which show all the table info.
    on the Openfield of the form I added

    OnPush()
    HYPERLINK(Path);
    "Crystal Reports".GET(Catagory,Name);
    CLEAR("Crystal Reports".Open);
    "Crystal Reports".MODIFY;
    

    Now I click a report & It opens - nice easy clean
    see here:
    http://savatage99.googlepages.com/Cryst ... anksDe.doc

    should be thanks denster but i guess the name was too long :D

    So in conclusion - it would be great if you could hyperlink from a menu item but no dice!

    An easy table with a list type form can accomplish a similar goal
    Actually it can used for any outside Nav file you need to access. from Word docs, excel files, pictures, etc. maybe adding one more option field for that!
    Word, Excel, Crystal, Photo, PDF etc. to help organize & filter with
  • Options
    SavatageSavatage Member Posts: 7,142
    in addition, so you don't have to manually type in the PATH just add

    Variable=CommonDlgMgt=type codeunit #412
    add to the On AssistEdit of the Path Field on the FORM!
    Path := CommonDlgMgt.OpenFile( FIELDCAPTION( Path), Path, 4, '*.*', 0);

    I also threw in another field call "last run date"
    that updates to the workdate onpush of the "open" field.

    it's pretty cool now!
  • Options
    DenSterDenSter Member Posts: 8,304
    That's just awesome, you really made the idea your own. When I posted that I was thinking that you could do all sorts of things with it. Very cool work Harry :mrgreen:. I've been trying to think of a way to make it more dynamic, but I don't know if it's possible at all to include parameters on menusuite items.
  • Options
    SavatageSavatage Member Posts: 7,142
  • Options
    SavatageSavatage Member Posts: 7,142
    It's really grown to be a hold everything area for us. With just a few changes you have an area for linked attachments
    http://www.mibuso.com/forum/viewtopic.php?t=23783
  • Options
    xtinextine Member Posts: 3
    Hi Savatage, thanks for your solution its really help me to view the Crystal Report. But i have a problem when i using the Ver5 instead of ver3.6.
    And when i trying your solution in ver5, it doesnt work. can u suggest what another solution for me?

    Thanks in advance.
    Savatage wrote:
    Ver 9.2.0.448

    What I did was create a phoney report call it "Crystal Reports" #50000

    Lets say I have a "new item" report I made in crystal.
    I go to designer of report 50000, View->Globals, no dataitem
    Add 1 Variable type Boolean
    B_NewItemReport
    then go into functions and add 1 function for this report
    F_NewItemReport (I name them the same other than the B&F so it's easier to find when you have 100's of reports)

    OnPreReport I Add
    If B_NewItemReport Then F_NewItemReport;
    

    Then scroll down to the function F_NewItemReport and add a HYPERLINK to the report of the location of the save report.
    HYPERLINK('M:\Crystal Reports\Inventory Reports\NewItem.RPT');
    

    Then View The requests Form of the report (Make It BIG, Screen Size)
    Click the toolbox & Drop On A CheckBox & Label.
    The Label you make the name of the report "New Item Report"
    On the SourceExp of the Checkbox you put the boolean for that report B_NewItemReport

    Save the report. Now when you run it the request form appears . you check off that report click OK and the report will open, Just repeat the steps to keep adding reports.

    Here's an old look at it from years ago. I have added many more since then.
    http://www.geocities.com/navision_attai ... eports.pdf

    It would be great to create a Mneu Button "Accounts Payable" for example then enter all the payable report in the menu item for that and have it hyperlink to the correct file..that's why I throwing it out there to see if anyone knew of a way.
  • Options
    SavatageSavatage Member Posts: 7,142
    So you're using my "Old Way" and not using the "New Way" which is to create a table to store all the reports?

    Please specify. I see the solution should work as long as Hyperlink is supported by Nav.

    Old Way:
    http://www.geocities.com/navision_attai ... eports.pdf
    New Way:
    http://savatage99.googlepages.com/Cryst ... anksDe.doc

    New way allows for unlimited reports and add new ones with just a few clicks
  • Options
    xtinextine Member Posts: 3
    Dear Savatage,
    Thanks for your information.
    i have retry again to use ur solution for the new version.

    Overall its OK for opening another file except Crystal Report File.
    It shows errors
    "C/SIDE hyperlinking failed."
    "You tried to hyperlink to this target:"
    "C:\Documents and Settings\ABC\My Documents\Report1.rpt"

    "Do you want to place the hyperlink target on the clipboard?"

    When i tried to choose eiter Yes or No, it doesnt shows anything.

    But when i tried to open the path with another file, so called PDF file, its work.

    Can u give me an advise?

    Thanks in advance.
  • Options
    SavatageSavatage Member Posts: 7,142
    It's Strange once in a while I get the hyperlink message for various things like tracking a package in eship. Usually a restart of my computer fixes the problem.

    The copy to clipboard message simply allows you to open explorer and paste into the address bar.
  • Options
    garakgarak Member Posts: 3,263
    if you have a problem with hyperlink, u can also use WSHShell.Run().

    Regards
    Do you make it right, it works too!
  • Options
    facklerafacklera Member Posts: 1
    How do i create a hyperlink with an image to place on other sites? I want to create an image with an embedded hyperlink in it. It should be 1" / 2" in size. 1 inch in height and 1 inch wide. Thanks!
    _______________________
    yahoo keyword tool ~ overture ~ traffic estimator ~ adwords traffic estimator
Sign In or Register to comment.