Link to home
Start Free TrialLog in
Avatar of hllim
hllim

asked on

Printing in VB6

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!
Avatar of _agj_
_agj_

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.
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.
Avatar of hllim

ASKER

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!
ASKER CERTIFIED SOLUTION
Avatar of Sethi
Sethi
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial