Office Word Table fill page bounds - c#

i'm developing an invoice template using Syncfusion DocIo with merge fields.
Everything works fine but i have a problem, I use a repeater for rows and every time happen that table ends at half of the page and it's not nice to see.I need that the invoice must stay at full page, fitted to the page bounds, I need something like a "dynamic spacer".
You have any suggest to keep the table stretched at bounds?
Many thanks for help

Related

Print only the first page of each group

My report adds a page break and resets a custom page number whenever a group changes. How can I print only the first page of each group?
Crystal itself doesn't have a great way for you to programmatically print specific pages. But there are a few ways to make this kind of work:
Easy: Make a formula that generates a list of which pages are ones you want to print. (It might output something like 1,2,5,7,9, which you could copy and paste into the Page Range when you go to print.)
Medium: Make a modified version of this report that excludes any data you don't want to print. Figure out a maximum number of records that fit on a page (for example, 18) and only take the first 18 per group. (This might be easier to set up with a custom SQL statement in Crystal.)
Difficult: Same as option 2, but you write suppression formulas for everything on your report. If Page Number > 1, the entire page goes blank. After printing you just remove the blank pages from the file. Tedious, but no ink wasted...

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.

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

What are the best ways to deal with these PDFSharp table limitations?

I am using PDFSharp to export a table to PDF (using the regular MigraDoc.DocumentObjectModel.Tables.Table object). It works great except I ran into a few issues:
if the content of a single cell in the table is longer than the height of the page it seems like the content just gets cut off. A table itself can span multiple pages but a row seems like it can only be 1 page high and It seems like it doesn't extend onto the next page.
Is there any workaround to this or is this just a bug in the library?
Also for tables that span multiple pages, is there a way to have the header row on the table show up at the top of every page?
Re first question:
It's documented that MigraDoc does not break table rows over multiple pages. It's not a bug, it's a limitation. So it's up to you to design the tables that this does not cause problems.
IIRC there is a hack published on the PDFsharp forum that increases the page height to work around this problem. If you only need PDFfiles, this could be a workaround.
Edit: Didn't find the link when I made the post, but found it today when I tried again: Here's the workaround:
http://forum.pdfsharp.net/viewtopic.php?p=4311#p4311
I didn't try it myself.
Re second question:
Rows marked as header rows will be repeated on every new page. Just set the HeadingFormat property of those rows to true.

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