The bottom of the text is cut in columnHeader

Posted by: babe59 on 8 September 2017, 3:24 pm EST

  • Posted 8 September 2017, 3:24 pm EST

    Hello,

    The bottom of the text is cut in columnheader
    see "G" in word "message".

    I try to increase height
    childSheet.ColumnHeader.Rows[0].Height = 30;
    and vertical alignement
    childSheet.ColumnHeader.Rows[0].VerticalAlignment = CellVerticalAlignment.Top;


    but no success...

    thks



  • Replied 8 September 2017, 3:24 pm EST

    Hi,

    I tried this code with V10 and it seemed okay. Perhaps you could try this code and see if you get the same issue?

    DataSet ds = new System.Data.DataSet();
    DataTable name;
    DataTable city;
    name = ds.Tables.Add("Customers");
    name.Columns.AddRange(new DataColumn[] {new DataColumn("LastName", typeof(string)), new DataColumn("FirstName", typeof(string)),new DataColumn("ID", typeof(Int32))});
    name.Rows.Add(new object[] { "Fielding", "William", 0 });
    name.Rows.Add(new object[] { "Williams", "Arthur", 1 });
    name.Rows.Add(new object[] { "Zuchini", "Theodore", 2 });
    city = ds.Tables.Add("City/message");
    city.Columns.AddRange(new DataColumn[] {new DataColumn("City", typeof(string)), new DataColumn("Owner", typeof(Int32)), new DataColumn("message", typeof(string))});
    city.Rows.Add(new object[] { "Atlanta", 0, "Georgia" });
    city.Rows.Add(new object[] { "Boston", 1, "Mass." });
    city.Rows.Add(new object[] { "Tampa", 2, "Fla." });
    ds.Relations.Add("City/message", name.Columns["ID"], city.Columns["Owner"]);
    fpSpread1.ActiveSheet.DataSource = ds;
    fpSpread1.ActiveSheet.DataMember = "Customers";
    fpSpread1.ActiveSheet.SetColumnWidth(2, 150);
    fpSpread1.ActiveSheet.SetRowExpandable(0, false);


    Thanks, Gina
  • Replied 8 September 2017, 3:24 pm EST

    Hello,

    After test I saw that the proble is visible with Arial font


    fpSpread1.ActiveSheet.Columns.Count = 3;
    fpSpread1.ActiveSheet.ColumnHeader.DefaultStyle.Font = new Font("Arial", 10, FontStyle.Regular);
    fpSpread1.ActiveSheet.ColumnHeader.Rows[0].Height = 50;

    fpSpread1.ActiveSheet.ColumnHeader.Columns[0,2].Label = "abcdefghi";
    fpSpread1.ActiveSheet.Columns[0,2].Width = 200;
  • Replied 8 September 2017, 3:24 pm EST

    Hi,

    I tried this with V8 and V10 and both worked fine (VS2015, Win10). Have you tried creating a new test project with just this code to see if it still shows the issue?

    fpSpread1.ActiveSheet.Columns.Count = 3;
    fpSpread1.ActiveSheet.ColumnHeader.DefaultStyle.Font = new Font("Arial", 10, FontStyle.Regular);
    fpSpread1.ActiveSheet.ColumnHeader.Rows[0].Height = 50;

    fpSpread1.ActiveSheet.ColumnHeader.Columns[0, 2].Label = "abcdefghi";
    fpSpread1.ActiveSheet.Columns[0, 2].Width = 200;



    Thanks, Gina
  • Replied 8 September 2017, 3:24 pm EST

    Yes,
    I'd made a simple project to give you the code

    my simple project in attached file
    thks dt
    2017/03/TestSpread4.zip
  • Replied 8 September 2017, 3:24 pm EST

    I've just test on 2 others computers
    - Win10 : no good
    - Win 7 : good

    I try to change font size on windows : no good

    In this hardcopy, header is in "Microsoft Sans Serif" and cells in "Arial"
    You can see that header and cell are good
    Note that, in the cell, spacing before and after "e"



  • Marked as Answer

    Replied 8 September 2017, 3:24 pm EST

    Hi,

    I tried the test project you sent with Spread 8.35.20151 and Spread Win 10. The headers looked fine with both versions of the product. I used Visual Studio 2015 and Windows 10. You could try adding or removing the text renderer dll and see if that makes any difference.

    -Gina
  • Replied 8 September 2017, 3:24 pm EST

    Hi,

    This looks okay when I try it. I attached an image.

    Thanks, Gina

  • Replied 8 September 2017, 3:24 pm EST

    It's not the sam for me
    I've attached an image for my PC

    I work with Vs2015 Win 10
    What other settings should I look at?



  • Replied 8 September 2017, 3:24 pm EST

    Hi,

    FarPoint.Win.TextRenderer DLL was not in my project.
    Then I have added this DLL and now it's good.
    The font is a little bigger but all letters are displayed.

    then I must add this DLL on my project (it isn't automatically added)

    thks
    DT
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels