Solved

Printing in VB6

Posted on 2003-11-02
4
443 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now