Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Components
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
VB Components Issues specific to components in VB.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Components section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 24th, 2013, 02:02 PM
Registered User
Points: 15, Level: 1
Points: 15, Level: 1 Points: 15, Level: 1 Points: 15, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Oct 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Condition in SHAPE for Data Grid Report


I have 3 Tables;

1. Exporter Returns

rt_id numeric(18, 0) Unchecked
exporter_id nchar(10) Checked
icd_name nvarchar(50) Checked
port_name nvarchar(50) Checked
country_name nvarchar(50) Checked
variety_name nvarchar(50) Checked
type_name nvarchar(50) Checked
quantity numeric(18, 2) Checked
fob numeric(18, 2) Checked
unitprice numeric(18, 2) Checked
returns_month datetime Checked
submited_date datetime Checked
uname nvarchar(50) Checked

2. Port Master

port_id numeric(18, 0) Unchecked
port_name nvarchar(50) Unchecked
region nvarchar(50) Unchecked

My Report should come like as follow;

Date: Page 1 of 1

Region : North
Port Name Quantity FOB UP

XYZ 100 100 1
KLM 200 200 1
ABC 650 650 1
FGH 722 72000 100
Region Total 1672 72950
Region : South
Port Name Quantity FOB UP

KLM 100 100 1
UVW 200 200 1
RST 650 650 1
IJK 722 72000 100
Region Total 1672 72950
Grand Total 3344 145900

Earlier i had used the following query.

select ROW_NUMBER()OVER (ORDER BY er.Port_Name) AS Row,er.Port_name,pm.Region,
sum(Quantity) Quantity,sum(Fob) Fob,convert(numeric(18,2),sum(Fob)/sum(Quantity)) Unitprice 
from Exporter_Returns er join Exporter_Master em on er.exporter_id=em.exporter_id join 
port_master pm on pm.port_name=er.port_name where returns_month 
between '2010-01-01' and '2013-08-01' and quantity!=0 group by er.Port_Name,pm.Region
I have plan to use SHAPE...... I have confusion in the following code;

SQL = "SHAPE {SELECT Region FROM Port_Master} APPEND ({SELECT * FROM Exporter_Returns} AS Level2 RELATE Port_Name to Port_Name)"

rs10.Open SQL, cn, adOpenStatic, adLockOptimistic
Set Rpt_RegPorwise.DataSource = rs10
With Rpt_RegPorwise.Sections("Section6").Controls
    .Item("Text6").DataMember = ""
    .Item("Text6").DataField = "Region"
End With
With Rpt_RegPorwise.Sections("Section1").Controls
    .Item("Text2").DataMember = "Level2"
    .Item("Text2").DataField = "Port_Name"
    .Item("Text3").DataMember = "Level2"
    .Item("Text3").DataField = "Quantity"
    .Item("Text4").DataMember = "Level2"
    .Item("Text4").DataField = "Fob"
    .Item("Text5").DataMember = "Level2"
    .Item("Text5").DataField = "Unitprice"
End With
And I need to insert condition ie "returns_date 01/01/2010 to 01/08/2013".

1. When i execute the above SHAPE, I had received error message Data Field "Quantity" is not found
2. If solve by you, How can i join 3 Tables in the above SHAPE....
3. How can i add the above condition in SHAPE?

Please Help Me.

Thanks in advance.

Thanks & Regards,

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ADO Data Shape - Filter aggregate dwperry SQL Language 0 March 31st, 2008 10:40 AM
Is it possible to display report on condition? megana Crystal Reports 0 June 30th, 2006 04:30 PM
Rotating shape in VBA (not center of shape) Piblon Excel VBA 3 April 13th, 2006 04:04 AM
data report with grid.... thiNkspAce Beginning VB 6 1 August 24th, 2004 01:34 AM
Data Shape + Temp Tables BAHill SQL Server ASP 2 November 10th, 2003 04:56 PM

All times are GMT -4. The time now is 10:49 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.