Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Printing in VB6

Posted on 2003-11-02
4
446 Views
Last Modified: 2010-05-01
Hello all,

I want to generate report by using VB6, what can I do? I know there is datareport available, but due to my complicated SQL Query, I don't really like the datareport, it is not that flexible to me.

Moreover, may I know how I can print the report from VB? Any built in function that I can use?

Thx!
0
Comment
Question by:hllim
4 Comments
 
LVL 7

Expert Comment

by:_agj_
ID: 9669469
hmm....one way out is to get Crystal Reports, install it and use the same.

Second, you could include  a reference to MS Access Library.

There is a report object/class that it provide.

Declare something of report type and use its properties like DataSource etc to load it.

One can do a report1.print to print the report.
0
 
LVL 2

Expert Comment

by:cero
ID: 9673686
Hi,
another way is to construct a form, think of it like if it were the report, put grids, whatever control you nedd and then use Printform method of form. Form should have background color set to blank.

This method works for me for small and complicated reports, data relacionated.

another way is to use the printer object, but is a lot of work.

regards,

cero.
0
 

Author Comment

by:hllim
ID: 9676311
Thx for the feedback.

However my report is not a simple report. PrintForm method couldn't help to print as user needs to scroll down to view the whole report.

I tried the datareport and data environment. I have created one parents command object and 2 child command objects in my data environment. I could drag drop data items from parents command object and one of its child command object to the datareport details section. However I couldn't do so for the second child command object data item. Anyone could please advise on this?

Thx again!
0
 
LVL 18

Accepted Solution

by:
Sethi earned 125 total points
ID: 9685138
There are not many options with you. I had the same question one year back but was left with no options but to use some professional reporting tool. I have always hated Crystal Reports so was looking for better options. I tried creating reports in HTML and then calling then in Internet control in VB. This way you can create great reports but you would not get flexibility in printing the reports. Then I tried Access reports. The problem with this reporting is that the client should have Access installed on the machine for these reports to work. Now I am using ComponentOne VSView reporting tools. They are excellent. The printing capabilities are mindboggling and the ease involved in creating the reports is very high. I would recommend you these reports. If you looking for free options or options where you dont have to spend much, dont waste time. I did a lot of R&D on that.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question