I have a very simple table in HTML which contains 12 columns. I'm trying to convert this to PDF using iText 5.1.1 (Java).
My problem is, the table in the PDF output wraps. I mean, it displays the first row, but wraps the row at the end of the page, then without a linebreak or anything, it just displays the next row starting right after the last cell of the previous row.
How can I make iText's HtmlWorker 'nowrap' my table, namely display a single row in exatcly one row in the PDF?
BTW, I still want to cell data to be wrapped, just not the table rows:
h1 h2 h3 h4
h5 c1 c2 c3
c4 c5
Instead of a screenshot, h -> header cell, c -> data cell ... basically that's how the table will look like in PDF, instead of:
h1 h2 h3 h4 h5
c1 c2 c3 c4 c5
As #Chris wrote in his comment above, unaligned colspans can and will mess with iText 's HTML-Worker when converting tables. I got an ill-formatted HTML template to work with and after setting the correct colspan values and having the correct number of cells, the problem went away.
Related
I have a table with a visible row count of 10 (this is fix). And the table has a binding with a total of 62 in length. When calling .getRows(), I only get the 10 rows visible but I need to get also the other rows (rows 11 onwards). I need to update the specific row/cell with CSS. How can I get the object in that cell, which is a button, and update its CSS?
Or is there any way that I can only apply the CSS with the specific row? For example, row 1 col 1 only and when I scroll the table, it will be removed or the CSS will not apply with the other?
Sample image
I'm having a problem with designing a column in crystal report.
What i want to do:
There are three columns a,b,c. I can design column a and b but unable to design c. How to do it?
You cannot center the value vertically, but it is possible to not draw horizontal lines in column c by using the checkbox named something like "underlay following sections". In German it's "Folgende Bereiche unterlegen", I don't know the exact wording in English.
For example if your c column contains a group key and a/b columns contain details, you put your c column into the group header checking the underlay option. The columns a and b are defined in details section.
The line in the end of your table would be painted in group footer. The horizontal line in a and b column is painted in details section, but only in columns a and b of course.
We have a spreadsheet of our locker combinations for our padlocks we issue to students (sample picture below)
In row 2, I set a CONDITIONAL FORMAT for CUSTOM FORMULA for cell C2 as =B2=1 to turn that cell Yellow. I can repeat for cells D2, E2, F2 and G2 so that if the head custodian puts in to use combo 1, 2, 3, 4, or 5 that then the correct cell will highlight.
My problem is, how do I COPY that Conditional formatting down to the next rows so that the formula in the "custom formula" changes to work for B3 and B4 and B5 and so on?
I understand I can highlight and copy my first row and then PASTE SPECIAL > CONDITIONAL FORMATTING but the formula stays locked on for the first row of information rather than changing to the current row. Maybe I need to use a different formula?
The Paste Special > CONDITIONAL FORMATTING does make the formula copied from one row work in other rows. Was thrown off by the formula not changing and still showing the original row but it works.
This is the formula
=SUM(Sheet2!A2:A10)
What i've been trying to do is as I drag down the column to have the formula change to =SUM(Sheet2!B2:B10) and so on.
Basically is what happens we drag to the right we get an increment on the column letter, but I want it when I drag down
For a limited number of rows, the formula below in Row2 and copied down should work:
=SUM(INDIRECT("Sheet2!"&CHAR(64+ROW())&"2:"&CHAR(64+ROW())&10))
Beyond 26 rows I would suggest switching to using a helper column instead of creating teh character value from the row number.
I'm building a welcome editor for my eclipse rcp application. I want to have two ScrolledComposites sit side by side with a label above each.
Label 1 Label 2
Scrollable 1 Scrollable 2
Now I'm stuck in how to box.
This seems right but now I can't get the layouts and listeners right.
Composite A
Composite A1
Label 1
Scrollable S1
Composite A2
Label 2
Scrollable S2
A1 should set the min Size of Scrollable S1 right? But who sets the size of S1 so that it fills the excess space? The examples I found didn't work right.
BTW putting everything in a GridLayout didn't work either since I couldn't get the cell size.
BTW putting everything in a GridLayout didn't work either since I couldn't get the cell size.
Why would you need the cell size? Just set GridLayoutdata for S1 and S2 to fill the cell. It's simplest to use GridLayoutFactory:
import org.eclipse.jface.layout.GridLayoutFactory;
...
GridLayoutFactory.fillDefaults().applyTo(s1);
GridLayoutFactory.fillDefaults().applyTo(s2);
...
UPDATE: See examples at http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/custom/ScrolledComposite.html
Let's say content of s1 is a Composite c1. Then you use s1.setMinSize(c1.computeSize(SWT.DEFAULT, SWT.DEFAULT)). Size of A1 is irrelevant.
Have a look at the SWT Snippet for "fixed first column horizontal scroll remaining columns" - although this example is for Tables, it can easily be translated to ScrolledComposites.