LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Kingsoft With Report Generation Toolkit

Hi Folks,

 

Our company recently migrated from MS Office to Kingsoft. In the process, all hard drives were either reformatted or Office was removed. Now, our LabVIEW software using the Report Generation Toolkit will not print reports. Interestingly, I have Office on my laptop and downloaded Kingsoft. LabVIEW now opens Kingsoft on my machine rather than Office (Word or Excel). I suspect that since I have Office, the classes are registered and Kingsoft works. On the machines at work, since Office is not installed, I think maybe the Kingsoft installation must not register an OLE class name.

 

Is there a way to use Kingsoft with the Report Generation Toolkit without having MS Office?

 

If the toolkit cannot be used and I used ActiveX, does anyone know how to link to the class for Kingsoft? I find no entries when I browse for an ActiveX class.

 

Thanks,

John

0 Kudos
Message 1 of 10
(7,099 Views)

For $8.25/month, you can purchase Office 365 for the PC that needs to generate Reports with LabVIEW's RGT.  Compared to the cost of the LabVIEW license, this is trivial.  You'll need to "sell" this idea to your company, which removed Office in favor of the "free" alternative that NI does not "recognize" as the subject for the RGT.  Do they really need/want these Reports?  Are they willing to invest in the far-more-expensive time and effort for you to develop "hooks" into their "free" Office replacement?  Are they at all concerned with the ability to maintain this "one-off" kludge?

 

Bob Schor

0 Kudos
Message 2 of 10
(7,082 Views)

http://digital.ni.com/public.nsf/allkb/C9408B9F08D711E786256F3300701D01

 

This states you need MS Office components installed to get the toolkit to work.

 

It sounds like the ActiveX calls are similar if you're able to get it to work on the one machine, though.

0 Kudos
Message 3 of 10
(7,059 Views)

It would seem rather strange that Kingsoft more or less hijacks the MS Office registration for its own use but requires MS Office to be installed to work. According to this site:

 

http://www.binarynow.com/office-suite/kingsoft-office-2009-supports-microsoft-office-word-excel-api-...

 

Kingsoft provides an MS Office compatible Automation Server interface but uses its own Automation Server interface.

 

If and I say specifically IF this Kingsoft claim is fully valid (and this may actually vary depending on the MS Office and Kingsoft versions involved) you could most likely make a Report Generation Toolkit interface to Kingsoft by simply connecting the ActiveX reference on the front panel of "vi.lib\Utility\NIReport.llb\Word\new report subVI.vi" and "vi.lib\Utility\NIReport.llb\Excel\new report subVI.vi" respectively point to the Kingsoft Automation Server interface. This interface defnitely needs to be registered as seperate component from MS Office or Kingsoft would likely be out of business by now from Microsoft legal actions!

I'm not sure under what name the Kingsoft software would register its Automation Interface, the names mentioned in above link are the Object names but in LabVIEW you need to search for the library name of the Automation Server to select.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 10
(7,026 Views)

Can you use HTML format instead ?

Then you don't need MS Word or Kingsoft.

 

George Zou
0 Kudos
Message 5 of 10
(6,999 Views)

Thanks Rolf,

 

What do you mean by "This interface defnitely needs to be registered as seperate component from MS Office or Kingsoft would likely be out of business by now from Microsoft legal actions!"? And, when you speak of an interface, you have risen above my expertise here. What interface now exists between LabVIEW and Office? I thought it was the NI_Word.lvclass and NI_Excel.lvclass libraries. And, I didn't know they were registered...

 

I've searched the registry and found no entry for Kingsoft or WPS nor have I found its components; Writer (Word), Spreadsheet (Excel), and Presentation (Powerpoint). In my ignorrance, I was wondering if I were to add registry entries in HKEY_LOCAL_MACHINE\SOFTWARE and the subkey CLSID for Excel and Word but point to Kingsoft, it may work. But I suspect there are other registry values of which these entries are dependent.

 

What do you think?

 

Oh, and thanks to others for their input. HTML is not a good option for our formatting and the company WILL NOT go MS.

 

Thanks,

-John

0 Kudos
Message 6 of 10
(6,970 Views)

Microsoft Word and Excel provide a DLL that is registered in the registry to provide an ActiveX interface for the Word and Excel Automation class. The entire list of ActiveX Automation Servers registered in Windows is what LabVIEW will show you when you select an ActiveX refnum and choose the Browse right click menu entry.

 

