LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get the real paper width in NIReport

I want to print a table control, but I am not able to get the width of the real paper. How can I do it? Thank you.
0 Kudos
Message 1 of 6
(2,943 Views)
Hi,

You can us the function NIReport_GetReportAttribute(...),the attribute NIR_ATTR_PAPER_SIZE can tell you the size of the paper that its configured for your report. It is most common for you to set this attribute based on the report based on the paper that you rreport will require; however you can also read back this setting.

I hope this helps.

Regards,

Juan Carlos
N.I.
Message 2 of 6
(2,943 Views)
Thank you very much.

By "NIReport_GetReportAttribute" I can get the code of the paper size, But how can I convert it to real width with unit cm or inch?

In fact, I want to print a table in the center(left - right) of paper, But I can't do It, Can you help me?

Thank you very much!
0 Kudos
Message 3 of 6
(2,943 Views)
Hi,

I belive that you can use the NIReport_SetTextAttribute(...) function to set the text to be centered right before you create the table this should center the rest of the table. Something like this:

NIReport_SetTextAttribute (reportHandle, NIR_TEXT_ATTR_ALIGNMENT, NIRConst_Center);
NIReport_TableStart (reportHandle, 4, 1);
NIReport_AppendText (reportHandle, CONF_SN_TEXT);
NIReport_TableNextCell (reportHandle);
..
..
..


There should be no need to wory about the pared size, the centered attribute should take care of that for you.

I hope this helps.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 4 of 6
(2,943 Views)
Good!

Great your idea, I'v got it, Thanks for your help very very much.
0 Kudos
Message 5 of 6
(2,943 Views)
I'm glad this worked.

Good luck with your project.

Juan Carlos
0 Kudos
Message 6 of 6
(2,943 Views)