SSRS conditional page-break - c#

I have a C#.NET WPF application that renders a SSRS report. The report has a parent grouping which I would like to apply a SSRS conditional page-break on based on its child data. The page-break function works well in that each parent grouping is place on a new page; However that could be page consuming when there is not a lot of child data for each parent.
My problem is to write a conditional page-break that will check if a parent grouping has enough child data to fit on the a page, the same applies to the next parent grouping, and so on, but if the parent grouping contains to much data to fit on a page only then apply the page-break.

As you wish to display it in a WPF application only, you can define a maximum page size for the report viewer with the InteractiveSize property. The height you define there will determine what you find is "too much data to fit on a page" and break accordingly.
For exporting to a printable format, the PageSize propery will react the same way. But this allows you to have a different size when using the report viewer, because you might want more to be shown on a single page.
With those settings the report viewer will place as much possible data on the defined space and break to a next page when the boundary is exceeded.
If you do not wish to split groups then you must wrap them inside a Rectangle because there you can set the property KeepTogetherto true, which will add a page-break between groups if there is no space for both groups on the same page.
When working with tables, you can use the following method to wrap the groupings in rectangles correctly:
Place "List" control on the report.
Set its "DataSetName" property to your dataset name.
At the design view, right click on the list and then select "Row group".
At "Group Properties" window, click "Add" button under "Group Expressions:" title and then choose field name that you want to group
within a page.
After that you can place "Table" control for your detail data inside the row group.
Once you render the report, report will keep data inside the group together between page break.
Source: https://stackoverflow.com/a/15656441/4579864
I hope this solves your problem. If you have any more questions, just leave a comment.

Related

Adding last page after main pages?

So, I have a report that shows data in a grouped format. All great.
I want to now add 1 extra page to the end of the report which has some data being passed as a parameter (dynamic image in this case).
How can I get the RDLC to add 1 page after all the other data has been rendered just to show this extra bit of information?
The same question applies to a "Page of contents"/index too so pages at the beginning of the main report.
If I understand correctly you can:
add a Rectangle after your Table and set its .PageBreakAtStart
property
use this Rectangle as a container for your Image control

Windows Phone - Display control in front of other controls

I am coding a Windows phone application. In one of my pages, I have a list picker which is populated from the database, therefore its size depends on how many records there are in the database.
My main issue is that if there are records more than a certain amount, the "extra records" are displayed behind the next control in the page and cannot be accessed.
How can I give the list picker precedence over other controls such that it is displayed in front? To give you an idea of what I want, imagine having multiple pictures in Microsoft Word and setting one picture as 'Bring to Front'.
As you can see, the entry "tommy_shaw" is greyed out. This is because it is overlapping the Transaction ID textbox. Attempting to click on "tommy_shaw" would only load up the keyboard to enter text in the Transaction ID textbox.
I believe you can fix it with grouping; which ever one you have in the code first will be displayed first. If you have two images grouped together, then it is going to try and display both of them at the sametime.
I solved it using Canvas.zIndex = 1 in the xaml file

dynamic window focus MVC2

I am working on an MVC2 project, on a view we display a large data set which refreshes every minute with latest data..some specific records are updated every minute in this data set. I want the browser to focus on these specific records..Not sure how to use javascript focus() here dynamically...
any clue?
thanks,
You need to provide more detail as to exactly what you are attempting to do.
If you are attempting to focus just ensure each record has a unique identifier then you can focus on individual records.
Alternatively you could simply keep the focus at the top or bottom of wherever you are displaying them.
EDIT:
In that case I would suggest something like the following
var currEle = document.getElementById("Record123");
currEle.focus();
Suppose you know how to issue an Ajax call and return either partial view or JSON data and how to use that data on the client afterwards...
You can only focus to a point in the document when
there's only one change or
all changes are summarised together in the same document area
We're also not talking about focusing as in document perspective, but rather about focusing of users attention to document specific content (or part of it).
First option
You can always use something like jQuery.scrollintoview() plugin (link to blog post that describes the plugin here) that will scroll document to the record that changed and highlight it using jQuery UI effect highlight. Linked blog post also describes the purpose of visual animated scrolling instead of simple jumping within the document.
Second option
Put changes at the top and keep your document scrolled at the top when content gets updated. You can blink a few times some icon informing the user of the changed content in the changes area.

2 step problem: Share info between 2 user controls on a page, Display info in a scrolling list or gridview?

I have a page with multiple user controls on it. In one user control, I have a set of checkboxes that set filters on what to display in a tree view, also in the same user control. In another user control, I have a list view (or gridview, haven't decided yet) That needs to display some information based on the filters that are defined, and the tree node selected in the previous user control.
The listview, or gridview, needs to scroll, displaying X(say 10) amount of records at a time. Depending on what the user has selected, there can be up to 28,000 records to display, so we only want to go to the database to get a small amount of records at a time, and update the list on the fly.
Your "Search" control is going to have to raise an event to it's parent control.
If the parent control will then perform the search based on the specified criteria.
The parent control can either pass the result dataset to the "Grid" control or if it is the "Grid" control, display the data.
It's hard to get more specific without more of a concrete example.

Implementing paging in Sitecore content pages

I have a section on my website where I plan to add a lot of text-based content, and rather than display this all at once it would be nice if I could add paging on just these pages. If possible, I would like to put all of my content within one content item and have the paging work automatically, building a URL along the lines of http://example.org/articles/title?page=2 or similar.
I've stumbled across an article that mentions paging with Sitecore items and this seems rather close to what I require, although mine requires pagination on a single content item, rather than multiple items. Can someone help me adapt this article towards my needs (if it's on the right track of where I should be looking)?
Is it possible to do this with a Sitecore content item?
http://briancaos.wordpress.com/2010/09/10/create-a-google-style-paging-component-in-c/
I think you'd either want to create your own WebControl and define a custom Render() method that reads the query string to write out the correct information, or you could even do it all in a Sublayout (a user control ASCX file). I've done this before by adding in a custom tag in the Rich text editor via Sitecore (I think I used <hr class="page-break" />) then in my ASCX I'd look for that HTML tag and split the content into chunks from that. I think my solution also used jQuery for some of it but you could probably do it with C# too.
Edit:
You'd want to split the tasks up and have the "paged" content as well as a list of pages (like the article you referenced) so you can easily generate the page buttons. Both of these could be done in two separate repeaters.
You can split the text from a single field into the different pages using approach described here: Split html string to page. All you need to do after that - read the query string and display appropriate block.
If I understand you correctly you have an Item in Sitecore that has x number of text fields and you only want a subset of those displayed depending on input in the querystring ?
In it's simplest form you want a sublayout that handles that.
Basically I'd imagine you having fields called Text1, Text2, text3 etc.
This .ascx could then retrieve the data for fields the fields you'd want using the control and adding them.
Then you could use the code from the article to generate the paging links.
This should be simple enough, but I'd say it would be a better idea to have an item in sitecore and use it's children as the data you want viewed and paged.
It's nicer because if you start out with 5 "page" fields and suddenly want 10, your item will keep on growing, where children can be added without bloating the parent page. Plus the user could then order the children how he sees fit.
I hope this helps a bit.

Categories