473,325 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

please tell me any 1 printing code in datagrid in visual basic 6

hussaini
please tell me any 1 printing code in datagrid in visual basic 6

in detail -----
Hello seniors members hope u will tell me ..... i have created a form in visual basic 6 so in the form there is a datagrid and a command button so i want to print the records in datagrid when i press that command button it open dailog like ms word CTRL + P its open of printing dailog hope u understand what i meant
Apr 27 '07 #1
5 3846
Killer42
8,435 Expert 8TB
please tell me any 1 printing code in datagrid in visual basic 6

in detail -----
Hello seniors members hope u will tell me ..... i have created a form in visual basic 6 so in the form there is a datagrid and a command button so i want to print the records in datagrid when i press that command button it open dailog like ms word CTRL + P its open of printing dailog hope u understand what i meant
I don't remember (if I ever knew) how to print stuff from a datagrid. But the print dialogue is easily produced by the Common Dialog control (go to Project | Components and add Microsoft Common Dialog Control).
May 1 '07 #2
I don't remember (if I ever knew) how to print stuff from a datagrid. But the print dialogue is easily produced by the Common Dialog control (go to Project | Components and add Microsoft Common Dialog Control).
ok thanx for replying me any way do u know the coding of printing command
May 1 '07 #3
Killer42
8,435 Expert 8TB
ok thanx for replying me any way do u know the coding of printing command
In VB6, you generally use the Printer object. You print to it much the same as to a picturebox or whatever by using the .Print, .Circle, .Line and other methods and setting font properties and so on, but with the addition of things like the .NewPage method to perform a pagebreak, and .EndDoc method to finish building/spooling the document and start physically printing it.
May 1 '07 #4
In VB6, you generally use the Printer object. You print to it much the same as to a picturebox or whatever by using the .Print, .Circle, .Line and other methods and setting font properties and so on, but with the addition of things like the .NewPage method to perform a pagebreak, and .EndDoc method to finish building/spooling the document and start physically printing it.
i think you dont understand what i meant i want to print records in datagrid when we just like Ctrl+P the dailog box will open of print just simple the print code
May 24 '07 #5
Killer42
8,435 Expert 8TB
i think you dont understand what i meant i want to print records in datagrid when we just like Ctrl+P the dailog box will open of print just simple the print code
I guess I still don't understand, because as far as I can tell all you need do is use the Common Dialog control to provide a print dialogue, and the Printer object to send your information to the printer. I don't think the datagrid control has any properties or methods which relate directly to printing, it's concerned with displaying stuff on-screen.

Why can't you just loop through the records in the datagrid, and print each of them to the Printer object?

(Or perhaps you should look into using something like Crystal Reports.)
May 24 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Chris | last post by:
Does anyone have any good articles or source code on printing information from a form (or data grid) in Visual Basic?
2
by: PC User | last post by:
I found some VB code to printout a richtext field and I'm trying to adapt it to MS Access 2000. I think there might be some small changes to make the adaption between VB versions. Also my OS is...
16
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use...
0
by: Nigel | last post by:
I successfully create a .NET Component (Visual Basic .NET) that would print, unfortunately when used within a web browser it appears that .NET security doesn't allow you to run code that interacts...
7
by: Amirallia | last post by:
Hello! I have a wecontrol table in a page, this table has a number of variable rows depending of the choice of the user. But when the table has a large number of rows, the printing of the page...
2
by: Bill nguyen | last post by:
I've been using Datagrid for most of my app's data entry screens. Now I have the need for users to select multiple rows for printing. Is it possible with Datagrid items? Thanks Bill
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
7
hussaini
by: hussaini | last post by:
Hello buddies im new in visual basic so please tell me i have connected a database sql server with VB6 i want to know what is code of to search data like if im searching a name just like James in...
0
by: menyki | last post by:
pls i designed a database application using visual basic. i have done the coding for the print incase i want to print out the data. Pls my problem is how to code at design time for the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.