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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB and Data Report 1

Status
Not open for further replies.

tonioJ

Programmer
Oct 7, 2002
90
0
0
PH
hello there can anybody help me with this problem? i am working out on a data report. i am using data environment for data source. how can i suppress a duplicate data in a report given with particular conditions only..

example:

SEQ_NO PRICE1 PRICE2 PRICE3
1 520 500 500
1<--SUPPRESS THIS 510 500
2 300 100 1000
 
if you're using a sql stmt, use the DISTINCT keyword. Otherwise, you could try manipulating the ff:

- open the data environment
- select the command in use
- locate the grouping tab
- select the field(s) that will be grouped

again, what i really do is design the query (with the distinct keyword) in the database then call it in the command before displaying it in the report. this reduces the some of complexities of using the data report and the data environment.
 
hello quovuz,
thanks for your help.

i have another problem with data report. it doesn't support multiple hierarchy. here's the situation, i have 1 header table let's call it (header_1) and 3 detail tables for header_1.

i will give u the sample situation of my problem:
header table name: header_1
fields: seq_no int
pname char
detail table name: detail_1
fields: seq_no int
amount money
detail_2
fields: seq_no int
condition money
detail_3
fields: seq_no int
description money
quantity
i need to create a report for selected of header_1 with details coming from tables detail_1, detail_2, detail_3.
detail_1, detail2, and detail_3 are not related to each one another they are just related to header_1. how should i display the data in this format:

seq_no: 001
pname: John Doe
Details:
Amount Condition Description Quantity
------------------------------------------------
100 xxxxxxx yyyyyyyyy 56
ggggggggg
200 tttttttt 70

i tried making a temporary table and manipulated the data by stored procedure but the process is so slow. is there any other way to create this report by linking only the primary key(seq_no) so that i will no longer use a temporary table???

please help... thank you!
 
hi!

here's what you can do.

- create three commands from the data environment for the three details tables
- create another command from the data environment for the main table
- from the property page of each command, link the three details table to the main table using the relation tab.

another approach that i did was to
step 1: join the data from the details tables through a union query.
step 2: then create another query to join the resulting table from step 1 to the main table.
step 3: afterwards, create a group for the resultant table
step 4: on your data report, include the group header and footer by right clicking the report.

its quite long but it gives the same result.
 
hello quovuz,
again,, thank you for your help.
i have tried method that you have suggested the 3 tables are placed as child command of the main table... in this case, i got an message that data report, cannot support multiple hierarchy. it ignored the rest two tables... and i cannot place a data unto the report.....

 
Hi
You can check the following article. May be you can program multiple hierarchies that way.
Microsoft Knowledge Base Article - Q289793
HOWTO: Dynamically Populate a Group Data Report

Because of the limitations of Data Report I prefer to program my own reports with the Printer Object. It means a bit more work but there you have no problems with multiple hierarchy.
 
hello hansu... thanks for the reply... i will try your suggestion
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top