clj-pdf seemingly doesn't handle table overflow correctly - clj-pdf

I have created a pdf doc in clj-doc:
As you can see, there's an overlap of a table and the footer, and I'm so far not able to make them not overlap and put the rows on the new page. Setting document margins affects all text, including headers and footers.

Related

Automatically resize form and move controls when new ones are added or a text in a label grows

Beginner in Visual Studio here.
I'm trying to create an C# Windows Form application that simply displays a form to show some information about the local system.
I have created this form with the help of the VS designer:
As you can see, it consists of a simple panel with a PictureBox at the top, a label below it (both centered), three table layouts next to each other, and a button at the bottom. Never mind the label texts.
The rows of all the table layouts are set to absolute, this is because I want to programatically add rows to the end middle and right table layout if there are more than one local IP address in the computer and setting the rows to auto size or percentage would make alignment difficult if more rows are added.
Now, my problem is that I can't figure out how to make the form resize and move the controls (specifically move the 'OK' button down) when more rows are added.
I have tried anchoring the button to the bottom edge of the form as well as the bottom of the middle table, both produce the same result: the button stays where it is and the new rows overlap it, like this
I would also like to know how to have the form resize to fit the contents of the labels. For example, if the text in one of the labels inside the layout is bigger than the column width, I'd like to have the form grow to accommodate it. Likewise, I'd like the form to shrink to fit the largest text.
I realize that this may not be the most efficient or easiest way to create this particular form, but it is what I've come up with, I of course welcome any suggestions in that regard. It is important to maintain alignment between the rows of all table layouts.
Thanks in advance.
Use a data grid and add controls to it if an add button is pressed. You can scroll through the rows so you won't need to adjust the height of the form

How could I interactively create an invoice and preview it on WPF?

I'm creating a trial project wherein my window has two grids, left grid is sort of a table that has labels and textboxes each row and asks for a specific part of the invoice like item, name, address stuff like that and the right grid is to show a preview of the invoice that the left side is creating.
I thought about using a document viewer on the right side but I thought that anything I open there would be static and if I put values on the textboxes on the left grid, it wouldn't matter since I opened a standalone document to view on the right grid.
I thought about just creating a table out of the right grid and have the default values and populate the other ones when a user types something on the textbox and make it function as the preview but then I don't know how would I go about and printing it and also, it has about 45 rows which I couldn't fit in the grid without it being unreadable (because I had to cram 45 rows of data inside that small grid)
So is there a tool in the toolbox that could potentially create a interact-able grid? I tried the grid control but I can't seem to only make it show 4 columns because that's all I need, I don't want it to show E and the rest of the alphabet because I want it to resize accordingly with only 4 columns to make it more readable.
Oh and I also have devexpress installed so you guys could also recommend something I can use from there. Thank You.
I think this is the best solution since it does what I wanted it to do.
I created a scroll view and placed a grid inside it then set the length accordingly to show it in a reasonable size and let the scroll bar do its magic for me to see the rest of the grid without compromises of the content's size.

Having issues with Infragistics column resizing

I have a grid and I would like to automatically resize the columns. I'm running into inconsistencies when using different parameter values for PerformAutoResize(). When passing in the values below, where the true means include column headers:
PerformAutoResize(PerformAutoSizeType.VisibleRows, true);
some columns will be resized based solely on the header, while others will resize properly based on both the header and the row values.
However, if I hardcode in a value:
PerformAutoResize(20);
It works fine for every column.
Why is this?
UPDATE
Through some trial and error I've come to the conclusion that I think the issue is that I bring in the data and then have it auto-sort by a certain row. When using a hard coded value, it appears to auto-size the columns after that initial auto-sort, whereas when I use PerformAutoSizeType.VisibleRows it appears to auto-size the columns before the initial auto-sort.
Does PerformAutoResize(PerformAutoSizeType.AllRowsInBand, true); give you the results that you are looking for?
If so then is it possible that when you make the call that the row that you want to size the grid by isn't visible?

Can I force a Chart at the top of a report to always be visible

I have the following report:
In Excel I'd use something called Freeze Pane below the chart ....this would mean as the user scrolls down, the table will scroll, but the chart would always remain visible.
Is it possible to implement this behavior in RS?
EDIT
Note: the chart and the tablix use different Datasets
Yes, you can get this going with a bit of tweaking.
With Tablix objects, you have the option to fix header rows, i.e. they will stay at the top of the page when scrolling.
You can set this at the Tablix level:
Or at the row level with Advanced Mode set by using the FixedData property:
So what you can do to take advantage of this is to insert a Chart into those repeating Header rows. I tested this with a basic report:
This did succeed in having the Chart scroll with the Tablix, so will fulfil your requirements. One warning - it didn't look good when I did this (overlapping cells and the like), but it was a report with zero formatting so hopefully this will be helpful for you, anyway.
Edit after comment:
In my simple report example I added a new Dataset to the report, and pointed the embedded Chart to this new Dataset - this didn't work, as every time I did this it would always revert to the old Dataset (i.e. the one specified at the Tablix level).
However, what you can do instead is use a Subreport, which contains the required Chart, and embed this Subreport in the Tablix header. I just tried it now and it worked as required; the Chart using the second Dataset was fine and it scrolled with the Tablix as required.
So it's still a viable option with multiple Datasets, you just need the extra step of using a Subreport:
New report:
Subreport:

Right Align DataGridView Column Header in Winforms

I have a column Name "Quote Price" in a DataGridView winforms control. I can right align a column with no spaces such as "Unit" howerver I can't right align the column header with column Name called "Quote Price". I have attempted to use the TopRight, MiddleRight and bottomRight with no success.
SelectedAdditionalCost.Columns["Quote Price"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight; // Doesn't want to right align
SelectedAdditionalCost.Columns["Quote Price"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; // column contents No worries, right aligns.
I am sure I am doing something really silly, however, I can't get this working.
As I was writing up the below I realised something that may be the problem - the name of a DataGridView column cannot contain a space - you are referencing the columns collection by the header text, not the column name. Although, when I try and run code like you have in your example I hit a runtime error (null reference exception).
Anyway, that aside:
The code you have works perfectly for me, I implemented the following in one of my datagridview test projects (in the constructor) and the header text right aligns:
dataGridView.Columns[1].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
dataGridView.Columns[2].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
Because you mentioned the space on the header text, column 2 included a space in its text.
One thing I've seen mentioned is that the header text can appear to not right align when the sort glyph is stopping it from aligning fully to the cell margin.
See if this makes any difference:
dataGridView.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable;
You can Align all the column headers like that, rather than doing it one by one..
//MiddleRight Alignment for DataGridView Column Headers
DataGridViewCellStyle colHeaderStyle = new DataGridViewCellStyle();
colHeaderStyle.Alignment= DataGridViewContentAlignment.MiddleRight;
..... some other styles (like color, font etc) .........
dataGridView_custom.ColumnHeadersDefaultCellStyle = colHeaderStyle;
Reference taken from a VB answer, tested as ok.

Resources