/ Forums / Advansys Formativ / Creating Solutions with Formativ / Print contents of a portal
-
CreatorTopic
-
June 15, 2005 at 4:49 am #4134
Hi,
The subject says it all: How can I print the contents of a portal? If possible, without any user intervention. (Print-dialogs etc.)
Thanks in advance!
-
CreatorTopic
-
AuthorReplies
-
June 15, 2005 at 5:45 pm #7225
This should be possible using the NativeInterface property of a portal. The nativeInterface property gives you the IWebBrowser2 interface for the portal, which in tern has an ExecWB() method. You can use this method to print the contents of the portal.
Here’s an example:
Sub Main(Client, GWEvent) dim iPortals dim iPortal1 dim iret Set iPortals = GroupWise.PortalManager.Portals Set iPortal1 = iPortals.Item("PORTAL1") If iPortal1 is Nothing Then Set iPortal1 = iPortals.Add iPortal1.Caption = "Advansys Home" iPortal1.TabCaption = "Advansys" iPortal1.ID = "PORTAL1" iPortal1.NavigationControlsEnabled = True iPortal1.URLInputEnabled = True iPortal1.Url = "www.advansyscorp.com" else MsgBox "Found it - try to print it" const IDM_PRINT = 6 call iPortal1.NativeInterface.ExecWB(IDM_PRINT, -1) End If End SubThis is somewhat incomplete, because the printer selection dialog still appears. I understand it should be possible to turn this off by using flags. See the Microsoft Documentation on the IWebBrowser2.ExecWB() method, and the IDM_PRINT command. More information is available at http://msdn.microsoft.com/workshop/browser/mshtml/reference/constants/idm_print.asp.
I hope this helps.
Advansys Support
January 12, 2010 at 5:00 am #7229Hi,
I have further question about printing content of portal. Is it possible edit or better completelly remove default information written on printed page in bottom-left corner (in Your case is URL address http://www.advancesys.com/) or (in my case) there is a text “about:blank” and bottom-right corner – date?
Thanks in advance for information!
kind regards,
ZdenekJanuary 12, 2010 at 3:09 pm #7226You can use Portal.HTML property to get the HTML source for each Portal. Setting the HTML property will render the page within the Portal. See Formativ Language Guide (Portal object) for more information.
If you use Portal.URL to set Portal contents then you can use example code below to extract Portal HTML, update contents and reset.
Set oPortals = GroupWise.PortalManager.Portals Set oPortal1= oPortals.Item("PORTAL1") If not (oPortal1 is nothing) then iHtml = oPortal1.html iHtml = replace(iHtml, "about:blank", "NewText", vbTextCompare) oPortal1.html = iHtml end if set oPortals = nothing set oPortal1 = nothingAlternatively, if you use Portal.HTML to set page contents at the beginning then you should update it prior to set.
Regards,
Advansys SupportJanuary 13, 2010 at 3:21 am #7228I think You don’t understand what I meant. The text I want to change (or better remove) is not in origin html file, but on printed page of this file. I create example for You:
http://www.oktet.cz/download/Example.jpg
On the left You can see whole html file opened by Internet Explorer. On the right You can see this file printed by pdf creator software from Portal (it’s the same look when I print to real printer). As You can see, on the bottom (red marks), there is extra text, which is not in origin html file. I would like to remove this text, is it possible?
January 13, 2010 at 3:09 pm #7227Thanks for the clarification.
Browsers usually set to add title, date, page number and URL to any page printed from the Internet. You will need to change browser print settings. Link below shows steps to change print settings (follow the Internet Explorer 6 & 7 instructions):
http://www.mintprintables.com/print-tips/header-footer.php
Hope this helps.
Regards,
Advansys Support -
AuthorReplies
- You must be logged in to reply to this topic.