MigraDoc PDFSharp - alignment of text frames - pdfsharp

Section
TextFrame
Table
Row 1 - N, Dynamically generated using a datatable.
TextFrame
Table
Row 1 - N, Dynamically generated using a datatable.
The problem is when i create this document, the two TextFrame overlap each other, and i have to add paragraphs between those two to make them not overlap. The problem is, with more rows, i just can be sure how many add paragraphs are needed.
I am pretty sure there must be a right way to do it and not this:
for (int x = 0; x < tb.Rows.Count / 2; x++)
section.AddParagraph();

You don't have to use TextFrames to indent tables. TextFrames won't break to the next page, so this "solution" will work for small tables only.
You can indent tables using the table.Rows.LeftIndent property (one would expect this to be a property of class Table, but it works).
See also:
http://forum.pdfsharp.net/viewtopic.php?p=4648#p4648

Related

how to display a set number of rows in a table view (titanium)

Manipulating the height like this is one way:
if(data.chats.length<8){
var newRowHeight = processBL.convert_percentage((data.chats.length*10)+5);
$.tableview.height = newRowHeight;
}
However it does not work if you have more than 10 rows. How can I specify how many rows I want on the tableview. Without setting it, I will typically have additional empty rows filling up the height of the table view.
Thanks

Sort vertical headers of QTableWidget

I have a QTableWidget that is used to display lots of data, basically derived from a function f(a,b). All a values go into the horizontal header, all b values into the vertical header and all f(a,b) into the corresponding cell.
The columns should be sortable. When a user clicks a column, all values in that column are sorted and all other columns are also "synchronized", since whole rows are sorted (using the clicked column as a sort criterium).
This works. Except for the "header column", the vertical header. The vertical header does not change, it does not synchronize with the reorganized rows. Is this the intended behaviour? Is it a bug in my code? How do I make the vertical header sort, too? Or do I need to add my b's to an ordinary column?
edit: I solved it now by making the header column an ordinary column. Though, I would still be interested in why the vertical header does not sort with the other columns.
Try to use QTableView instead of QTableWidget.
And use QAbstractTableModel for computing f(a,b)

Dynamic ListView Templates

I'm using a ListView to display a set of input controls which are database driven. The database tells me the name of the input value and its type, and I have my ListView properly displaying a set of rows of input controls based on this information.
What I'd like to do is have a set of rows, with each row housing N input controls, until there are less than N controls to house, and then just those.
So, if the total is 10, and N is 3 then output would look like this:
x x x
x x x
x x x
x
I thought I'd accomplish this through ItemTemplate/alternatingItemTemplate, but now I'm not sure how.
Any ideas?
Item/Alternating item template will not help you . Have a look at GroupTemplate and GroupSeparatorTemplate. SetGroupItemCount="3" in the ListView start tag, and put your repeated input control in the GroupTemplate. Then use <br/> element as your separator.
An alternative would be to use a table and have the GroupTemplate specify a table row, with the repeated element being a table cell. Here's a link to MSDN material on the topic, which shows how to do a tiled layout using a table:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listview.grouptemplate.aspx

Flex 3 prevent duplicate stacking in ColumnChart control

Here is my Problem:
I'm currently using a ColumnChart to display 6 label/value pairs.
When two labels are the same, the chart stacks them up, one on top of the other.
I want to display these duplicates side by side, their value might be the same or it might be distinct.
My first thought was to append a unique id to the label, but that's not possible according to the client. So, is there a way to tell the chart to also take a hidden id into consideration?
Someone suggested to do some sort of grouping, but I need to display each chart separate, as if they were distinct charts.
the chart's data provider is an array of these objects:
obj.description = "des";
obj.countV = 3;//some arbitrary number
obj.id = 2; //a unique id...
the chart code:
I found my solution:
append an index # at the end of each column label.
Use a labelFunction to remove the last char:
columnLabel.slice(0, -1);
that fooled the chart into thinking they're all uniques but display all duplicates side by side.

Flex: Make columns aligned between 2 DataGrids?

I have 2 advanced data grids, one above the other. They both have the exact number of columns, and pertain to each other in the same way. But each is showing different data, which is why I split into 2 grids. However, on each one you can resize the columns, what I would like is to make it so that if you resize a column on either datagrid the same column on the opposite datagrid resizes as well, so they are both always lined up.
Is there a way to do this?
Thanks!!
private function onColumnStretch(e:AdvancedDataGridEvent):void
{
(adg1.columns[e.columnIndex] as AdvancedDataGridColumn).width = (adg2.columns[e.columnIndex] as AdvancedDataGridColumn).width;
}
Add to dategrid:
columnStretch="onColumnStretch(event)"

Resources