troubleshooting Question

VB6 Datareports Group header & Details "sections do not match data source"

Avatar of DennisPost
DennisPostFlag for Netherlands asked on
Visual Basic ClassicDB Reporting Tools
6 Comments1 Solution2068 ViewsLast Modified:
Hi,

At the moment we have invoices created with Crystal Reports 4.6, which works fine for us, but replaces some Czech characters with wrong characters.
So I have to make invoices datareport in visual basic 6, which does display all the charcters correctly.
Unfortunatley I have to go to the Czech Republic in 4 days with invoicing fully functional...... :-(

As I understand it, I have to split my recordset when I open it.
(https://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_DB/Q_20921702.html)
This goes beyond my experience, and so I need a little help from you guys.

We are using SQL 2000 View via an ADO recordset to get all the information.

The group header section will contain all the information about the invoice and the details section will
display the different charges and the calculations.

Here is the code I would like to adapt for our usage:
Dim rs As ADODB.Recordset
Dim child_rs As ADODB.Recordset

    Set rs = New ADODB.Recordset
    rs.LockType = adLockBatchOptimistic
    rs.Open _
        "SHAPE APPEND " & _
        "  New adVarChar(10) As ParentDay," & _
        "  ((SHAPE APPEND" & _
        "    New adVarChar(10) As ChildDay," & _
        "    New adVarChar(10) As Name," & _
        "    New adInteger As Amount)" & _
        "  RELATE ParentDay to ChildDay) As Child", _
        "Provider=MSDataShape;Data Provider=None"

    rs.AddNew Array("ParentDay"), Array("Monday")
    rs.AddNew Array("ParentDay"), Array("Tuesday")

    Set child_rs = rs("Child").Value
    child_rs.AddNew Array("ChildDay", "Name", "Amount"), Array("Monday", "Rod", -1.11)
    child_rs.AddNew Array("ChildDay", "Name", "Amount"), Array("Tuesday", "Rod", 2.22)
    child_rs.AddNew Array("ChildDay", "Name", "Amount"), Array("Monday", "Michelle", 11.11)
    child_rs.AddNew Array("ChildDay", "Name", "Amount"), Array("Tuesday", "Cobe", -22.22)
    Set rptTest.DataSource = rs
    rptTest.Show vbModal
    rs.Close

The main query will be:
SELECT * FROM PrintsInvoice WHERE InvoiceNr = " & glInvSel

The Child fields should be:
Descr (Varchar)
Qty (Decimal)
VALPP (Decimal)
VATPerc (Int)
VAT (Decimal)
ValEur (Decimal)

I will continue to experiment while I wait.
Eagerly awaiting your help with this or a better solution.
(btw, upgrading Crystal Reports is not a option for us.)

Thanks in advance !!!



ASKER CERTIFIED SOLUTION
DennisPost

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros