Adding last page after main pages? - c#

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

Related

How to move entire report footer of crystal report to last page

I have a crystal report in VS19 where I want to move my entire report footer to the last page if the report have multiple pages. Currently what is happening is, if my report have multiple pages, report footer will appear in the 1st page itself and accommodate as much of controls it can there and move the rest of the section to the last page. I have tried a lot of things such as adding formula to suppress the report footer if
pagenumber <> totalpagecount
then tried adding new page before with the same above formula. but nothing was working properly. If i applied new page like this it will forcefully make the reports 2 paged which is actually not needed and behave according to the formula. What I exactly needed is , if the detail section has more data such that it will make the report overflowing to make it 2 paged, then only the entire Report Footer should appear in 2nd page/last page. Could anybody help me. Thanks in advance.
In Section Expert for report footer section, turn on the Keep Together checkbox.

SSRS conditional page-break

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.

How to achieve this simple flexible page layout using Orchard CMS

I'm new to Orchard and struggling to determine how to best set up the basic page layout below (simplified for clarity from the actual layout which is based on the Contoso theme):
The piece I'm struggling with is the Right Content area - shown as the dotted red box above. The contents of this area will vary with individual pages. Sometimes it will be empty in which case the solid red Content should expand to fill the content zone. With content it will typically contain 1 or 2 lists of links - specific to the page.
I tried adding a HTML Text Field to the Page content type but then how do I position it? In the Content template (e.g. from the contoso theme ~/Themes/Contoso/Views/Content.cshtml) we can position Model.Content but not individual fields.
Or, if I add another zone on the right hand side of the layout is there a way to place page fields in other zones outside the Content Zone? I tried this in Placement.info as a test:
<Place Fields_Common_Text="ContentAside"/>
but it didn't appear in the Content Aside Zone.
Try <Place Fields_Common_Text="/ContentAside:1"/> instead.

Rendering image in BandedGridColumn from MySQL Blob field

I have a number of images stored in a Blob type field inside a MySQL InnoDB database along with other information pertaining to those images stored in another fields.
As you know the Banded Grid View distributed in DevExpress version 11.2, with the help of Banded Grid Columns, is capable of rendering several types of data, most notably images.
So far I'm able to create every control and load any kind of data required, including the images, using the common MySqlDataReader and DataSet approach, through the Grid Control DataSource property, that owns the BandedGridView.
However as you know, when you load a Blob field from MySQL you are returned a byte array with the content of the file, in this case the image in question.
I was hoping DevExpress would recognize the binary data and realize it was a image file, and automatically render the image in all the rows under the Column assigned to handle the database Image field, however it did not and now that I think of it, it was probably far fetched hope.
Instead of rendering the image, each row of the column shows a simple string output referencing what type of object the field contains. In this case since its a binary representation of a file, it outputs System.Byte[].
I've search the DevExpress documentation and generally on the web, nothing clear was found that could solve my problem. There is a example of my desired result packed along with DevExpress, the solution named "GridMainDemo" under the WinForms -> XtraGrid section. Once your running the demo, change into Alternate Views and into Banded Grid View, then just click on any row under the picture column, and you will see a clear example of my desired result.
Of course I've looked into the source of that demo, however I cannot say that clarification and explanation was a clear aim of the DevExpress team that built such demo, and unfortunately I didn't had much time to look at it deeply. However from what I've seen this demo differs from the point that the images are stored locally as files, and already properly reference in some sort of repository, which doesn't help much with my problem.
To finish my question, sorry for the long reading, just wanted to give a clear idea of what my aim is, what stands in the way, and how all things are set in order to find a way to reach my aim.
Now to cut a long story short. A simple example of how to load a image from a MySQL Blob field into a column in a Banded Grid View and have it rendered after load or when the user clicks the field cell, would be ideal and with it I would be able to understand and do the necessary code so that my View also renders my images.
My biggest thanks with this, really.
Note: Unfortunately, using local or even remote stored files is not
a option. The images must be kept within the confinements of the
database.
It wasn't so hard after all, and seems hope was well place and DevExpress did most of the work.
So, to help those who have a similar question, here is what you have to do, so you can have a certain column showing a image stored in a Blob type field.
Assuming you already loaded the data to your grid and it's being displayed correctly with the exception of the image of course.
First: You must declare a RepositoryItemImageEdit type object, that will simply implement a ImageEdit type control in the cell, which when trying to edit the cell value it will show your image, the goal of this question. If your goal differs on that point simply read the note after this answer afterwards.
Second: You must add the previously last declared object to your GridControl.RepositoryItems collection property. You can easily accomplish it using the Add method.
Third: Now you must define what type of control will be used to render the data for you Image column, for that you simple reference the BandedGridColumn.ColumnEdit property to be equal to the object you just added before.
Example
/* Create your columns, bands etc manually or
have it done automatically after loading the data.*/
...
// Load the data from the database to your gridControl
...
// Step one
RepositoryItemImageEdit imageControl = new RepositoryItemImageEdit();
// Step two
gridControl.RepositoryItems.Add(imageControl);
// Step three
/* view is the View assigned to your grid control
where your data and columns are being shown.*/
// Assuming your database blob field is named `Image`
view.Columns["Image"].ColumnEdit = imageControl;
If your data was loaded correctly and your columns assigned properly to their respective fields then this should render a small icon on each cell of your Image column and once your click or focus on it, a ImageEdit control will be rendered and show your image.
Note:
There are other controls besides ImageEdit capable of rendering images, for those others you will have to find
theirRepositoryItem based implementation.
Also, your Image column must be editable, otherwise this approach won't
work. Bare in mind that allowing edition at the column level will not work if it is denied at the View level through the OptionsBehavior.Editable property.
I will mark my answer as the correct one since no one else provided any insight on how to solve my problem, however you are welcome to post any other working approaches to this problem. Thank you.

Is it possible to specify number of pages in rdcl report c#?

I have a rdcl ready to be populated.
It mainly contains a table that occupies the whole width and a few Textboxes under it that show summary info.
Sometimes the table will have a lot of lines and other times only a couple of them. This makes the texboxes to end up in the same page or a 2nd (or a 3rd) depending on the situation.
I wanna know if it is possible to so specify a jump to the next page for the textboxes.
So for example even if the table has only 1 line, and there is enough space under it to fit the texboxes info in 1 page, i want them to start at the 2nd page. And if the table is too long and occupies 1 and a half pages, the textboxes should appear in the 3rd page, and so on.
I thought of creating a 2nd report with only the textboxes but then the page numbers do not match and also the reports are showed in different windows.
Any pointers are most welcome.
As far as I know, if the report objects exits on the same rdcl you can not send them to a certain page.
You can, however, alter the "PageBreak" option on the Table to "End". This will push everything after the table onto the next page.
This will help you get the desired results you are after.
EDIT:
You could also get rid of the numerous pages all together by changing the Report property "InteractiveSize" to a height of lets say 50in. This causes the report viewer to page break much less often (every 50 inches) and would most likely place all of your content on Page 1 in the report viewer.

Categories