Reports for WinForms

table column width add 10%

  •  sdinformatika said 11 months ago:

    I have strange problem.

    Columns in my table seem to strech when I set document right margin. It adds approximately 10% to each column.

    But if I dont set margins, columns and whole table shrinks, not 10% but noticably.

    I have 8 columns different width, if I reduce number of columns to 3, first and second column is shrinked, but third column is widen to margin.

    In my rendertable I set margins to be 10mm

    ps.LeftMargin = New C1.C1Preview.Unit("10mm") 
            ps.RightMargin = New C1.C1Preview.Unit("10mm") 
            ps.TopMargin = New C1.C1Preview.Unit("10mm") 
            ps.BottomMargin = New C1.C1Preview.Unit("10mm") 

    next, before adding text to cells I set column width to specific measure:

    Dim u As C1.C1Preview.Unit
    u = New C1.C1Preview.Unit("30mm")
    rt.Cols(col).Width = u
    

    next I set text to my columns through RenderText object like:

    rt.Cells(newrowindex, i).RenderObject = New C1.C1Preview.RenderText("Some text")
  •  Reeva2p said 10 months, 4 weeks ago:

    Hello,

    I am unable to replicate the issue at my end with your code. Please have a look at the attached sample for the same wherein we have implemented both the scenarios:-

    1) with Margins and column’s width
    2) without Margins and column’s width

    and let us know what are we missing in order to replicate the issue. Please try the same with the latest build of C1Report 2012 V2.

    Thanks,
    Reeva Dhingra

    Attachments:
    You must be logged in to view attched files.
  •  sdinformatika said 10 months, 4 weeks ago:

    Thank you Reeva.

    My case is simmilar to yours, except I didn’t set width of table, and I’m using C1 assembly version 2.

    When I try to set width of table, margins don’t interfere, but I expected table width to be sum of all it’s column widths. Is that possible in version 2?

    My example is in VB.

    Regards.

    Attachments:
    You must be logged in to view attched files.
  •  Reeva2p said 10 months, 3 weeks ago:

    Hello,

    I am not too sure what are you looking for as this is the correct behavior wherein if column width’s are not explicitly then the default column width’ are set in each column and this is getting replicated in the sample already attached by you.

    Could you please explain again what are you looking for in detail.

    And here is the link to get the latest 2.0 build of C1Report of 2012 V1/ V2:-

    http://prerelease.componentone.com/dotnet20/C1Report/2012-T1/

    http://prerelease.componentone.com/dotnet20/C1Report/2012-T2/

    Thanks,
    Reeva Dhingra

    Answer
  •  sdinformatika said 10 months, 3 weeks ago:

    Hello Reeva,

    I was under impression that when table width AsUnit property is Parent.width, actual width of table will be sum of width of all columns.

    Is that correct?

    Because in my example table width is from margin to margin, and one of the column width is larger then set in code.

    In attachment I printed my printpreview document in pdf.

    Regards

    Attachments:
    You must be logged in to view attched files.
  •  Reeva2p said 10 months, 1 week ago:

    Hello,

    Are you setting width of table and column’s width separately. Let me clarify to you that tables’s width is maintained irrespective of margins being set.

    1. If table width is greater than sum of all columns width then table will stretch itself depending on table’s width.
    2. If table width is less than sum of all columns width then table will shrink itself depending on table’s width.
    3. If table width is not set then column’s width will be auto-sized or column will resize depending on column’s width being set.
    4. If only one column’s width is set then rest of the columns will adjust itself depending on table’s width or aspect ratio.

    Hope this clarifies the thing and help in resolving your issue as it is still not replicable at our end.

    Thanks,
    Reeva Dhingra

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.