Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Report Designer (Is it this simple?)

Status
Not open for further replies.

cyberbiker

Programmer
Mar 16, 2001
431
US
I have never worked with the data enviroment before nor the Data Report Designer. I really just need somebody to confirm I am on the right track before I get in too deep since it just looks too simple.

I need to creates some very simple reports that will need the datasource set "on the fly" according to some pretty complex logic. (reports are simple, not the app)

If I understand what I am reading correctly, I will be able to set the individual data reports datasource directly to either an open recordset or a stored procedure.
Thus it appears that I could do something like this:

Dim strtSQL
Dim RS as recordset
set RS = new recordset
strSql = "Select this from that order by something where
"this > " somelongvariable
RS.open StrSQL, DB, etc, etc where DB is the current active database connection
set report1.datasource = RS
report1.printreport

All this without needing to use the data enviroment?

I have about 20 reports to design and I am currently trying to test this theory but am hoping someone has done this already

Terry (cyberbiker)
 
I was wondering if you ever obtained the answer to this question?
All this without needing to use the data environment?
If so, please post an example of your findings, and perhaps a small project that illustrates this.

 
I never did. And I abandoned that idea as a bad way to go about it (in my opinion, for my app)
I guess I was not really clear what I wanted again.

However, as I struggled going about it the wrong way, I realized that I did not actually want to develop all those reports.

Instead my app would work much better if the summary data
was displayed on the screen.

I was suffering from "tunnel vision". I had always developed
some form of printed reports. "This is the way it's done and that's it" so to speak. Took me a bit to realize that I was doing the same thing that always aggivated me so much when someone else does it.

So I made some changes

In this case, I display the data as required using a listview control according to a select clause created on the fly.

If I actually need to print any of these I will create a report similar to how I used to do it using cobol and a language called pl/n (similar to Pascal) except that in this case I would be using the printer object's print method to create a "print line" (Terminology????)

Loop through the listview values and print.

example:

for each whatever in listview.listitems
printer.print listview.listitem;listview.subitem(1) etc
next whatever

This is the simple version and you will probably want to
create a public boolean function(checking for sucess) and a loop for the sub items.

Sam's Visual Basic 6 in 24 hours has a good description of how to print from VB6. Help is good also, but look under "printer Object" not "print method" or you may get the wrong impression.

Somebody may know a better way of doing this, but I have not yet found another way of printing reports that are "flexible enough" without a whole lot more aggivation.
(from my point of view anyway)


Terry (cyberbiker)
 
Thanks for your reply! I was somewhat curious awhile back on whether it was possible to manipulate the DE programmatically in order to use it with the data report. I'm pretty much convinced now that, that is not possible. I did find an interesting article DEVX.com on the print object:
Thanks for your time and effort!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top