Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Question about Data reports in VB 6.0

Posted on 2009-07-15
21
Medium Priority
?
670 Views
Last Modified: 2013-12-26
1. How to set up The report in Landscape
2.  How to use group, the same way like in MS access
0
Comment
Question by:rfedorov
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 10
  • 9
21 Comments
 
LVL 10

Expert Comment

by:3_S
ID: 24864529
To set orientation
  DataReport1.Orientation = rptOrientLandscape
  DataReport1.Show

to use a group by
use detail and group header in your datareport
To do so right click on you datareport and click "insert group header/footer"
Your sql command should contain a group by clausule

Feel free to ask additional info.

0
 

Author Comment

by:rfedorov
ID: 24864596
Thank you
Private Sub Command1_Click()
Dim cn1 As Connection
Dim rs1 As Recordset

    Set cn1 = New Connection
        cn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
        "Data Source= " & App.PATH & "\PCR.mdb"
   
        Screen.MousePointer = vbHourglass

'Set rs1 = cn1.Execute("SELECT BatchID, ReviewerDate,RevInspections From Batch " _
'& " WHERE RevInspections <>'' order by ReviewerDate desc;")
Set rs1 = cn1.Execute("SELECT * FROM qry_complete")

'MsgBox "pass"

        Set drAnalyst.DataSource = rs1
        drAnalyst.Orientation = rptOrientLandscape
        drAnalyst.Show
        drAnalyst.Caption = "PCR Report by Analyst"
        Screen.MousePointer = vbDefault
End Sub

it breaks under rptOrientLandscape, giving the error Variable not defined
0
 
LVL 10

Expert Comment

by:3_S
ID: 24864621
rptOrientDefault = 0
rptOrientPortrait = 1
rptOrientLandscape = 2

So you could use 2 instead. on which servicepack is your VB6 installation see:
http://support.microsoft.com/kb/261193
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 

Author Comment

by:rfedorov
ID: 24864642
it does not give me the property Orientation
0
 
LVL 10

Expert Comment

by:3_S
ID: 24864683
Strange?
Did you add component microsoft common dialog control 6.0 to your project?

I will take till tomorrow before I can answer following updates on this question.
0
 

Author Comment

by:rfedorov
ID: 24864713
I have Microsoft Common  Control 6.0
0
 
LVL 13

Assisted Solution

by:game-master
game-master earned 150 total points
ID: 24865680


good morning!

make sure u have installed vb6 service pack for you to have the
property drAnalyst.Orientation = rptOrientLandscape.

otherwise, this property will not be use...


game-master
0
 

Author Comment

by:rfedorov
ID: 24870122
thank you
how to check which serice pack i have? where to get the service pack?
0
 
LVL 10

Expert Comment

by:3_S
ID: 24872594
To obtain service pack (see my previous post about service pack and datareport orientation)
http://www.microsoft.com/downloads/details.aspx?FamilyID=A8494EDB-2E89-4676-A16A-5C5477CB9713&displaylang=en

Check service pack in Microsoft Visual studio 6
go to menu Help chooose "about Microsoft Visual Basic..."

On which service pack are you currently
0
 

Author Comment

by:rfedorov
ID: 24873299
i downloaded the service pack 6 and still no success:
under the property of Rpt no Orientation property
0
 
LVL 10

Expert Comment

by:3_S
ID: 24873549
is this what you see in you project explorer.
You datareport stands below designer, it's not just a form you called datareport? Maybe this sounds silly but it is to make sure you are using a real datareport.  Property Orientation should be available on your datareport

What are the property's you have available?
datareport.JPG
0
 

Author Comment

by:rfedorov
ID: 24873603
Ok, guys...
I do not know what i did, but after deleting (clearing property of Datamember and Datasource it is working now...
so now i have a question :
 how to insert a group
I know i did Inser group header footer
how  and what should i insert in group header section 1?
0
 
LVL 10

Expert Comment

by:3_S
ID: 24873858
in you sql command you will have something like
select A, B, C from tableX group by A

A should be in you group header and B and C in you detail. (maybe something in group footer, for example a total of something)
This is dificult to give advice without some more input from your side. (can you give you sql statement)

Have you made a datareport before without a group by ( a simple select?) If you have not, maybe you should try this first.
0
 

Author Comment

by:rfedorov
ID: 24873911
let me be specific
select seqnum,status,duedate,title,analyst
from main
group by seqnum,status,duedate,title,analyst
order by analyst,status

it should be:
Pete
           Complete
                          title1 date
                          title2 date
             PEnding
                          title3 date
                          title4 date

John
           Complete
                          title6 date
                          title8 date
             PEnding
                          title0 date
                          title4 date
0
 
LVL 10

Expert Comment

by:3_S
ID: 24874040
for this you will need two group by's. Right click again to insert a second group section in your datareport.
Use two time the group header
first to place name in  (field analyst)
second to place status in (field status)
0
 

Author Comment

by:rfedorov
ID: 24874090
Please look at my screen shoot
i amgetting Report section do not match data source
Doc1.doc
0
 
LVL 10

Expert Comment

by:3_S
ID: 24874182
To accomplish this I think you will have to change you sql command with the SHAPE command (to get your two group by's)
http://support.microsoft.com/kb/189657

I can get back tomorrow. But you can already take a look at the shape command.
0
 

Author Comment

by:rfedorov
ID: 24874290
i am lost now...
0
 
LVL 10

Accepted Solution

by:
3_S earned 600 total points
ID: 24881087
First try on group by then add your second. this should make it more easy

Are all these fields in just one table? is this not split into a table with the analyst and with the various projects they work on?

I can only answer within one week.

    Rcs.Source = "SHAPE{SELECT STATUS, TITLE, DUEDATE" _
             & " FROM TBL_PERSON INNER JOIN TBL_TASK ON TBL_PERSON.PERSON_ID=TBL_TASK.PERSON_ID" _
             & " ORDER BY STATUS,TITLE_NAME" _
             & " } AS GRP1 COMPUTE GRP1 BY 'STATUS'"

Open in new window

0
 

Author Comment

by:rfedorov
ID: 24881305
yes, this one table only
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question