borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Crystal Reports...Please POST i need the answer sooner than next week...please please...)Next Topic (VS .Net 2005 and SQL Server 2000 RS) New Topic New Poll Post Reply
AndreaVB Forum : Reporting tools : Execute more than 1 SQL command
Poster Message
Aeric
Level: Sage


Registered: 16-06-2003
Posts: 53

icon Execute more than 1 SQL command

Hello...
I am creating a report using Crystal Reports 8.5 and Visual Basic 6 with Report Designer Component. The program will grabs some data from a few tables like ClientGroup, ClientAcc and some transaction related tables like Sales Invoice, Receipt, Payment and etc to generate a Client Ledger report. I grab all the related data from the ClientAcc with those transaction tables using UNION in SQL and create a VIEW in SQL Server database. Then i SELECT the records from the VIEW where ClientAcc(s) are selected from a specified ClientGroup using loop and insert them to a temporary table and add some info e.g Client IP and Timestamp. Then the report is generated by using Report.Database.AddADOCommand conn, adocmd


This method will created a lot of redundant data in the VIEW and temporary table with the same Client details and thus affect the report performance. Can I execute the ADO more than 1 time so I can get the Client details once only for each Client and then display the transaction details respectively?

What I want is a report with a format like this.

Page 1
REPORT TITLE
TRANSACTION DATE FROM X TO Y
CLIENT A DETAILS FROM CLIENT GROUP 1
TRANSACTION DETAILS

Page 2
REPORT TITLE
TRANSACTION DATE FROM X TO Y
CLIENT B DETAILS FROM CLIENT GROUP 1
TRANSACTION DETAILS

Page 3
REPORT TITLE
TRANSACTION DATE FROM X TO Y
CLIENT B DETAILS FROM CLIENT GROUP 2
TRANSACTION DETAILS

Page 4
REPORT TITLE
TRANSACTION DATE FROM X TO Y
CLIENT D DETAILS FROM CLIENT GROUP 2
TRANSACTION DETAILS


CLIENT DETAILS: Client Name, Address, Tel, Fax
TRANSACTION DETAILS: Trans Date, Invoice No, Description, Debit, Credit



Please Help...

07-10-2005 at 09:56 AM
View Profile Send Email to User Show All Posts Visit Homepage ICQ | Quote Reply
AndreaVB Forum : Reporting tools : Execute more than 1 SQL command
Previous Topic (Crystal Reports...Please POST i need the answer sooner than next week...please please...)Next Topic (VS .Net 2005 and SQL Server 2000 RS) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder