Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > Simple Question - Printing Flexgrid?


Reply
 
Thread Tools Display Modes
  #1  
Old 04-14-2004, 10:33 AM
VBKid04 VBKid04 is offline
Centurion
 
Join Date: Mar 2004
Posts: 138
Question Simple Question - Printing Flexgrid?


If I print a flexgrid, will it look similar to what a basic report would in Access?

If not, what should I use to create a report?

I dont have the Crytal Reporting tool. Is there anything else I could use?
Reply With Quote
  #2  
Old 04-14-2004, 10:42 AM
CrystalWizard's Avatar
CrystalWizard CrystalWizard is offline
Junior Contributor
 
Join Date: Jan 2004
Posts: 316
Default Report

Here is an example of creating a datareport.

http://msdn.microsoft.com/library/de...datareport.asp
Reply With Quote
  #3  
Old 04-14-2004, 03:24 PM
MKoslof's Avatar
MKoslof MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

If you decide to print the flexGrid, go to the knowledge base. FlyGuy has a code sample for this..and it works quite well.
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
  #4  
Old 04-14-2004, 06:32 PM
VBKid04 VBKid04 is offline
Centurion
 
Join Date: Mar 2004
Posts: 138
Unhappy

Due to a printing problem, Ive had to change my control to an MSHFlexgrid (rather than the MSFlexgrid).

This is fine, except for one little niggle...

When I press print, the MSHFlexgrid disappears. No matter how many refreshes I do it will not reappear on the form.

Only if I close the form and open it again can I see the grid again.

My code for Print is simple, but I dont want any more hassle with it:

Code:
cmdPrint_Click()

Dim old_width as Integer
MSFlexGrid_Name.width=printer.width 'makes it full length of page

Printer.PaintPicture MSFlexGrid_Name.Picture, 0, 0
Printer.EndDoc

MSFlexGrid_Name.width=old_width ' this makes it full width of the page

End Sub


If someone could just guide me in the right direction as to why the grid is disappearing or what I have to do to make it reappear.

I have even created a form refresh function, and tried to call it after the print command, but that has not worked either.


Please can someone help?
Reply With Quote
  #5  
Old 04-15-2004, 06:16 AM
MKoslof's Avatar
MKoslof MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

I told you about FlyGuy's tutorial regarding printing the FlexGrid control. Did you look at it . This method is not going to work, you can't simply send the grid to the printer object like this.

You are going to have to create a class or print routine...one or two lines of code won't output the grid correctly. FlyGuy's example will get you started.
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Flexgrid question - possibly simple Stuey General 5 04-06-2004 04:51 AM
Simple question for a simple mind MiniMe General 6 02-15-2004 12:40 PM
Simple question about testing Guyver Communications 1 02-04-2004 05:45 AM
Very Simple FlexGrid Question Kashif Database and Reporting 9 12-26-2002 12:33 AM
Simple ADO/sql question seidenstud Database and Reporting 5 12-06-2002 03:01 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->