Data Access Worldwide Knowledge Base
Article ID 2030 Article Title INFO: Using Winprint I and Winprint II reports in the same application Article URL http://www.dataaccess.com/kbasepublic/kbprint.asp?ArticleID=2030 KBase Category WINPRINT Date Created 07/26/2004 Last Edit Date 07/30/2004
Article Text
QUESTION:
How can I have both WinPrint and WinPrint 2 reports in the same application?
ANSWER:
1. You can use both WinPrint I and II in the same application. When you do this, two objects are created and can be identified as follows:
Winprint I - oWinPrint e.g. "Send SomeMessage of oWinPrint"
Winprint II - ghoWinPrint2 e.g. Send SomeMessage of ghoWinprint2
2. Both WinPrint versions use commands to talk to the WinPrint print object. Since these commands are the same, they need to know how to direct themselves to the right print object. Those commands send messages to the object by sending the messages to the global integer variable WinPrintId.
3. By default WinPrintId contains a pointer to the WinPrint I object.
4. Any time you run a WinPrint II report (cWinReport2) the value of WinPrintId is changed to point to the WinPrint II object. It does not ever get changed back to Winprint I.
Therefore, if you are using the WinPrint commands or if you ever send messages to WinPrintId, you MUST make sure that WinPrintId contains the pointer to the correct object. You do this with one of the two lines of code below:
Move oWinPrint to WinPrintId // WinPrintId points to old Winprint I
Move ghoWinPrint2 to WinPrintId // WinprintId points to new WinprintII object
If you need to mix reports, just make sure WinPrintId is set correctly before you run the report.
KEYWORDS:
WinPrint 1, WinPrint1, WinPrint 2, WinPrint2
Contributed By:
John Tuohy
Company: Data Access Worldwide
Web Site: http://www.dataaccess.com
Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2010 Data Access Corporation. All rights reserved.
The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.