Question about Data reports in VB 6.0

1. How to set up The report in Landscape
2.  How to use group, the same way like in MS access
Roman FAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

3_SCommented:
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
Roman FAuthor Commented:
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
3_SCommented:
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
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Roman FAuthor Commented:
it does not give me the property Orientation
0
3_SCommented:
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
Roman FAuthor Commented:
I have Microsoft Common  Control 6.0
0
game-masterCommented:


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
Roman FAuthor Commented:
thank you
how to check which serice pack i have? where to get the service pack?
0
3_SCommented:
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
Roman FAuthor Commented:
i downloaded the service pack 6 and still no success:
under the property of Rpt no Orientation property
0
3_SCommented:
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
Roman FAuthor Commented:
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
3_SCommented:
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
Roman FAuthor Commented:
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
3_SCommented:
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
Roman FAuthor Commented:
Please look at my screen shoot
i amgetting Report section do not match data source
Doc1.doc
0
3_SCommented:
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
Roman FAuthor Commented:
i am lost now...
0
3_SCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Roman FAuthor Commented:
yes, this one table only
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.