Add navigation to table reports

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Acknowledged
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.
Photo of Michael Graham | Insight Global UK

Posted 2 years ago

  • 0
  • 1
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
I'm not sure I understand the question. Or the situation.  Can you clarify?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,372 Points 20k badge 2x thumb
Yeah it was word salad to me too.
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? :)
(Edited)
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
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)
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.
By the way, in the example the report would ONLY be for a Blue section OR a Red section... just to make it clear.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,532 Points 20k badge 2x thumb
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
(Edited)
Photo of Gaurav Sharma

Gaurav Sharma

  • 5,756 Points 5k badge 2x thumb
Great. It will helpful :)
Dan, instead of the links can they refer to Formula Text Fields?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,532 Points 20k badge 2x thumb
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.
(Edited)
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 & ""
)
(Edited)
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,372 Points 20k badge 2x thumb
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.
(Edited)
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
(Edited)
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,372 Points 20k badge 2x thumb
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.
(Edited)
oh jeez I cant edit my comments to remove the links to the realm UGH!.
This isn't a good forum platform :(