This is a migrated thread and some comments may be shown as answers.

How can i set the unit of measurement using code in telerik report viewer

1 Answer 303 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
paupau
Top achievements
Rank 1
paupau asked on 20 Oct 2020, 09:40 AM

I'm just new here in Telerik Forum, I don't know if I'm in the right thread to ask this question.

I just want to know how to set the unit of measurement programmatically(code) using Telerik report viewer WinForm, Because I'm having a problem in viewing the print preview of my report using (US) System Unit Measurement ( Type: Metric / US ). In the Telerik Report Designer there is an option where you can change the Unit of Measurement, by changing the right unit of measurement in Telerik Report Designer the print preview is ok. but when I execute the program and print preview using Telerik Report Viewer WinForm  the print preview is not aligned correctly because it is set by default. and I guess the default unit of measurement of Telerik Report Viewer WinForm is (cm / Metric). Sorry for my grammar XD thank in advance.

1 Answer, 1 is accepted

Sort by
0
Accepted
Todor
Telerik team
answered on 23 Oct 2020, 07:20 AM

Hello paupau,

The UnitOfMeasure property of the Report determines the default measure unit only of the newly created Report items. The default unit of measure in Telerik Reports depends on the current culture of the machine. For the US culture, it is 'in'. If you would like the already created items to be converted to the same unit you need to do this manually.

Generally, the item properties with measure, like location, width, etc. may have different measurement units. The Reporting engine respects the units set in the report definition. When rendering the report, all units get converted to 'px'.

If you need to change the unit of measure of an item with code, you need to instantiate the report, for example, by unpackaging a TRDP report and modify the corresponding location/size properties of the item. You may create/open a CS/VB report in the Visual Studio Report Designer and see the InitializeComponent method that holds the report definition for hints.

Regards,
Todor
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
paupau
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or