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.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I can't seem to place a bitmap in a Word file where I want it

I think that the only way to write a report in CVI is to use the functions in the WordReport.c file but the dcumentation is rather light. I can't get a bitmap to be positioned as I would like it. WordRpt_MoveImage just seems to make the image disappear. I had hoped that the bitmap would be located where ever the cursor was but that does not seem to be the case. Any ideas on this and or where I can find more documentation on writing reports (with graphs) from CVI?

thanks
0 Kudos
Message 1 of 8
(3,143 Views)
Hi,

If you are interested in creating reports and printing them out you may want to use the NIReports tools. YOu can load the instrument driver from: C:\Program Files\National Instruments\CVI70\toolslib\reportgen\nireport.fp it has an easy to use API to create and print reports.

About the Move image function, you may want to check that you don't get an error back, you can also check the msdn.com to see what is the point of reference used in with this function, those functions are just the functions from the ActiveX interface for Word.

I hope this helps.

Regards,

Juan Carlos
0 Kudos
Message 2 of 8
(3,143 Views)
thanks
The problem with my Move image command was that the params I used were too big.
I gave up on NIReport because the mthod of saving the report by printing to a file seemed like such a kludge. So when I got the print error, I was quick to give up.
But a reasonable solution, using ideas from WordRpt.prj, is to use a Table. I just made a table with 1 row and 3 columns. Functions from WordReport.c allowed me to place an image in cell 1, text in cell 2, and another image in cell 3. This has a few drawbacks, but is generally ok. I looked at MSDN.com and searched for keywords but found nothing. Do you have any knowledge about a doc for the layer of software between the NI functions and the Word ActiveX controls? That would be a great help.
In general, I th
ink that the ability to write a report from within CVI is the weakest part of CVI. We all do this to make measurements, and the report is the final result of all that work. Its the only thing that the customer really sees. I wish that NI would put more effort into this area.
That being said, I think that CVI is the greatest thing since sliced bread. I wish that I had tried it years ago. My thanks to you and everyone else on the LabWindows/CVI team.
0 Kudos
Message 3 of 8
(3,143 Views)
I'm using LabWindows 5.5. I don't have the library shown below
(...\CV170\}. How do I install it?


> If you are interested in creating reports and printing them out you
> may want to use the NIReports tools. YOu can load the instrument
> driver from: C:\Program Files\National
> Instruments\CVI70\toolslib\reportgen\nireport.fp it has an easy to use
> API to create and print reports.
0 Kudos
Message 4 of 8
(3,143 Views)
I'm not sure if that library is included in CVI 5.5, but if it is just go to the folder where CVI 5.5 is installed and look for a toolslib folder. If it is included should be in some folder there.

Good Luck!
0 Kudos
Message 5 of 8
(3,143 Views)
Hi,

A couple of ideas here for you...

I think that the functions that are provided for report generation are basically a fp form of the ActiveX methods and properties exposed by Word. Looks like they were created with the "Generate ActiveX Controller..." Wizard, that just creates a nice wrapper to the ActiveX objects.

Another thing that you can try is to create an HTML report. Basically you create a nice template with any HTML editor and in your CVI code just insert the data and the template to a new HTML file, you can also change the images and the table content. The advantage of this reports is that pretty mucha any computer can read them, you can post them to the web and you can use the ActiveX web container to view the reports in your a
pp and print them out.

Hope this helps a bit.

Regards,

Juan Carlos
0 Kudos
Message 6 of 8
(3,143 Views)
ok
The heat is off of this area for now, but when I get back to it, I will look into this approach.

thanks for the tip
bg
0 Kudos
Message 7 of 8
(3,142 Views)
Hi,

I had this problem too, and i solved it by creating a table of (1 row x 1 column) in that which i inserted the bitmap image. Then you can move the table with your image where you want, because now the image is not a floating object.

Here are the 3 lines that do all the job

WordRpt_AddTable (docHandle, 1, 1, &tableHandle);

WordRpt_GoToCell (tableHandle, 1, 1);

WordRpt_InsertImageInCell (tableHandle, imageFileName, &bitmapID);

How you can see this solution is very simple, and works very fine.

Regards

Eduardo
0 Kudos
Message 8 of 8
(3,142 Views)