Convert a grid column with to inches for dynamically created section report

Posted by: kim on 21 February 2021, 5:00 pm EST

    • Post Options:
    • Link

    Posted 21 February 2021, 5:00 pm EST

    Hello,

    I am passing a DataGridView full of data to dynamically generate a code based section report.

    I need to create labels across the top of the Groupheader that matches the column text of the grid columns, and also need textboxes in the Detail section.

    The with of the grid columns are in pixels, yet on the report I need to place the location and size in inches. How can I set the width of a label and textbox so it closely matched the width of the grid columns?

    For example I have 5 columns with the follow grid column widths

    Stock Number = 50

    Description = 150

    Price = 50

    Quantity = 25

    Held = 25

    What math would I use to place textboxes/labels across the report matching the widths?

  • Posted 21 February 2021, 5:09 pm EST

    As an FYI I have been using 1 pixel = 0.0104166667 inches and it seems to be close. Just wondering what others use.

  • Posted 22 February 2021, 3:37 am EST

    Hello,

    Pixel depends upon the DPI of the Screen. A 600 x 400 pixels image displayed on a 96 DPI screen is going to have 6.25 x 4.17 inches when printed. So, you can use “1 pixel = 0.0104166667 inches” formula to convert the Pixel to inch at your end.

    Thanks,

    Mohit

Need extra support?

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

Learn More

Forum Channels