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!
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!
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.
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.
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!
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.