PDA

View Full Version : What determines HeaderFooterSelect = False


grsmith
September 17, 2004, 20:51:49
I have placed the ActiveServer OCX into a Web Service and everything works fine on the first call, however on subsequent calls (same data) the HeaderFooterSelect always returns False.


tx.HeaderFooter = HeaderFooterConstants.txFirstHeader
If tx.HeaderFooterSelect(HeaderFooterConstants.txFirs tHeader) Then
tx.SelText = String.Empty
tx.HeaderFooterSelect(0)
End If

I use the following code prior (1 & 2) and following (3) my call to my web service:

1) I Always create a new references:
Private licenceManager As New Tx4oleLib.TXLicenseManagerClass
Private tx As New Tx4oleLib.TXTextControl

2) Reset the tx control:
If tx.EnableAutomationServer() Then
tx.ResetContents()
tx.ViewMode = 1
....
End If

3) Clear the references when I'm done:
tx = Nothing
licenceManager = Nothing

Other Facts:
Page sizes and margins are always set to valid non-zero values.
All other code (e.g. ObjectInsertFixed, TableInsert, etc...) works on each call it's just the HeaderFooterSelect.
There is absolutely no user involvement, the document is built programmatically.

Is there any code I can use that will gaurentee that the HeaderFooterSelect will always return true?