Do Not Page Break on Table in Aspose PDF? - c#

I am trying to stop Aspose PDF from Page Breaking in the middle of my table (C# .NET). We dynamically add information to this PDF, but this table will always be two rows.
I have found the table.isBroken attribute always returns true and row.isRowBroken always returns false (from Aspose). This does not help me to stop the page from breaking in the middle of this table.
I have also tried adjusting the margin to no avail since our pages are dynamic. Google and the Aspose forums and documentation have revealed nothing. I have turned to asking a question here on stackoverflow.com.
Any ideas or suggestions would be helpful! Thank you so much for your time!

You may use RepeatingRowCount property of Table class to set header rows count. It will keep these rows together on page break.
I'm Tilal,developer evangelist at Aspose.
Aspose.Pdf.Table table = new Aspose.Pdf.Table();
table.RepeatingRowsCount = 2;

Related

Selenium Find by Css help needed.-

Not a developer here.
I have two checkboxs with No IDs. I am find with selenium when I have an ID. But in this case the table was created with jquery datatables and no process is present to auto assign the IDs.
In css the line below would should give me the first row in that table.
#CompanyTableTable tr:first-of-type input[type="checkbox"].CompanySelector
This one selects the second entry.
#CompanyTable tr:nth-of-type(2) input[type="checkbox"].CompanySelector
I think I should be able to use this inside the following? But all my attempts return different formating errors.
driver.FindElement(By.CssSelector("**Css_Here**???")).Click();
Thanks in advance for any help.
Thanks everyone.
I had to add a wait and the below worked for grabbing the second checkbox
driver.FindElement (By.CssSelector("tr.even > td > input.CompanySelector")).Click();
I installed the Firefox IDE and ran the interface and grabbed the formatting from that.

Page header is not repeating in rdlc report when two tablix is having two dataset

I'm having a one strange scenario. Before going into it, I want to say that I'm very beginner to this rdlc report. Hence I'm struggling to resolve it.
What I want is ?
I want to show the page header in all the pages.
What I have is ?
I'm having one header part which is having few textboxes and the body part which is having two tablix. Here, the two tablix consists of two difference datasets. The first tablix is grouped under Group1.
What the issue I face is ?
The first tablix consists of 50 records, that occupies three pages. In all the three pages, the header part is visible. When the second tablix is coming into the fourth page, all the header part turned into # error. Really struggling a lot to solve this.
What I tried is ?
Opened Advanced Mode in the Groupings pane.
Clicked static and changed the Keepwithgroup = after and Requestonnewpage = true.
Note : I did this for the two tablix but nothing works. Also I'm not sure that this will give the way.
Also I checked in report xml file also.
Checked Repeat row on each page and Repeat column on each page.
Hope you understand my problem. Kindly guide me where I'm making mistake. Thanks in advance.

How to add a Page Number Reference to a table cell in a MS Word Footer

I have searched the internet trying to find an answer to this problem. I am creating a program that will automatically add a footer to word documents that are in a folder. The footer contains a table that has 2 rows and 3 columns. Everything is working except that the footer needs a page number reference in one of the cells.
This is the part of my code now:
using Word=Microsoft.Office.Interop.Word;
Word.Table table = section.Footers[Word.WdHeaderFooterIndex.wdHeaderFooterEvenPages].Range.Tables.Add(section.Footers[Word.WdHeaderFooterIndex.wdHeaderFooterEvenPages].Range,2,3);
table.Range.Font.Size=8;
table.Range.Font.Name="Arial";
table.Cell(2,2).Range.Text="01 00 00 - "/*This is where the page number reference needs to be*/;
I have tried:
section.Footers[Word.WdHeaderFooterIndex.wdHeaderFooterEvenPages].PageNumbers.Add();
and
table.Cell(2,2).Range.Fields.Add(table.Cell(2,2).Range,Word.WdFieldType.wdFieldPage);
and neither would work.
Any help would be greatly appreciated.
Ok I created a round-a-bout way of adding the page number, so if anyone has a better answer, please feel free to add on.
Word.Range rng=table.Cell(2,2).Range;
rng.End=rng.End-1;
rng.Start=rng.End;
rng.Select();
app.Selection.Range.Fields.Add(app.Selection.Range,Word.WdFieldType.wdFieldPage,oMissing,oMissing);

RDLC reports: Show textbox value if first row on page

I have an old report written by someone else and don't want to change it too much. Each data row has a field at the beginning that is populated with the Category name if it is the first record for that Category and is left blank for all the others. A total line follows at the end of a Category section.
I works fine except when there is a page break between the first record and the last. In this case it is hard to tell what the category is since it is on the previous page.
My question is if there is a way to tell if a row is the first on a page? I tried
=IIf( (RowNumber(Nothing) = 1), Fields!DepartmentDescription.Value, "")
but that only shows the category for the first record in the category (which is already done using).
RowNumber("tblMain_DepartmentGroup") = 1
Not the first record on the page.
Thanks for any help.
You could have easily used the First() function. It literally receives and uses the first value it gets from the data collection.
Yes, it's possible. No, it's not easy. It would require some custom VBscript code (to be found in Report Properties). You might be trying a wrong approach.
In this case I would recommend to repeat some of the heading on new pages. Select 'Advanced Mode' at the little arrow next to Column Groups. In your row groups, a couple of extra (Static) items appear. Select the correct ones, and set 'RepeatOnNewPage' to true.
To give us some more context, it might be useful to know what you want to achieve with this.

Keep table in one piece MigraDoc / PDFsharp

I am using PDFsharp / MigraDoc to write tables and charts to PDF files. This worked great so far, however MigraDoc will always split my tables (vertically) when it should move the whole table to the next page in the document. How do I make sure the table will stay in one piece?
Table class of MigraDoc.DocumentObjectModel.Tables has a bool KeepTogether property however it seems to have no effect (either set to true or false).
Is there a way to do it manually? Is there any way to "measure" the distance from the end of the page and compare it to tables height? (Or any other way of knowing wether the table will be split or not)
Please note that I am using PDFsharp / MigraDoc for the first time. If there are any best practices I ought to know, please let me know. If there are some good examples out there (I saw those on PDFSharp's home page, but that's about it) I'd love to know about them!
You can set the KeepWith property of a Table Row to specify blocks that must be kept together.
If you know the table fits on one page, you can set the KeepWith property of the first row to (table.Rows.Count - 1) when the table is finished.

Categories

Resources