Discussions

 View Only
Expand all | Collapse all

Add navigation to table reports

_anom Diebolt)

_anom Diebolt)04-08-2017 07:02

Gaurav Sharma

Gaurav Sharma04-08-2017 12:03

  • 1.  Add navigation to table reports

    Posted 04-08-2017 06:38
    I have navigation buttons on my forms and would like to have them on reports as well.
    It's not practical to embed them in the actual report.


  • 2.  RE: Add navigation to table reports

    Posted 04-08-2017 07:01
    I'm not sure I understand the question. Or the situation.  Can you clarify?


  • 3.  RE: Add navigation to table reports

    Posted 04-08-2017 07:02
    Yeah it was word salad to me too.


  • 4.  RE: Add navigation to table reports

    Posted 04-08-2017 07:46
    I have formula buttons that I use for navigation to go from forms to pages or reports.
    I want to be able to put the same buttons on reports.

    I know I can add the buttons into the report against each record but then I would have a navigation button for every record in the report.  - Is that more understandable? :)


  • 5.  RE: Add navigation to table reports

    Posted 04-08-2017 07:53
    The the navigation button applies to that record, then yes you will have that.  But if you are looking for other "report" navigation options, I'd recommend using the "Favorites" option to pin your reports to the top, no matter where you are in the app.

    As far as navigating to a "page"... Rather than cluttering up the report, I'd just keep those page buttons on your home dashboard.  
    Alternatively, if you really want them on the report I'd recommend using a small icon as the button to go to said page (it will take up less room that way)


  • 6.  RE: Add navigation to table reports

    Posted 04-08-2017 08:03
    The navigation to show on reports is important.  
    There are basically 3 different places a user might want to go. 
    The buttons are not all the same but depend on a value on the report.
    e.g.
    go to the Blue section when a field in the report is Blue Agent
    go to the Red section when a field in the report is Red Agent.

    This all works and I can have a button on each record but its unnecessary and clutters things up as you say.

    Buttons somewhere at the top of the report would do the trick.


  • 7.  RE: Add navigation to table reports

    Posted 04-08-2017 08:04
    By the way, in the example the report would ONLY be for a Blue section OR a Red section... just to make it clear.


  • 8.  RE: Add navigation to table reports

    Posted 04-08-2017 09:37
    Use BOL with code similar to this:

    Pastie Database
    https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=571

    This code display all three buttons. If you want to display only one button based on some criteria you have to detect that criteria in the script. In the same sense that you do not want to place these buttons on every row in the report, stating that 

    "The buttons are not all the same but depend on a value on the report."

    does not direct me to which record or field contains the magic value that determines which buttons to display or where they lead to.





    Notes

    (1) Since you are using BOL you have to detect the dbid and action (and perhaps the qid and/or dfid)

    (2) This code uses ES6 backticks to conveniently enter the markup over multiple lines and interpolate variables within


  • 9.  RE: Add navigation to table reports

    Posted 04-08-2017 12:03
    Great. It will helpful :)


  • 10.  RE: Add navigation to table reports

    Posted 04-08-2017 09:46
    Dan, instead of the links can they refer to Formula Text Fields?


  • 11.  RE: Add navigation to table reports

    Posted 04-08-2017 09:55
    I am having trouble understanding you. In terms of functionality, a button is a hyperlink. Click it and  the browser goes to a new URL.

    "I have navigation buttons on my forms and would like to have them on reports as well. "

    When a button is on a form it has the context of a specific  [Record ID#]. But there is no record context when you are displaying a report - there are a whole bunch or records being displayed.

    So both in terms of which field is in context and which record is in context I don't understand what logic you want to use to decide which button to place on the top of the report or where it leads.

    You have to put more effort into defining your question clearly.


  • 12.  RE: Add navigation to table reports

    Posted 04-08-2017 10:03
    This is one button that determines which Section to go to.   How would I implement this using your code?

    var text ImageSix = "https://realm and DBID here/g/rd6/eg/va/Rover200-25-MGZRIcon.jpg height=35;>";var text ImageSeven = "https:///realm and DBID here/up/bkttbjwpm/g/reg/eg/va/Rover400-45-MGZSIcon.jpg height=35;>";
    var text ImageEight = "https://realm and DBID here/up/bkttbjwpm/g/reh/eg/va/Rover600-RHIcon.jpg height=35;>";
    var text ImageNine = "https:///realm and DBID here/up/bkttbjwpm/g/rd7/eg/va/MetroIcon.jpg height=35;>";
    var text ImageTen = "https:///realm and DBID here/up/bkttbjwpm/g/reb/eg/va/Rover75-MGZTIcon.jpg height=35;>";
    var text ImageEleven = "https:///realm and DBID here/up/bkttbjwpm/g/rd5/eg/va/CityRoverICon.jpg height=35;>";
    var text ImageTwelve = "https:///realm and DBID here/up/bkttbjwpm/g/rej/eg/va/Rover800-RSIcon.jpg height=35;>";
    var text ImageThirteen = "https://realm and DBID here/up/bkttbjwpm/g/rei/eg/va/Rover800-RS-91Icon.jpg height=35;>";
    var text ImageFourteen = "https:///realm and DBID here/up/bkttbjwpm/g/rea/eg/va/MiniIcon.jpg height=35;>";
    var text ImageFifteen = "https:///realm and DBID here/up/bkttbjwpm/g/ref/eg/va/Rover200-400-XWIcon.jpg height=35;>";
    var text ImageSixteen = "https:///realm and DBID here/up/bkttbjwpm/g/ree/eg/va/Rover200-400-XW-CabIcon.jpg height=35;>";
    var text ImageSeventeen = "https:///realm and DBID here/up/bkttbjwpm/g/rd8/eg/va/MGF_MGTFIcon.jpg height=35;>";
    var text ImageEighteen = "https:///realm and DBID here/up/bkttbjwpm/g/rd9/eg/va/MGTFIcon.jpg height=35;>";
    var text ImageTwentytwo = "https://realm and DBID here/up/bkttbjwpm/g/rec/eg/va/Rover75V8-MG-ZT260Icon.jpg height=35;>";


    var text URLSIX = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=6";
    var text URLSEVEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=7";
    var text URLEIGHT = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=8";
    var text URLNINE = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=9";
    var text URLTEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=10";
    var text URLELEVEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=11";
    var text URLTWELVE = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=12";
    var text URLTHIRTEEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=13";
    var text URLFOURTEEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=14";
    var text URLFIFTEEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=15";
    var text URLSIXTEEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=16";
    var text URLSEVENTEEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=17";
    var text URLEIGHTEEN = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=18";
    var text URLTWENTYTWO = URLRoot() & "db/" & Dbid() & "?a=showpage&pageid=22";

    If (
    [Vehicle Range]=8777, "" & $ImageSix & "",
    [Vehicle Range]=26318, "" & $ImageSeven & "",
    [Vehicle Range]=35479,"" & $ImageEight & "",
    [Vehicle Range]=50613,"" & $ImageNine & "",
    [Vehicle Range]=60277,"" & $ImageTen & "",
    [Vehicle Range]=65806,"" & $ImageEleven & "",
    [Vehicle Range]=41989,"" & $ImageTwelve & "",
    [Vehicle Range]=48657,"" & $ImageThirteen & "",
    [Vehicle Range]=55462,"" & $ImageFourteen & "",
    [Vehicle Range]=16519,"" & $ImageFifteen & "",
    [Vehicle Range]=25447,"" & $ImageSixteen & "",
    [Vehicle Range]=3,"" & $ImageSeventeen & "",
    [Vehicle Range]=67803,"" & $ImageEighteen & "",
    [Vehicle Range]=5549,"" & $ImageTwentytwo & ""
    )


  • 13.  RE: Add navigation to table reports

    Posted 04-08-2017 10:08
    You are missing my point.

    Your formula evaluates for every record presumable to a different value. So when viewing a report your formula will be listed multiple times - one for each record - and  presumably the button will lead to a different URL for each record. 

    So when you suggest that you want to put three buttons on the top of a report, what logic is involved in defining those three buttons?


  • 14.  RE: Add navigation to table reports

    Posted 04-08-2017 10:29
    No, the report will actually only show ONE of the Vehicle Ranges in each report.
    But the button is on every report and will go the section based on which Vehicle Range is in the report.  Does that make sense?


  • 15.  RE: Add navigation to table reports

    Posted 04-08-2017 10:33
    Nope it is still confusing.

    The only way some field could have a common value among all records in a report is if was included in the report's criteria (eg {fid.EX.foo}) or if there was only one record total in the report. Is that the case here?


  • 16.  RE: Add navigation to table reports

    Posted 04-08-2017 10:43
    The report is filtered by Vehicle Range.


  • 17.  RE: Add navigation to table reports

    Posted 04-08-2017 10:43
    So in a Report ALL the vehicle ranges are the same.


  • 18.  RE: Add navigation to table reports

    Posted 04-08-2017 10:56
    Well I would then assume that the field [Vehicle Range] is not being displayed in the report as a column because it would have a constant value throughout the entire column if it was displayed and this is the same issue you are complaining about with regard to having a column of buttons all with the same value.

    To get this common value of [Vehicle Range] I would perform a query through jQuery. It would basically be the same query of the instant report but using the API and setting the clist to only return  [Vehicle Range] .

    So if this was the URL of the report displayed in the address bar (and accessible in script through document.location.href):

    https://relam.quickbase.com/db/xxxxxxxx?a=q&qid=13

    You would form this URL instead:

    https:/realm.quickbase.com/db/xxxxxxxx?act=API_DoQuery&qid=13&clist=42&options=num-1

    Note that the act is different, a clist is added to return only [Vehicle Range] field (fid=42 here) and return only the first record (all the records have the same [Vehicle Range] value allegedly).

    Extract the value of [Vehicle Range] and wrap an if statement around the code I previously posted to determine which button[s] should be displayed.


  • 19.  RE: Add navigation to table reports

    Posted 04-08-2017 11:02
    In this LINK - Instead of a column of car buttons which go to the same place (always) I would like ONE link at the top.  

    https:///realm and DBID here?a=q&qid=46


  • 20.  RE: Add navigation to table reports

    Posted 04-08-2017 11:18
    Something like this should give you the value of [Vehicle Range] within the script:

    var dbid = "bkspmi7n9"; var apptoken = "your apptoken here"; $.ajaxSetup({data: {apptoken: apptoken}}); $.get(dbid, {   act: "API_DoQuery",   qid: "46",   clist: "159",   options: "num-1" }).then(function(xml) {   console.dirxml(xml);   console.log("section= " + $("section", xml).text()); });
    You can test it by displaying that report, filling in your apptoken, and pasting it into the console. If it works add this code to the prior script and make the needed integration, logic and parameter changes.

    Beyond that contact me off-world if you need additional help. The forum is not well suited for detailed debug sessions like this and I have grander projects to work on.


  • 21.  RE: Add navigation to table reports

    Posted 04-08-2017 11:25
    OK Thanks Dan


  • 22.  RE: Add navigation to table reports

    Posted 04-08-2017 11:26
    oh jeez I cant edit my comments to remove the links to the realm UGH!.
    This isn't a good forum platform :(