Min Height for GridLayout Row set to Auto - layout

In a GridLayout, I have set a row to 'auto' because the content size is dynamic. In particular, I have a pulldown menu in the row. When it opens, the row correctly grows to the height of the pulldown list that appears. BUT, when the pulldown is closed, it is merely a button that should have the same height as the other rows. Unfortunately, the row height is a bit too small and causes the overall layout to look bad.
To fix this, I need to set the minimum height of the 'auto' row. Is this possible? Can I set a minimum height for a GridLayout row that is set to 'auto' ???

You can not set minimum height for a particular grid row, instead you can set minHeight (min-height with CSS) on the Button you are talking about / simply wrap the Button with a ContentView / StackLayout if you like to keep the Button smaller while giving it more space.

Related

SSRS: Excel-Rendering always created an empty Column

I have a strange problem with the SSRS-Excel Renderer:
As soon as I create a Table, it can be empty, with more than one Column, at the most right column, an empty Excel-Column shows up:
In the example, I just putted a plain Table into the RDLC, added the hardcoded values 1 to 4, and you can see, there is the 'C`Column pretty small, but without any values anywhere in it.
As per my understanding this is possible only if Report width is greater than tablix width,
Just Make sure you have same width for both Report & Tablix, Report width is in pt but tablix Size.width in inch.. so use any conversion and set same width for both.
Roughly 1 inch= 72 pt

How to create a text based Y axis on excel chart

