Posted 4 August 2017, 2:50 pm ESTI am new to using the active reports designer in vb6 and need some assistance.
This is what I have so far:
In my report I have fields in the page header and in the detail section
that are "dynamic". There is an Adodb control in the detail
section who's source is set to "Select * from table1 and table2", the
password and connection string are currently hardcoded into the
properties (although in the future this will have to become dynamic as
Also, all my fields (in page header and detail) are set to items in a
data collection that get set on the DataInitialize procedure call (i.e.
Fields.add "Field1", Fields.add "Field2", etc.)
Then based on user input from the program I build a query and store it
in a module level string variable. I then call rs.open sqlString, Conn
(my program's connection to the database)
I set a Module-level variable (lets call it KEY) equal to one of the fields in the recordset (you'll see why in a second).
the next step is the FetchData procedure.
In fetchdata I set fields collection value in the PageHeader and
Detail section based on the current record. I use KEY to make
sure I don't need to start a new page because all the records
pertaining to KEY should be on the same page.
If KEY <> rs!KeyField then
key = rs!KeyField
detail.newpage = ddnpBefore
detail.newpage = ddnpnone
A new page does not get generated when Key <> rs!KeyField, it
only happens if information in detail section is different from the
I have even added the value of the keyfield to the detail section to see what is happening, or just to try and force a new page.
I have tried a few other things like forcing a new page after the page footer gets printed (nothing changed).
I have a feeling I am setting up my database connection incorrectly, or
that I am not using the correct even procedures to display what I want.
What I am hoping for:
Basically, when new page header information is in the current record, a
new page should start and display in the details section all the other
information in the record about that Key info.
This could be likened to Customer information (name, address, etc) in
the page header, and all the orders for this customer in the detail
section, then a new page for a new customer.
I am happy to offer more information if needed. I have been
looking through the help, and this forum but haven't come up with
anything yet. Thanks in advance.