Kingsoft really can't go and replace that registry entry to its own DLL and hijack in that way any application who tries to make use of Word or Excel through ActiveX Automation. And they didn't. Instead they created their own DLLs which supposedly provides the same ActiveX interface as the Microsoft products and register them under a different name in the registry. We talk here about the ActiveX interface, not the LabVIEW internal class interface to its Factory based Report Generator class interface.

 

Normally to add another interface to the Report Generator one would have to create an entire new LabVIEW class to the directory structure in the report generator toolkit and modify the New Report.vi to also understand that new class. Since the Kingsoft ActiveX interface claims to be compatible to the MS Office ActiveX interface it would be theoretically enough to simply modify the vi.lib\Utility\NIReport.llb\Word\new report subVI.vi and vi.lib\Utility\NIReport.llb\Excel\new report subVI.vi. In both of these you have an ActiveX refnum outside the visible front panel area on the lower end with the label Word._Application or Excel._Application. If you right click on that refnum and select Select ActiveX Class->Browse you get a list of all registered ActiveX interfaces in your computer. In that list you should be able to identify the Kingsoft WPS and ET (or KET in newer versions) interface and by selecting that you should then see an option to select the Application object in the lower box. Save the VI and it should now invoke the Kingsoft software. If the Kingsoft ActiveX software interface is truely Microsoft Office compatible it should work.

 

Kingsoft is the only one who really can tell you how to interface properly to their software using ActiveX. If they can't or don't want to help you then you should definitely talk with your management about the options. It would really come down to either allowing another Office package, accept HTML reports or forget the test reports altogether. Hacking the registry is no option. It's not just changing a single entry but redirecting a whole bunch of entries to point to the right Kingsoft DLLs. There must be some entry somewhere somehow with "wps" and "et" or "ket". That are the names the Kingsoft forum entries claim to need when interfacing to their ActiveX interface from Visual Basic. LabVIEW does not show these short names in the selection dialog since they can be pretty meaningless, but uses the full registration name for every ActiveX component. Maybe Kingsoft only reuses an ActiveX interface from a different software (open source?) package and it is really registered  under a different name.

 

And even if you find how to relink to the Kingsoft ActiveX interface, this is obviously a hack. You will need to change these two VIs on every computer you want to call the Kingsoft software and need to reapply this change after every repair/reinstallation of LabVIEW.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 7 of 10
(6,957 Views)

Thanks for the detailed explaination, Rolf.

 

Unfortunately, either Kingsoft does not register as an Active X class or it is hidden in an obscure type library with a name not connected to Kingsoft or WPS.

 

It is too bad. The software is very friendly and functional, supports automation (at least between itself :), and for this company, is an attractive alternative to Office.

 

I guess HTML looks better all the time...

 

Thanks,

-John

 

 

0 Kudos
Message 8 of 10
(6,929 Views)

Google it.  See how other people use it in other programming Languages.

 

 

George Zou
0 Kudos
Message 9 of 10
(6,918 Views)

@zou wrote:

Google it.  See how other people use it in other programming Languages.

 


Unfortunately that is not going to help very much, since all the examples on the web are about accessing the Kingssoft ActiveX interface through Visual Basic. Visual Basic ActiveX instantiation happens over the name as registered in the HKEY_CLASSES_ROOT. Inside the key for the name as entered in CreateObject() (Excel.Application for MS Office Excel and supposedly Ket.Application for the Kingsoft Spreadsheet app) is a CLSID entry which defines the CLSID to instantiate. if you look for this class ID under HKEY_CLASSES_ROOT\CLSID or HKEY_CLASSES_ROOT\Wow6432Node\CLSID you can determine the file that contains the ActiveX object interface.

 

LabVIEW does enumerate the HKEY_CLASSES_ROOT\TypeLib key for the components to show in the selection dialog. This is where Automation servers should be registered for availability. Kingsoft may have forgotten to do that.

 

So what can one do as a last resort?

 

Look for the wps.Application or ket.Application entry in HKEY_CLASSES_ROOT. Check the CLSID entry in there and search for that GUID in the HKEY_CLASSES_ROOT\CLSID or HKEY_CLASSES_ROOT\Wow6432Node\CLSID tree. In there look for LocalServer32 and notice the DLL or EXE name for it.

 

In LabVIEW create an Automation refnum, select in the right click menu Select ActiveX Class->Browse. In the dialog press the Browse button and go in the file dialog to the file as noted above and select it. Now you should see a list of creatable objects with one of them being Application or _Application. That's it!

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 10 of 10
(6,903 Views)