Telerik Report auto centre table - c#

I have created one report which hides some of the columns of table at end when some criteria don't match. For example, there are total 7 columns and I am hiding 2 columns when criteria don't match. This leads to so much empty space at right side as table don't centre automatically.
I have tried VerticalAlign = Middle but it is not working.

Finally after all efforts I didn't find exact solution but found one alternative.
I have applied Anchoring = Left, Right on table and that helps me to make my table looks better.
What it actually does is, it keeps width as it was specified and based on no. of columns, columns width either shrink or grows.

Related

How to align an autoadjust size using database fields in crystalreport?

I have a question I'm using vs2015 and crystalreport CRforVS_13_0_18. I designed my report but when this report has a field longer than the others columns, only this grows, Even I set all the fields to check the option Can Grows. Can you help me?. Thanks in advance. I share a snapshot.
And this is my designer.
When I put borders, they don't show with the same height. like this:
I did the extra section but i have problems with left and right lines.
Finally. i got to do lines untill the end of the section but how can i align in vertical center? please.
Add another section below Section 3. Let's call this Section N.
Put a horizontal line (as long as table width in Section 3) in this Section N, and decrease the height of this
section to as low as possible.
Reduces it only leave space for this horizontal like to be visible.
Now when you will be run the report, section N will be printed for every section 3 (row) and can help in drawing a line after each row.
Please show the "Informe principal view" if you can, to get a more clear picture.
So the field in description for item nº2 and 3 should grow ?
Can you try this:
Did you check the field in sql ?
Are the labels (Nº, Cant, Cod.Barras ...) on different sections than the fields ?
Are the fields you wanna grow on Details ?
Did you set a printer ?

MigraDoc - Table Border but no Cell/Row/Column Borders

I am struggling to implement what seems should be something straight forward, but having not much luck. I need a MigraDoc table to render with just the Table border, excluding all cells in between:
I have followed the remarks on this post:
How do you add a border around a table in MigraDoc?
Useful information but I havent been able to implement a full fix from it?
I have the following code run just before the table is added to the section:
table.Borders.Visible = true;
for (int i = 0; i < table.Rows.Count - 2; i++)
{
table.Rows[i].Borders.Bottom.Visible = false;
}
Which at first seemed like it did the job... until I come across a table that follows onto the next page... The bottom row border is obviously only rendered for the very bottom row and does not account for PageBreaks mid-table.
Surely there must be a better way of doing this?
EDIT: I appreciate this is somewhat of an old question, but just incase anyone ends up here looking for an answer...
Try using the SetEdge option. There's two ways you could do it, depending on whether you know how many table rows or columns you're going to have (static content), or you don't know yet (dynamic content).
Option 1: Static table content
Set your table up first, so all the columns, cells and rows exist, then add an edge border to your table with
table.SetEdge(a, b, x, y, Edge.Box, BorderStyle.Single, 1, Colors.Black);
The first four numbers a, b, x, y indicate which of the table cells you want to add a borders to, the first two numbers are the top left column then row (in your case to border the whole table, this should be 0, 0) and the second two numbers are the bottom right corner column then row (as per your example this is 3, 4, assuming the heading is a heading row).
After Edge.Box, the options are border style, border width, border color.
You can then add any extra individual borders per cell or row after as normal, so to add a border at the bottom of your header row as per your example...
headerRow.Borders.Bottom.Width = 0.2;
headerRow.Borders.Bottom.Color = Colors.Black;
Option 2: Dynamic table content
If you don't know how many rows or columns are in your table becuase the content is dynamic, the first four numbers in SetEdge could be set with this.table.Columns.Countand this.table.Rows.Count - for example :
table.SetEdge(0, 0, this.table.Columns.Count, this.table.Rows.Count, Edge.Box, BorderStyle.Single, 1, Colors.Black);
References
For more info, see this post:
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3598
And it's also here in the MigraDoc Example (search for SetEdge):
http://pdfsharp.net/wiki/HelloMigraDoc-sample.ashx

How to set the same number of data points in a Line Chart?

I have multiple series which share the same x-axis but some values are repeated as they have different number of data points. Since this is the case I want to set the same number of data points for all my series.
Is setting empty data points a solution to make all series have the same number of data points or are there any other solutions? If setting empty data points is a solution, how do I use it? My series aren't fixed and vary according to user selection.
They follow:
Chart1.Series[i].XValueMember = "Receipt date";
Chart1.Series[i].YValueMembers = "AvgAgingDays";
Is setting empty data points a solution?
Well, it certainly will achieve the counts to be the same. But how it looks is a different matter.
One question here is where do you inset them (X-Value), probably where they are missing, right?
The other question is what ChartType do your series have? Here are a few typical types:
Point, Bars, Columns: That is fine, just make the Color of the 'empty' Points Transparent!
Line, Area: That is more tricky. You don't want gaps in the lines so you need to keep them visible. And you want the lines to go straight so you need to calculate the Y-Values from the neighbours. Simple for one missing Point, a little bit more work for larger gaps. Not possible for points missing at the start or end. Those should be invisible again..
Spline: Next to impossible to get really right. Either put in some more work or live with some inaccuracies!
If you have a Line chart, to fully document the situation, you may consider adding a Point Series on top with the same data, but with the missing Points invisible.
Btw: If you have correctly set the XValueType as DateTime, all this ought to be unnecessary, as then the missing dates won't matter and the DataPoints all sit at their respective dates. They only shift if you don't have a valid X-Value and/or fitting XValueType.
This is a rather comon mistake because at first it all looks fine but without setting the type it will be string and then you run into trouble when you want to act on the values or rely on their positions or even just format them..
Btw: While it is possible to AddXY the missing points afterwards, it makes things a lot easier if you can detect and add them while adding the real points..

DevExpress Grid Custom Column Sizing calculation based on Grid Width

My project needs to display a list of contacts in a grid. Normal data - First Name, Last, City, State, Zip, Email, Phone, Company Name.
1 - We need to support wide variation in screen widths 800px -> 2,000px.
2 - We want to display as much information as possible, with as little white space as possible.
3 - As the grid gets wider, we want some fields to expand (Organization Name), others to stay at a maximum Width (State - 2 char).
None of the standard column resize modes seem to work since there is no Max Width column. The State column ends up with a ton of space, and the organziation is still being chopped off.
Has anyone resolved this problem?
I had similar problems with our Gridview and I have raised a ticket with Devexpress team for the same reasonsDevexpress ticket. It seems SetWidth() client side JS method does not work properly when you have fixed width columns.
In your case, I would suggest using percentage size for your columns which needs to be dynamically expanded and static size for the other ones.Also set the text wrap true for cells that you want texts tightly wrapped inside.
settings.Columns.Add(column =>
{
var commmonHeaderStyle = column.HeaderStyle as GridViewHeaderStyle;
commmonHeaderStyle.Font.Bold = true;
column.CellStyle.Wrap = DefaultBoolean.True;
column.FieldName = "Test";
column.Width = System.Web.UI.WebControls.Unit.Percentage(30);
});
You might also want to take a look at this example : Full Screen mode (100% browser Width and Height)

Can i make columns of my section in crystal report?

i am working in Crystal Reports for VS2010 with asp2.0 .net, can i make the columns of sections, as i have columns of my tables, and i dont want to overlap, as with labels, they overlap some times.
I am not familiar w/ the VS2010 .net interface, but if it is the GUI, you can set insert tab-stops at the desired spacing. The fields will "snap" and anchor to the tab-stop line when you move them. You can shrink/grow each field so that both left and right sides are anchored, constraining that field. You can then take the next field, and anchor it's left side to the right-side tab-stop from the last field, and repeat. When you're through, all fields will be nicely constrained, and you can adjust the placement by moving the tab-stop. The fields will "rubber-band" and grow or shrink w/ the movement of the tab-stops.
This is REALLY good when you need to export to Excel format, and you don't want the CR print engine to include extra lines/columns as it tries to match the "just a little off" layout.
I "think" I need less "air quotes" and more "air guitar".

Categories

Resources