Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Using excel template and macros and dos commands together

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Using excel template and macros and dos commands together
 Login/Join
 
Platinum Member
posted
Hi,
I really need help with this from the webfocus gurus out there.
I am trying to save an excel template file onto to the server and use a macro with this to convert one of the worksheet in the template file to a *.ps file using a macro and then access this *.ps on the webfocus server thru a command line and use a program(ps2pdf) to convert this file to a *.pdf file. Then I need to open this pdf file to the user. This has to be one click. I am able to do some of it seperately. Here is the partial code that I am trying to do.

APP HOLD baseapp
TABLE FILE CAR
PRINT MODEL
BY CAR
ON TABLE HOLD AS 'PMW1' FORMAT EXL2K TEMPLATE 'pmw' SHEETNUMBER 2
END

There are two worksheets in the template , first will have all the formatting.So once the sheet2 gets loaded with webfocus data,sheet1 will get populated. I am not sure a proper way of saving this excel PMW11.xls on to the server ,so that it can be accessed later.

Also then a macro needs to run in the excel file,which will print this PMW1.XLS file to a PMW1.ps file,

Sub Macro1()
Application.ActivePrinter = "CutePDF Writer on CPW2:"
ActiveWindow.SelectedSheets.PrintOut copies:=1, ActivePrinter:= _
"CutePDF Writer on CPW2:", Collate:=True, PrintToFile:=True, PrToFileName:="c:\PMW1.ps"
End Sub

After this a dos command should run to access the PMW1.ps file stored on the WF server,

c:\ ps2pdf PMW1.ps PMW1.pdf.

Then I need to display this pdf file using htmlform. I can delete the PMW1.ps and PMW1.pdf files later.

I need help with the following in the webfocus fex,
1. saving an excel template file to the wfserver.
2. Running a macro on it to create a new file.
3. Accessing the new file from command line

Cutepdf and ps2pdf are free and let me know if you wish to download them to test this. This is just for info and they need not be downloaded to answer my concerns unless u want to test the whole process.

If this works out we would have a method to convert any excel template stored on WF server to PDF.
This is a complex process and any help is greatly appreciated.


App Studio Version 8202
windows Platform
SQL Server 2008/2012
 
Posts: 183 | Location: TX | Registered: January 22, 2007Report This Post
Virtuoso
posted Hide Post
Does your template do any calculations. I've not used excel templates per se. Would using style sheet commands and just creating a PDF file to start with work for you?


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Platinum Member
posted Hide Post
No ,that did not work,
we had complex styling (inverted column titles,which we tried even to do as gif images )and images in rows not just in the heading ,which did not work with a direct pdf. Have tried all options to get this done using style sheet and pdf.
Template does not do any calculations.


App Studio Version 8202
windows Platform
SQL Server 2008/2012
 
Posts: 183 | Location: TX | Registered: January 22, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Using excel template and macros and dos commands together

Copyright © 1996-2020 Information Builders