Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save trendviewer graph as xps or jpg or pdf file

Status
Not open for further replies.

Antagor

MIS
Feb 20, 2013
2
RS
I work on a SCADA aplication which has trend graph. I want to make a vbscript code which will create from time to time file with picture of graph in it. ActiveX component iuTrendViewer has method iuTrendViewer1.PrintTrend() which opens screen for input file name and chose folder destination, but It has to be automatically. On some trigger file name has to be created automatically and file has to be saved in specific folder. PrintTrend() thus not has any parameter to fill in.

My idea is when iuTrendViewer1.PrintTrend() is executed and print window is open script has to chose destination folder and fill filename field with new name, and press "enter".

If this is not posible I will try something with screenshot (printscreen) and MSPaint. But this will make jpg with whole screen, including butons and window menu not just graph.

Can anyone help me with this code?

Thanks in advance
 
You may consider SendKeys and its companion AppActivate.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I tried to make a script like this:

iuTrendViewer1.PrintTrend()
Sleep 1000
Set WshShell = CreateObject("WScript.Shell")
Sleep 1000
WshShell.Sendkeys "D:\TEST\Report\Data\Filename.xps"
Sleep 1000
WshShell.Sendkeys "{ENTER}"

But it does not work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top