Re: printing contents of DataGridView
- From: "John A Grandy" <johnagrandy-at-gmail-dot-com>
- Date: Tue, 31 Mar 2009 14:40:22 -0700
Hi Morten, and thanks for the response.
Actually, my printing needs are very basic and need not involve the display
grid at all.
This is a .NET 2.0 Windows Forms app connected to a remote Sql Server 2005
instance where the connection string is obtained from a custom registry key
value which varies by customer/environment.
On the user entering a couple of simple params , the grid displays the
result of a single stored procedure which accepts those params. Scroll bars
are just a necessity of screen real-estate available.
I'd like the user to then be able to click a button to display a printable
report. The report is the formatted full output of the same stored
procedure.
I don't care too much about the technology nor the features -- the simplest
/ easiest solution is fine for my app.
"Morten Wennevik [C# MVP]" <MortenWennevik@xxxxxxxxxxx> wrote in message
news:DB7CF5C0-5298-4EEE-92CB-073EF5EA3183@xxxxxxxxxxxxxxxx
"John A Grandy" wrote:
Currently I am displaying a rowset in a DataGridView, which scrolls both
horizontally and vertically.
I need to print the data in the rowset in the format it's displayed in
the
DataGridView
It does not appear that DataGridView has any support for the printing of
its
contents.
How are people approaching the problem of printing the contents of a
DataGridView ?
Hi John,
Do you mean you want to print a subset of the data, and only the data
currently visible to the user? If so, I don't think I have ever seen a
solution for this. I fear you will have to keep track of the visible rows
and columns yourself and print out the visible cells manually. Or maybe
have
the user select which cells should be printed and manually print all
SelectedCells.
--
Happy Coding!
Morten Wennevik [C# MVP]
.
- Follow-Ups:
- Re: printing contents of DataGridView
- From: Morten Wennevik [C# MVP]
- Re: printing contents of DataGridView
- Next by Date: Re: DataGridView - Printing
- Next by thread: Re: printing contents of DataGridView
- Index(es):