LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Report - Fit Control to page

I am printing a graph from a high resolution monitor to a report using the append control funtion in the reporting. I want to fit the graph to the page that I am printing on. Currently it goes about 2cm over the bottom margin in landscape mode and I miss the graph scale off the bottom. along with some of the data points.

It must be possible to fit the control to the page somehow. Please has anybody got any experience of this?

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 1 of 11
(3,849 Views)

James W,

 

One way of doing this is to create a subVI which has a copy of the graph and anything else you want printed but sized to fit the paper.  Make sure its front panel is open (even if offscreen), write all the data to it, then print.

 

Lynn 

0 Kudos
Message 2 of 11
(3,841 Views)
Surely there is a neater programatic approach than setting up a SubVI with the correct Pixel/paper size ratio. That seems ridiculous as it is not modular or scalable - entirely not what NI is about.
CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 3 of 11
(3,833 Views)

Hi James W,

 

Forgive me if I have misunderstood you but do you mean that when you go to the options for printing your VI, the output from the printer is not correct. Have you checked your printer's settings and made sure that it is printing in the correct paper format? Is there a minimum margin that your printer can print to?

 

Thanks,

Andrew McLennan
Applications Engineer
National Instruments
0 Kudos
Message 4 of 11
(3,800 Views)

Hi Andrew, 

 

I've tried changing the margins and everything.

When Printing Portrait, the control is squashed to fit to the page with a large marging on the right, but not stretched vertically.

When printing Landscape, the control is printed with the bottom 1.5 cm missing (on what would be full size a4)

getting the printer to print at 50%, results in the same cut off image but at 50% of the size. It is obviously something about the way that LabVIEW is spooling to the printer and is not sending all of the correct info or assumes a default paper size which is not ISO standard.

I set my margins at 0.5cm all around the page, - it just moved the plot up and left on landscape mode.

I am using code almost identical to the shipping example of how to Print a control to a report (web or printer). In fact I just saved this code and added the change page orientation in the Printer case. As I can't set the paper size I suspect this may be part of the issue, but I'm not sure.

 

James

 

Message Edited by James W on 11-05-2008 10:24 AM
CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 5 of 11
(3,797 Views)

Hi James,

 

Have you tried just printing out the report using the standard File->Print. Can you try and verfy that you can print the control out as you want. I was wondering if you could create a separate printer in the printer settings and configure it to have different margins and see if that helps the issue.

 

Could you possibly test this issue on another printer and see if it is reproduceable? If you post your code, I can try it here.

 

Thanks,

Andrew McLennan
Applications Engineer
National Instruments
0 Kudos
Message 6 of 11
(3,793 Views)

Hi  Andrew,

 

Attached are 3 VIs. Two are the reporting VIs,

1 is the FP of the VI I am trying to print. I have removed vast chunks of code from behind it, and it may have dependencies on other VIs. so I'm not sure if you will be able to open the FP VI.

I hope this allows you to see what I am trying to do.

(The FP has a Tab Control, each tab contains n graphs, 1=<n=<4) I print either the acitve graph on the tab, or the whole Tab, as it is such a complicated control, you can understand why creating a subVI is not ideal.

 

(I ran this VI on 2 different machines to 2 different printers before I started posting, so I'm sure the problem is in the code, not the machine or printer.) 

 

James

Message Edited by James W on 11-05-2008 02:43 PM
CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
Download All
Message 7 of 11
(3,780 Views)

Hi James,

 

I can't run your Analysis VI as I don't have all of the subVIs. Could you possibly try running the VI and generating an HTML report so that I can have a look at what is output?Could you possibly include all the subVIs so that I can try running the VI here. 

 

Thanks,

Andrew McLennan
Applications Engineer
National Instruments
0 Kudos
Message 8 of 11
(3,759 Views)

Hi James,

 

I made a simple program to try and replicate the issue and I think I can see what you mean. If the control is over a certain size, when you print the report, it will chop off the bottom of the control. Have you tried any of the following?

 

1. Making the control slightly smaller.

2. Printing the Control using the standard dialogue box (File->Print...).

3. Adjusting the margins so that the control is offset to the top of the page.

 

I shall keep investigating this problem to determine whether or not it is a bug. 

 

Please let me know how you get on,

 

Thanks,

Andrew McLennan
Applications Engineer
National Instruments
0 Kudos
Message 9 of 11
(3,721 Views)

Hi Andrew,

Yes I have tried all of the following:

 

1) This works but is no good for my application where I want to display the control over most of a (1400*800 ?) widescreen.

2) See  Report.VI attached above.

3) With a large enough screen resolution - and screens are getting ever bigger, this does not work.

 

I urge NI to fix this proglem fast if it is a bug and there is not already a feature in place to get around it as this will soon become a major problem due to screen resolutions outstripping printer resolutions by far.

Message Edited by James W on 11-10-2008 11:02 AM
CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 10 of 11
(3,718 Views)