![]() |
Print of DataGridView on worksheet is always blank
Hello all -
I'm working using VSTO to create an excel 2007 application. I'm using C# as the programming language. Background: I've dragged a DataGridView control onto a worksheet and the DataGridView is bound to a data table. The data in the data table and hence the DataGridView's content changes when an SQL select statment is executed. I've a do-loop that executes the SQL statement and then prints the worksheet that contains the DataGridView. The C# print statement looks like: Globals.Sheet1.PrintOutEx(1, 1, 1, missing, missing, missing, missing, missing, missing); Problem: The contents in the DataGridView doesn't show up on the printed page. It's black or sometimes it has the column headings with no data. It's like whatever the contents of the first SQL select statement is there on the first execution is what it prints for each iteration. The DataGridview doesn't update. Executing the SQL select and printing manually (i.e., Office Button - Print - Print), the contents show up just fine. Is there something special about printing an embeded control? Any ideas are always appreciated. Thanks, Mark |
All times are GMT +1. The time now is 01:09 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com