From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

NiReport and plotting 2 graphs on the same line

Hi, i'm using NiReport and would like to plot 2 graphs on the same line. (that is, the output should have 2 side by side graphs on the same line) however when i enter the sample code shown below i get graphs on what appear to be separate lines. the graphs themselves are pretty small so, in principle, i figure you ought to be able to do this. can anyone help?

sample code:
CNiReport myreport;
CNiPicture graph1 = m_graph1.ControlImage();
CNiPicture graph2 = m_graph2.ControlImage();
myreport.Body.AppendPicture(graph1,"some caption");
myreport.Body.AppendPicture(graph2,"more captions");
myreport.NewLine(); //skip a line
etc...
report.Print(); //dump to printer

thank you very much,
ken
0 Kudos
Message 1 of 2
(2,575 Views)
First, I'm not sure if you meant to do this, but to print the report, you have "report.Print()" instead of "myreport.Print()." That may have just been here, though.

I would play around with the Print function for a while. I don't use it very often, but you might want to try it with different objects and see if it's able to align them properly. Do you know if this happens with other controls than just graphs? Let us know what you find.
J.R. Allen
0 Kudos
Message 2 of 2
(2,575 Views)