Help needed in PDF export in WinCCOA

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
Search

Post Reply
10 posts • Page 1 of 1
ydramkumar
Posts: 5
Joined: Sun Sep 02, 2012 5:21 pm

Help needed in PDF export in WinCCOA

Post by ydramkumar »

Hi All,

In our project , we have a requirement to export our archiving/alarm data to PDF as table. I found pdf export is possible through WinCCOA by using lab code sample ( HTMLPDF https://portal.etm.at/index.php?option= ... &Itemid=79). This code sample is supported only PVSS 3.8 and 3.9 version, but we are using WinCCOA3.11. After some analysis I figured out the QT has native support to export pdf by using "qtextstream". Since Winccoa is built on QT, hence there should be a way to use QT dll from api manager/ctrl extension as the way done lab code sample.

Suppose if I want to use QT dll, which is exported by WinccOA, what are the steps I have to do.

Please help me here what to do

Thanks & Regards,
Ramkumar

User avatar
leoknipp
Posts: 2926
Joined: Tue Aug 24, 2010 7:28 pm

Re: Help needed in PDF export in WinCCOA

Post by leoknipp »

Hello,

how to implement a CTRL-extension (dll-, or so-file written in C++) is described in the online-help: Special functions --> Control Extensions.
To save data as a pdf-file you could also a pdf-writer which is used as a printer. Instead of printing the file the information is saved into the pdf-file.

Best Regards
Leopold Knipp
Senior Support Specialist

User avatar
fmulder
Posts: 330
Joined: Wed Feb 03, 2010 9:46 am

Re: Help needed in PDF export in WinCCOA

Post by fmulder »

Ramkumar,

My name is Frenk Mulder, I used to work for ETM, and I'm the original author of this dll that translated HTML into PDF. Yes, this was a PVSS control DLL, but it would use some Qt function calls to produce the actual output. There are various examples on the Internet that demonstrate how Qt is used to product PDF. Example: http://stackoverflow.com/questions/1069 ... df-with-qt

'Unfortunately', I left ETM and no longer have this source code. I do remember that the code was not very much.

The easiest solution would be to:
1) Ask ETM to look for this source code. (I'm pretty convinced that Gertjan van Schijndel, in Siemens Holland, will still have it ).
2) Install Qt
3) Install Visual Studio
4) Compile the source code

Your next best option would be to write your own Control DLL. I do remember that it took me quite some time to figure this one out. It is not the easiest option.
There's an X-File in the 'Lab' section about writing a control DLL. Still, it wont say how to add the Qt part and it will again take some puzzling.

The solution with the least probnlems would be :
1) download Qt. http://qt-project.org/downloads (includes a compiler ! )
2) Make a small Qt program based on the above example
3) Call this executable QtToPdf.exe from a PVSS panel or script file
It will mean that you are independant of the PVSS version. You can then use such a program from any application.

Hope this helps

Good luck !

ydramkumar
Posts: 5
Joined: Sun Sep 02, 2012 5:21 pm

Re: Help needed in PDF export in WinCCOA

Post by ydramkumar »

Thanks Leopold Knipp,

We have already tried this approach by using GhostScript and printer drivers. But this approach has a problem in cropping the images, misplacing the vector objects ( Charts in HTML ) and unable to print wide tables. Hence we move to draw the information as vector objects.

ydramkumar
Posts: 5
Joined: Sun Sep 02, 2012 5:21 pm

Re: Help needed in PDF export in WinCCOA

Post by ydramkumar »

Thanks very much Frank.

Sorry for the late reply, during this time I wanted to catch Gertjan van Schijndel and get some input on this, so that I can put here that information. But unfortunately I could not able to catch him.

I used the same link when I was doing sample pdf export prototypes.

I am very much aware how to write Control DLL but as you said, ETM help manual doesn't explain how to link QT libraries.

Also, I found that CERN labs provided how to compile QT libraries to create C++ extension for PVSS (https://j2eeps.cern.ch/wikis/display/EN ... Extensions). I compiled the code but generated binaries sizes are not same as the WINCCOA3.11 QT binaries ( only very little difference in size, I dont know whether I am missing any compiler options ).

still I am analyzing how to use QT libraries in normal VC++ application, since control dll is one of VC++ application.

I am very interested to use WINCCOA QT libraries because no need to use another version of QT run time libraries in our system as well as no additional license problem.

Please let me know if you have any input on this.

Thanks & Regards,
Ramkumar

User avatar
fmulder
Posts: 330
Joined: Wed Feb 03, 2010 9:46 am

Re: Help needed in PDF export in WinCCOA

Post by fmulder »

Ramkumar,

I will contact Gertjan and see if he can help you ! Unfortunately, I do not have this source.

Frenk

ydramkumar
Posts: 5
Joined: Sun Sep 02, 2012 5:21 pm

Re: Help needed in PDF export in WinCCOA

Post by ydramkumar »

Thanks very much Frenk.

In the mean time, I will also try to do whatever I can do in the source code side with my compiled binaries.

Regards,
Ramkumar

User avatar
fmulder
Posts: 330
Joined: Wed Feb 03, 2010 9:46 am

Re: Help needed in PDF export in WinCCOA

Post by fmulder »

Your fastest solution would be to develop something that does not require linking to the PVSS libraries:

The solution with the least probnlems would be :
1) download Qt. qt-project.org/downloads (includes a compiler ! )
2) Make a small Qt program based on the above example
3) Call this executable QtToPdf.exe from a PVSS panel or script file
It will mean that you are independant of the PVSS version. You can then use such a program from any application.

Good luck !

FRenk

ydramkumar
Posts: 5
Joined: Sun Sep 02, 2012 5:21 pm

Re: Help needed in PDF export in WinCCOA

Post by ydramkumar »

Hi Frenk,

This QtToPdf.exe option is good but it need its own QT run time right?.

Since it need its own run time we need to obtain QT license and redundant QT libraries in our installation,so I don't prefer much on this option.

What I would like to do is, some how I will include qt libs(generated by my self) in control dll and place the dll in our project to refer the WinCCOA QT libs instead of mine.

I don't know whether it is really a good idea but let me give a try for this.

Thanks & Regards.
Ramkumar.

User avatar
fmulder
Posts: 330
Joined: Wed Feb 03, 2010 9:46 am

Re: Help needed in PDF export in WinCCOA

Post by fmulder »

First of all : Qt (QtCreator) is free of change. It is open source. THis might mean that you have to make your program public as well but who cares. This tool is so simple.

If you still want to pursue the Qt Ctrl DLL idea then just make sure to use the exact same Qt version as PVSS does. Then there will be no need to install additional DLL's

Frenk

Post Reply
10 posts • Page 1 of 1