I wish to customized the Y-axis to text instead on value.
Is there any way I can do it without any plugin?
Here will be my data:
A B C D
1 Lower Limit Upper Limit # Data
2 30S 40S A1234 30A
3 30S 40S A2345 30S
4 30S 40S A1256 30S
I wish my Y axis will be 30S, 30A, 40A, 40S intead of 10,20,30,40
and my X axis will be A1234,A2345,A1256
Is there any possible that I can change the X axis value?
I started with your data, and I added a small lookup table. I inserted a column "Value" (blue text) in your data range that has the Y value corresponding to the label in your "Data" column. You can use a lookup formula for this, for example, the formula in D2 is:
=INDEX($H$2:$H$5,MATCH(E2,$I$2:$I$5,0))
I made a column chart (don't know what type of chart you want, but this technique is widely applicable) using the yellow shaded range in the first data range (top left chart). I selected and copied the green shaded range in the second data range, selected the chart, and used Paste Special to add the data to the chart, using the settings shown in the dialog overlying the top right chart.
This has added another set of columns (bottom left chart), not so useful. I right-clicked the added series, picked Change Series Chart Type from the pop-up menu, and changed just this series to an XY scatter type (bottom right chart).
The XY scatter series is on the secondary axis, also not too useful. I formatted the XY series, and changed the axis to Primary (top left chart below). The 0.5 values in column G make the points line up with the vertical axis of the chart.
I added data labels to the XY series, shown in orange to distinguish them from the black axis labels (top right chart below). I formatted the labels so they appear to the left of the points, and so they used the Value from Cells option, based on the labels in I2:I5 (middle left chart below). If you don't have Excel 2013, you don't have this option, but you could
Manually type the desired text into the labels.
Link each label to the desired cell: select the labels (one click), select the desired label (second click), type = in the formula bar, select the cell, press Enter, repeat for all labels.
Use a third-party add-in like Rob Bovey's free Chart Labeler from appspro.com.
I hid the default axis labels. You can select None for axis labels, and then resize the plot area to make room for the custom labels created above. But I used a custom number format for the axis, which consisted of several space characters enclosed in double quotes. See middle right chart below.
Finally I rescaled the vertical axis so its min and max were 0 and 40 and the major spacing was 10, I formatted the XY series to use no markers, and I changed the label font color back to Automatic (bottom chart).

Does the width of a Table2 or a Cell2 include the border? For a Cell2, does it include the padding?

I'm working with the DynamicPDF library to typeset tabular data and I have an incomplete understanding of how the width property of Table2 and Cell2 objects works. Specifically, I don't know whether the width set by the property is an internal width, or an external one. For a Table2 object, I don't know whether it includes the left and right borders of the table. For a Cell2 object, I don't know whether it includes the left and right borders or whether it includes the left and right padding. For that matter, I have an incomplete understanding of why we are permitted to set the width of the table at all - surely the width follows logically from the widths of the table columns, in which case the proper way to modify the table's width is by modifying the column widths?
It would be useful to know whether the table width in particular includes its borders, because I want to typeset tables that are the width of the page (or rather, the width of the area inside the page margins). If the Table2's width propery includes the border width, then the correct way to do this is to set the width to the page width. If not, then the correct way is to subtract the left and right border widths first. If I do it wrong, then the table will be either too wide or too narrow.
These pages seem to be up-to-date documentation, but they don't specify whether the borders/padding are included (they just say "Gets or sets the width of the table." and "Gets the width of the cell.") This page has examples of use of the Table2 class, but all of them use hard-coded widths.
The table width is independent of column widths. Table width cannot be modified by modifying the column widths. When generating the tables with dynamic data, setting table width allows you to specify a region in which the content is rendered and anything that falls outside of these boundaries is overflowed into a new table. For example if the sum of the column widths is greater than the table width, the columns that do not fall within the table boundaries are pushed out into the overflow table which can be accessed using GetOverflowColumns().
Border width is not included in the table width. On the other hand, cell width includes the cell border width and padding of the cell. Here is the code that demonstrates how different widths are set.
Document document = new Document();
Page page = new Page();
Table2 table = new Table2(0, 0, 300, 500);
table.Border.Width = 5;
table.Border.Color = RgbColor.Red;
table.Columns.Add(100);
table.Columns.Add(100);
table.Columns.Add(100);
Row2 row = table.Rows.Add();
Cell2 cell = row.Cells.Add("Cell 1");
cell.Padding = 5;
cell.Border.Width = 5;
cell.Border.Color = RgbColor.Blue;
Cell2 cell2 = row.Cells.Add("Cell 2");
cell2.Padding = 5;
cell2.Border.Width = 5;
cell2.Border.Color = RgbColor.Green;
Cell2 cell3 = row.Cells.Add("Cell 3");
cell3.Padding = 5;
cell3.Border.Width = 5;
cell3.Border.Color = RgbColor.DarkOrange;
page.Elements.Add(table);
page.Elements.Add(new LayoutGrid());
page.Elements.Add(new Label("Table Width: " + table.Width.ToString(), 0, 50, 200, 20));
document.Pages.Add(page);
document.Draw("Table2.pdf");
Disclaimer: I work for ceTe Software, the company that develops DynamicPDF libraries.

How to resize the widget that hold a QTableView?

I have a QTableView inside a layout itself inside a Widget.
How I can set the Widget size after the call of tableView.resizeColumnsToContents() in order to have the same size of the table (and does not need a scrollbar )
Thanks
If I understand properly what you want is to adjust the horizontal size of the container widget to the size of the table contents (which is not necessarily the table size). The following method works for me with a small table of 20 rows and 3 columns:
ask the table model for the total number of columns (it should be returned by your implementation of the columnCount method)
ask the view for the width of every column using the columnWidth method and compute the total width of the columns
finally resize your container widget taking into account the total width of columns, the width of the table vertical header and the autoscroll margin
So the code would look like:
my_table_view.resizeColumnsToContents()
w = 0
for c in range(my_table_model.columnCount()):
w = w + my_table_view.columnWidth(c)
container_widget.resize(w + my_table_view.verticalHeader().width() + my_table_view.autoScrollMargin()*1.5, container_widget.size().height())
As I said, I'm assuming that you want to resize your widget horizontally.

Setting column width in RTF

I have what I hope is a simple question !
I am generating a simple RTF table that is subsequently opened in MS Word. The table is generating fine but the column widths are a little small and causing some word wrapping (not what I want).
The RTF code I generate is for a two line, three column table and is of the form:
\trowd \trautofit1
\intbl
\cellx1
\cellx2
\cellx3
{a\cell b\cell c\cell }{\trowd \trautofit1
\intbl
\cellx1
\cellx2
\cellx3
\row}
\trowd \trautofit1
\intbl
\cellx1
\cellx2
\cellx3
{d\cell e\cell f\cell }{\trowd \trautofit1
\intbl
\cellx1
\cellx2
\cellx3
\row}
What do I need to add to set a column width ? I have tried altering the column width in word and then examining the output but it is a little obscure to say the least !
The control words you are looking for are \clwWidthN and \clftsWidthN
Microsoft RTF Specification v1.9.1:
- \clwWidthN
Preferred cell width. Overrides \trautofitN.
- \clftsWidthN
Units for \clwWidthN:
- 0 : Null. Ignore \clwWidthN in favor of \cellxN (Word 97 style of determining cell and row width).
- 1 : Auto, no preferred cell width, ignores \clwWidthN if present; \clwWidthN will generally not be written, giving precedence to row defaults.
- 2 : Percentage (in 50ths of a percent).
- 3 : Twips.
So, in your case, you could just use \clftsWidth1 (automatically set width) or set the preferred percentages yourself e.g. \clwWidth2\clwWidth2500 (2500 = 50%)
Auto width
\trowd \trautofit1
\intbl
\clftsWidth1\cellx1
\clftsWidth1\cellx2
\clftsWidth1\cellx3
{a\cell b\cell c\cell }
40% - 30% - 30%
\trowd \trautofit1
\intbl
\clftsWidth2\clwWidth2000\cellx1
\clftsWidth2\clwWidth1500\cellx2
\clftsWidth2\clwWidth1500\cellx3
{a\cell b\cell c\cell }
The problem is in that you have set very small width for column:
\cellx1
\cellx2
\cellx3
To set width for column in RTF there is a keyword '\cellxN', where N - is column width in twips.
15 twips is 1px.
So if you want to create a simple RTF table with 1 row and 3 columns, 100px each, use this syntax:
\trowd\cellx1500\cellx3000\cellx4500
\intbl A\cell B\cell C\cell\row
You will get a simple table by 300px, 3 columns - 100px each, with invisible borders.
Cheers,
Max
You need to either use cellx0, so that autofit tag applies, or explicity set the number to the number of twips from the left border. In your example, you use 1 2 and 3 which is explicity setting the column widths to be very skinny. For example, something like:
\cellx5125
\Cellx6000
\Cellx8000
Note that these numbers are offsets from the left margin.
If you are going to do any RTF, I highly recomend the RTF Pocket Guide from O'Rielly
Check this link
http://joseluisbz.wordpress.com/2014/04/26/working-rtf-html-css-and-script-files-with-my-own-packages-java-and-php/
you can to make your own file.
TblData = new RTFTable(4,4); //4 Columns, 4 Rows
TblData.setWideCols(1000); //Width of 2000 to put all columns
TblData.setWideCol(0,3000); //Width of 3000 to Column 0

Resources