Glitch in c1TrueDBGrid/C1Report

Posted by: jimmcgoldrick on 24 April 2020, 6:40 am EST

    • Post Options:
    • Link

    Posted 24 April 2020, 6:40 am EST

    I am using WinForms with VS13 and .Net 4.61. I noticed that with Windows 10 Display Settings, Scale and Layout set to 125% (Recommended) the Grid Print Preview Display using C1Report Libraries is scaled incorrectly and looks a mess. It works correctly when set to 100%, but obviously I can’t insist that my Customers change to this.

    My Form`s code is as follows:

    private void Form1_Load(object sender, EventArgs e)

    {

    c1TrueDBGrid1.HeadingStyle.BackColor = Color.Aquamarine;

            DataTable table = new DataTable();
            table.Columns.Add("Dosage", typeof(int));
            table.Columns.Add("Drug", typeof(string));
            table.Columns.Add("Patient", typeof(string));
            table.Columns.Add("Date", typeof(DateTime));
            table.Columns.Add("Price", typeof(Decimal));
    
            // Some Data
            table.Rows.Add(25, "Indocin", "David", DateTime.Now, 23);
            table.Rows.Add(50, "Enebrel", "Sam", DateTime.Now, 12);
            table.Rows.Add(10, "Hydralazine", "Christoff", DateTime.Now, 11.6);
            table.Rows.Add(21, "Combivent", "Janet", DateTime.Now, 13.09);
            table.Rows.Add(100, "Dilantin", "Melanie", DateTime.Now, 43.39);
            table.Rows.Add(2, "Statin", "Hubert", DateTime.Now, 9.18);
            table.Rows.Add(1, "Beta-Blocker", "Sheamus", DateTime.Now, 24.80);
            c1TrueDBGrid1.DataSource = table;
        }
    
        private void button1_Click(object sender, EventArgs e)
        {
            c1TrueDBGrid1.PrintInfo.PrintPreview();
        }
    

    I wonder if there is a fix. Please. if you aren`t currently engaged in more important things, I would appreciate some assistance.

    very respectfully,

    Jim McGoldrick.

  • Posted 27 April 2020, 3:45 am EST

    Hello,

    Please use the following line of code:

    ```

    this.c1TrueDBGrid1.PrintInfo.MeasurementDevice = C1.Win.C1TrueDBGrid.PrintInfo.MeasurementDeviceEnum.Printer;

    
    Thanks,
    Mohit
  • Posted 27 April 2020, 8:15 am EST

    Just the trick, thanks Mohit

Need extra support?

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

Learn More

Forum Channels