rmarkdown: how to display & number only the current tab in TOC - tabs

I have three questions regarding a markdown document (rendered as html) with several tabs using {.tabset} and a numbered table of contents. The tabs are relatively big chapters.
A. The biggest problem is that the toc shows the content of all tabs, whereas I would like the toc to only display the current tab and hide the tabs which are currently blended out. It seems that I´m not the only one looking for such a solution: Rmarkdown toc for tabbed content (only showing corresponding headings) or Rmarkdown : is it possible to display the TOC of the current tab only in a tabset - but the solutions seem to not work anymore, also for other users.
(I unfortunately can´t comment any of those, hence asking separately)
B. Furthermore, when using a numbered toc, the numbering keeps on going from tab A to tab B and only then to the rest of the document, e.g.:
1.1 = preface
1.2 = workflow in tab A
1.3 = workflow in tab B
1.4 = resources
--> whereas the numbering should ignore the tab which is currently blended out (i.e. 1.3 = resources no matter which tab is on) - is there a possibility of doing it?
C. One last question is about numbered sections using tabset: {.tabset} requires using two section levels: one # for the selection section and a second level ## for each tab:
# Project Type {#Type .tabset .tabset-fade .unnumbered}
## Type A
`r preface`
`r Project_workflow_A`
## Type B
`r preface`
`r Project_workflow_B`
--> consequently, when using numbered sections within the tabs, those sections would have to be at least at level three ###, even though they should basically be level one or two --> any ideas for workarounds? (besides using different documents instead of tabs?)
I tried playing around quite a lot with the arguments and googling, but I believe I´m missing out on something essential. Any ideas for working directions would be welcome!
Thanks a lot in advance!

Related

Compactly exploring many combinations of parameters in Rmarkdown

Sometimes I want to run part of my code many times with varying parameters and display the results for easy comparison. For example, suppose I have logical parameters x, y, and z, and I want to compare the output (perhaps a table or plot) of somefunction(x,y,z) for each combination of values.
The options I know about for doing this all have drawbacks:
Just display each run one after the other. But there may be many parameters with many possible values, and scrolling back and forth is undesirable if you want to specifically jump between multiple outputs that vary only along a single parameter.
With shiny, you can make an app with controls for each parameter. This lets you switch back and forth more freely, but shiny is a nonstarter because it's very hard to share shiny apps with non-R-savvy people. Plus, I'd like to put this in an Rmarkdown report.
You can embed shiny controls in an Rmarkdown document, but then (afaik) you have to have an R session running in the background as part of the document - it's basically a shiny app that looks like an Rmarkdown document. Still can't just send someone an HTML report and trust they can just open it in their browser. Also, overkill because I don't really need a code backend, just a way to switch between already-generated static results at will.
Rmarkdown allows you to treat subheadings as tabs (via {.tabset}). No code backend needed, just a compact way of viewing static results. This works if I only have one parameter I'm varying. If I have two, I can nest tabset subheadings, but I can't easily switch between the top row of tabs and keep the parameter options the same on the bottom rows.
Ideally, there would be a way to use something like a set of radio buttons or other shiny-style controls in an Rmarkdown document to control what is currently displayed, without having to run an R session inside the document. That would mean the logic of the controls would be handled in the html, rather than in R - clearly something that's possible at one level, but I don't know enough html to know if it can be down with multiple levels.
Is it possible to do this?

SSRS not rendering all page breaks in PDF export

I have a report is ssrs, it consist of a main report which has a header containing the page number and 2 sub reports (report page 1 and report page 2) within a tablix. Report page one comes first, then report page 2 displays on the next page after the end of report page 1. The subreports can be anywhere from 1-3 pages. The page numbering is reset between each set of report page 1 and 2 (so if page 1 is 3 pages and page 2 is 2 pages, it goes from page 1-5, then resets). These are called for each record (with grouping) from the main reports' query. The report is around 1000 pages total. It renders perfectly on screen, but when I try to export to PDF, it will sometimes (like 1 time in the 1000 pages) display part of report page 2 on a page (as expected, the page number matches with it), then it will start printing report page 1 of the next group on the same page.
Here is the layout of the main report:
Here is the document outline for better understanding:
And here is the page that is wrong...
This is what it should look like (the last page of sub-report page 2 even has just the total record like the broken one!
I have tried everything I can think of. I have tried (i think) every combination of page breaks on the rectangles and groups, I have tried making a tablix with 2 rows using the same group and again tried every combination of page breaks. I have tried changing the number of records on a page. I have tried changing the consume whitespace option on both sub and main reports. I have tried adding both calculated and random amounts of white space. I have recreated the report from scratch a couple times. I'm sure there's more, but it would be like going through a full feature list of SSRS... Basically, I tried everything I could think of, then everything suggested in the links on the first page of about 10 different google searches. I just have no idea what is going on with this, any help would be greatly appreciated!
Let me know if you need any more info, screenshots, or whatever and I will try to provide. It may be highly "redacted", but I will provide anything I can.
Thanks, Kevin
Try check the setting "Between each instance of a group" in group properties of tablix.
Try checking your XML for empty TablixRows (which will not show up in the Document Outline). I found with my report that empty tablix rows screw up page breaks in subsequent rows / sub reports when exported to PDF. Where possible hide the TablixRows or insert and empty text box.
This appears to be a bug with SSRS when editing the XML by hand. The Visual Studio GUI seems to not let you delete the last element in a row - perhaps this is a work around. An error or schema validation message would have been nice for us hand coders!
Hope this helps.

Dynamically changing component reference

This seems simple enough but I can't quite think of how to actually do it...
In IBM Web Content Management (WCM) version 7 I have a Presentation Template (PT) which calls a Menu Component to display some content items.
I also have some (static) links on the sidebar which I want to basically just change the menu component that is being used, and that's it.
So for example...
In the PT:
[Component name="Main Page"]
When I click on a link, I want the exact same PT to be displayed except I want it to use:
[Component name="Next Page"]
Basically, Main Page and Next Page are showing the same content items, they just have different filters on them (so they appear to be different pages). The "Main Page" shows "everything" and then if you click on a link it's suppose to only show a subset of that.
I can't quite figure out how to connect the link to the PT to change it. I've thought about using JavaScript or JSP to simply rewrite the HTML, but even then I'm not sure how I set it up to say that: "if the link has been clicked, rewrite the HTML" because I'm not sure what to even point the link to, or pass through the link.
I thought about creating different content items with different PTs to link to, but there are about a dozen links (and therefore a dozen different Menu Components that I want to use), so I thought it might be better in the long run to just use 1 dynamic PT (in case the number of links grows).
It is only that one component that needs to be changed in order to display how I need for every link though.
Any ideas how to go about doing this?
So this is how I resolved this:
I created a component reference element in the content items called "menuComp" and then I set that to point to the appropriate Menu Component for each particular page.
In the presentation template, I removed the component reference and changed it to an [Element] tag which used key="menuComp".

Some of the page numbers are repeated when exporting to word

I have a report with 50 pages. I have one list control, and this list control contains a table control. I am using grouping in the list, with a page break at the end. I want each group on one page. For example, if the size of my data is bit more for some of the pages then it moves to the second page.
The problem is I am getting some of the pages with the same number where data for one group is more than one page. I am using this expression in the footer:
format(Globals!PageNumber & "of" & Globals!TotalPages)
When I have 50 pages then after exporting to Word I will get 45, becuase 5 or 6 pages will be repeated, giving "1 of 45" instead of "1 of 50".
Note that I am using SSRS 2005.
This is an older question but recently ran into this issue myself so it might help someone else.
There are a lot of examples out there that use casting in the examples for the page number display (CStr or ToString()). Whenever I invoked those methods, the counts would be off when exporting to Word (either doc or docx).
The only way I could get it to work is with three separate text boxes in the footer with these expressions:
=Globals!PageNumber
"of"
=Globals!TotalPages
Avoid the use of those other approaches (including the wrapping Format function -- I don't think that's doing anything). Three separate text boxes was the only way I could get this to work.

Crystal Reports 11 - Useless blank page is added with just group headers that have data

I have a weird problem I have never seen before using Crystal Reports.
I built a complex PDF monthly report for a bank that generates over 200 pages. The specifications took months to adjust with the client but it works perfectly now, showing all the data it's supposed to, all sorted right and with the right headers.
But for some reason the report inserts quasi-blank pages rarely and seemingly randomly before it shows data. These pages aren't entirely blank, all my headers including group headers show, but no details. The correct data shows up a couple of pages later but these useless pages keep popping up in the report no matter what I do with Section Expert. To be clear the headers and the details aren't separated. The headers also display fine in the page with the right data, they just duplicate to the extra blank pages before that.
Here is a sample:
NO "insert blank page" box is checked in any of my sections except the uppermost level of data, which works fine, but these extra pages are not inserted at the end of each group for that level. They are inserted randomly sometimes right in the middle of a coherent section.
I also verified the "Keep Together" option, and it is checked for the 4 lowest levels including the details, so I considered data too big to fit on the same page with its headers but the probleme is rare, random and the data overflows perfectly when it does appear (as on page 3 in my example).
And checking all those boxes off didn't change anything.
There are no suppression formulas and the only suppressed sections are GH1 and GH2, but they are suppressed all the time, unconditionally. I tried adding a conditionnal suppression formula to the headers if there is no data, but the problem is, there is data. The headers just seem to be duplicated uselessly.
The problem doesn't seem tied to any specific change in header value. In my example it changes when the report hits Common Stock Equities for a certain portfolio but doesn't occur when another portfolio displays its Common Stock. And I check the data in my data source, everything is consistent between the rows of data that this happens to and those that don't.
I ran out of ideas on how to get rid of these extra pages. Anyone know what's happening in my report?
Thanks a bunch.
Try toggling 'Keep Group Together' for the groups to see if it has any effect. You'll find the option by right clicking on the group, choose 'Change Group' (to bring up the Group Expert), and on options tab.
This option is often overlooked since 'Keep Together' in the Section Expert is more visible.
(You may also want to look at turning off 'Keep Together' to see how that affects your report)