Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Winform Exporting Data to Excel form Datagridview Nischal Excel Programming 0 November 28th 07 07:16 PM
Shows blank worksheet but ok in print preview Big Mac Excel Discussion (Misc queries) 1 November 14th 06 02:36 PM
How can I print a worksheet excluding blank rows? lohme Excel Worksheet Functions 13 August 23rd 06 10:36 PM
program excel worksheet to automatically not print blank rows [email protected] Excel Discussion (Misc queries) 2 July 26th 05 02:11 PM
program excel worksheet to automatically not print blank rows [email protected] Excel Programming 2 July 26th 05 02:11 PM


All times are GMT +1. The time now is 03:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"