Open JohnSCS opened 11 years ago
This is a table so changing alignment will have no effect. I can only define column widths as percents because of a shitty Microsoft bug that prevent us to use "auto" width columns. I tried using grids instead of tables. It solves the problem but it does not support column headers :)
It looks like it won't be fixed on .net framework 4.5 so I have to find another solution.
Can you do it by working out the percentage for each column by finding the maximum length in each field to find the ratio of column widths needed. And to ensure that the Unit & Quantity have enough space make them double.
For example Inventory Name - 60 chars Unit - 2 chars -> but we make it 4 Quantity - 2 chars -> but we make it 4
Quantity = (100/68)_4 = 6.25% or 6% Unit = (100/68)_4 = 6.25% or 6% That leaves Name = 88%
Could that work?
I've tried it now but %6 is small space even on wide page. I'll try another idea.
What about making the width-percentages configurable? By the way every "WPF-thing" you can see on a screen (it has an VisualState) can be easyly printed.
hi,. We can simply use grids instead of tables and solve that problem. However I have very optimized code that converts flow document tables into a receipt text format and for this reason I'm searching a simple solution to prevent rewrite. The problem occurs when it printed on A4 paper. So to be able to make it configurable we'll need paper based configurations.
I'll first try replacing tables with grids.
As per the picture, long lines are being wrapped. To help reduce this, can we have Unit & Qty right justified so the Inventory Name can use more than half the width of the page?
Basically, the Inventory Name is only allowed the Left half of the page, the Unit is in the middle and Quantity on the right hand side.