SSRS unusual Pagebreak in a long text - ssrs-2008

i am creating a report for SQL Server 2008.
i have a table with some rows. One of the row has a long text which will be displayed. If the text has a certain length, the whole row will be displayed on the second page and the half of the first page is empty.
If the text is a bit shorter, the text will be displayed correctly on the first page.
If the text is a bit longer, the text will also be displayed correctly (the first part of the text on the first page, the second part on the second page).
I cant find any settings for this problem.
Does anyone have a solution?
Thanks
Alex

You could look at the Keep together on one page if possible setting at the Tablix level.
You can also look at the KeepTogether property at the row level and at other levels, e.g. Group.
Another option is to insert any objects to be kept together in a parent Rectangle object; this will always keep items together where possible.

Related

How can I use Footnotes with Oracle BI Publisher

I am putting a footnote in an .rtf template, and before generating a report it seems ok,
but when I load an XML sample and preview the document (.pdf or .doc etc.)
the footnote content goes right into the body of my report (example is in the picture).
I've tried using text boxes, but it doesn't help.
I've also tried just making a paragraph look as a footnote, but since I have a lot of
tags in my template, the footnote-looking text doesn't stay at the
bottom of the page.
and I can't use footers/headers because I need only one footnote at one page.
Try to draw a borderless table with one column and two rows where the first row has fixed hight (exactly) of the size of body, and the second row fixed hight of the size you want to reserve for the footer. Then you place your xml data in those two rows of the table the same way as you put it on the page. I use that for different forms when the position of the data is fixed. There are also other table/row/column properties that you might want to use.

Display two fields in one line and one just if necessary

I created a standard report with jaspersoft studio.
I want to display two fields in one column (which works already). The second field in the column should just be displayed if it has data (which works too). But It seems that if the second field is not displayed it still takes up space. Or at least the first field isn't vertically aligned in the middle.
I put both in a frame and made them float. Any ideas how to make it align in the middle in the third screenshot?
As Alex K pointed out I just copied the first textfield again and put It over the old frame. When there is no data in the second field I hide the frame and show the textfield. When there is data in the second field I hide the textfield and show the frame.

iTextSharp - finding end of page

Is there any way to find the current page is going to end in iTextSharp. For example,
say there are some 10 records which needs two pages to be written down at the end of the first page i wish to add '(contd on nex page'). IS there a way to do this. Will finding the end of page be an answer for this or is there a way to find the line number on which writing is done, so that i can make a calculation to decide whether to add a message of my choice and proceed to the next page.
any advise is much appreciated :)
Thanks a zillion
Usually, this is done by defining a footer for the table. When the table breaks automatically, iText will show that footer. Of course: you don't want this footer to show up on the last page (after the final row of the table). That's why there's also a method to skip the last row.
This example shows you how to create a table with headers and footers. This is the link to SkipLastFooter.
Note that saying that "finding the line number" would solve your problem is wrong for two reasons:
There is no such thing as a line number in a PDF file. You have a MediaBox and you draw content on the canvas defined by the MediaBox using coordinates.
There's a way to get the current Y-position on a page after adding an object to a document. You can get the Y-position before adding a table and after adding a table, but not while you're still creating the table.
An alternative solution to the one I suggested above, woult be to use table events.
If you really need to find the end of the page, and are not using a table with a footer row that will be printed at the end of each page, you can use the PdfWriter object as follows:
var remainingPageSpace = pdfWriter.GetVerticalPosition(false) - pdfDocument.BottomMargin;
This will give you the remaining space on the page, from which you can determine what you want to do next.
If you are using tabular data however, it is much preferred to use a PdfPTable and take advantage of the footer row feature.

Export PDF and supress page breaks

When I export my report to pdf, appear me weird page breaks.
If a lengthy report, that happens to me is that if a table does not fit in the remaining space of a page, it automatically passes me to the page below, thus creating blanks spaces.
Already have enabled the property Keep Together, interactive size to 0 and i unchecked keep together on one page if possible in tablix properties.
However I think the problem is not in the table, because before that, I have a textbox with a title, and is between the table and the textbox that makes page break.
I have already put the textbox and table inside a rectangle, but still have this problem.
Any suggestions?
Q: is the table / text box that responsible for the page break issue is inside a Subreport ?
If so, then this is your problem (unless you make a call that this table will always be short enough to stay in single page).
You have to understand: the subreport is the cause for the breaking, the table will not split because it is presented by the sub-report that has to stay in one piece.
The options are:
Stay with the subreport - but make sure that the table Maximum length will still fit the Page that the sub-report is lay in it.
take out the table from the subreport and place it directly in the main report - that way when the table too long to stay in single page, it will split into two pages.

iTextSharp and moving some data to next page

I am creating an invoice using the iTextSharp. That displays nicely but sometime, when invoice items are larger in qty, the summary portion (which displays subtotal, tax, discounts, grand total etc) is splitted. Some displayes in current page and some moves to next page. I was thinking to move entire summary portion into next page, if current height left is not enough for that.
However, to do that, I need to know that how much page height is left (after my current page content rendering). I wonder if someone know how to calculate current left height of the page? OR if there is a property in the pdfPTable which may force the table to print itself as a whole and dont let it split across multiple pages! I guess if second option is available, it will be easy.
In summary, I need to know if it is possible to calculate remaining page height, and also if that is possible to force a table to NOT split across multiple pages.
thank you.
Sameers
You can set SplitLate to false to avoid auto page break in a cell data exceeds limit.
......
table.addCell(cellData);
table.SplitLate = false;
......
I suggest you use a nested table for your summary section. I don't believe iText will split a given cell on a page boundary, so everything in that cell (even if its a nested table with cells of its own) will stay on the same page.
Use the table's cell's row span so it takes up an entire row on its own.
I'm not certain, but I'd wager a beer on it.
What object are you using to add your data to the PDF? MultiColumnText, Paragraph, Phrase?
You should be able to use Document.PageSize.Height property to return the height of the Page.
Then use PDFPTable.Height to return the height of your table.
So just use the logic Document.PageSize.Height - table.Height, and you'll have the remaining y-axis space available.
The PDFPTable object has properties named SplitLate and SplitRows. I believe you can use these properties to try and keep the table on one page.