INFO: Avoid Truncation When You Use the DataReport ExportReport Method (271692)



The information in this article applies to:

  • Microsoft Visual Basic Professional Edition for Windows 6.0
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0

This article was previously published under Q271692

SUMMARY

The ExportReport method of the Data Report designer provides a mechanism to export the text of a DataReport object to a file. Because this method works asynchronously, you need to be sure that there are no asynchronous operations still executing before you unload the DataReport.

MORE INFORMATION

When you use the ExportReport method, it is important to check the AsyncCount property of the DataReport before you unload the DataReport; otherwise, the output file may not contain the all of the text. This property returns the number of asynchronous operations that are still executing. When AsyncCount returns zero, it is safe to unload the DataReport. The following code fragment demonstrates this:
DataReport1.ExportReport rptKeyHTML, "c:\output.htm", True, False
Do
  DoEvents
Loop While DataReport1.AsyncCount > 0 
Unload DataReport1
				

REFERENCES

For more information, see the following Web sites on the Microsoft Developer Network (MSDN):

Modification Type:MajorLast Reviewed:1/11/2001
Keywords:kbDSupport kbinfo KB271692