473,386 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

I need a non-example-specific description of how to do dynamic crosstab reports

Hello Newsgroup. You have all been very helpful in the past and I thank
you. I try to ask relevant questions so that they don't just benefit me,
but also benefit the group. I'm currently overwhelmed by useless examples
across the web on how to make "dynamic crosstab reports" without myself
having a basic understanding about how to retrieve and assign recordsources,
etc., from fields in a query to fields in the report. I see all these
examples and I don't know what I can modify and what is essential. I need a
stripped-down, down to basics, tutorial (without a bunch of examples.) or
just simple explanation.

Looking all over the Internet I find numerous examples of "dynamic crosstab
reports" based on a crosstab query. Unfortunately, everything I found,
including Microsoft's stuff, is usually based on a specific example and
doesn't explain the basics of what's really going on. Usually it is based
on a form that prompts the user to enter a beginning and ending date. I
don't care about dates. That's not what my query is about. I just need the
bare-bones code to get the field name and data from a column and plug it
into the form. I do need to filter the results, but that's not my problem
right now. I'm not asking anybody to do my work for me. I just need a
clue. I'm asking, in general terms, how to define and open a datasource
(recordsource?) in a report, search through the column names and assign them
to the labels or text boxes in the header, and search through the fields
(columns)each record, and assign them to textboxes for each student (row).
I think the query will supply the rest of the data with little other
formatting. I wonder why there isn't an easily understood description "out
there" on how to do this without having to revise an example that isn't in
any way applicable to my situation. I know about inserting unbounded text
boxes and all that, but then the examples are so example-specific, that I
don't get the general idea.

Thanks! Rich Hollenbeck

my situation:
I will have 40+plus columns to print, so I will want to display
10-at-a-time, print them, get the next 10, etc. while keeping the same page
formatting for each set of ten columns.

The columns will be activities in a course. The rows will be students
within a course. The data intersecting the rows and columns will be the
score (or grade).

Title of Report: Table of Grades

DataSource: qryTableOfGrades (cross-tab query)

Grouped by: [courses].[courseDescription]
(or the query's representation of it)

Sorted (within each course) by: [students].[student name]
(or the query's representation of it)

Each course will perhaps have different activities, so I could filter the
report by the course displayed in the form from which the report is called.
Nov 13 '05 #1
1 3300
Thank you. Here's how I got it to work:

Option Compare Database
Option Explicit

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim i As Integer
Dim j As Integer

Set db = CurrentDb
Set rst = db.OpenRecordset("select * from qryTableOfGrades")

rst.MoveFirst
j = -1
i = 0

For i = 0 To rst.Fields.Count - 1
If rst.Fields(i).Name Like "*ID" Then GoTo skip_it
j = j + 1

Select Case j
Case 0
Me.Label0.Caption = rst.Fields(i).Name
Case 1
Me.Label1.Caption = rst.Fields(i).Name
Case 2
Me.Label2.Caption = rst.Fields(i).Name
Case 3
Me.Label3.Caption = rst.Fields(i).Name
Case 4
Me.Label4.Caption = rst.Fields(i).Name
Case 5
Me.Label5.Caption = rst.Fields(i).Name
Case 6
Me.Label6.Caption = rst.Fields(i).Name
Case 7
Me.Label7.Caption = rst.Fields(i).Name
Case 8
Me.Label8.Caption = rst.Fields(i).Name
Case 9
Me.Label9.Caption = rst.Fields(i).Name
Case 10
Me.Label10.Caption = rst.Fields(i).Name
Case 11
Me.Label11.Caption = rst.Fields(i).Name
Case 12
Me.Label12.Caption = rst.Fields(i).Name
End Select

skip_it:
Next
rst.Clone
Set rst = Nothing
End Sub
Private Sub Report_Open(Cancel As Integer)
Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim i As Integer
Dim j As Integer
Set db = CurrentDb
Set rst = db.OpenRecordset("select * from qryTableOfGrades")
rst.MoveFirst

j = -1
i = 0

For i = 0 To rst.Fields.Count - 1
If rst.Fields(i).Name Like "*ID" Then GoTo skip_it
j = j + 1
Select Case j
Case 0
Me.field0.ControlSource = rst.Fields(i).Name
Case 1
Me.field1.ControlSource = rst.Fields(i).Name
Case 2
Me.field2.ControlSource = rst.Fields(i).Name
Case 3
Me.field3.ControlSource = rst.Fields(i).Name
Case 4
Me.field4.ControlSource = rst.Fields(i).Name
Case 5
Me.field5.ControlSource = rst.Fields(i).Name
Case 6
Me.field6.ControlSource = rst.Fields(i).Name
Case 7
Me.field7.ControlSource = rst.Fields(i).Name
Case 8
Me.field8.ControlSource = rst.Fields(i).Name
Case 9
Me.field9.ControlSource = rst.Fields(i).Name
Case 10
Me.field10.ControlSource = rst.Fields(i).Name
Case 11
Me.field11.ControlSource = rst.Fields(i).Name
Case 12
Me.field12.ControlSource = rst.Fields(i).Name
End Select

skip_it:
Next i
rst.Close
Set rst = Nothing
End Sub

"Richard Hollenbeck" <ri****************@verizon.net> wrote in message
news:jN*******************@nwrddc01.gnilink.net...
Hello Newsgroup. You have all been very helpful in the past and I thank
you. I try to ask relevant questions so that they don't just benefit me,
but also benefit the group. I'm currently overwhelmed by useless examples
across the web on how to make "dynamic crosstab reports" without myself
having a basic understanding about how to retrieve and assign recordsources, etc., from fields in a query to fields in the report. I see all these
examples and I don't know what I can modify and what is essential. I need a stripped-down, down to basics, tutorial (without a bunch of examples.) or
just simple explanation.

Looking all over the Internet I find numerous examples of "dynamic crosstab reports" based on a crosstab query. Unfortunately, everything I found,
including Microsoft's stuff, is usually based on a specific example and
doesn't explain the basics of what's really going on. Usually it is based
on a form that prompts the user to enter a beginning and ending date. I
don't care about dates. That's not what my query is about. I just need the bare-bones code to get the field name and data from a column and plug it
into the form. I do need to filter the results, but that's not my problem
right now. I'm not asking anybody to do my work for me. I just need a
clue. I'm asking, in general terms, how to define and open a datasource
(recordsource?) in a report, search through the column names and assign them to the labels or text boxes in the header, and search through the fields
(columns)each record, and assign them to textboxes for each student (row).
I think the query will supply the rest of the data with little other
formatting. I wonder why there isn't an easily understood description "out there" on how to do this without having to revise an example that isn't in
any way applicable to my situation. I know about inserting unbounded text
boxes and all that, but then the examples are so example-specific, that I
don't get the general idea.

Thanks! Rich Hollenbeck

my situation:
I will have 40+plus columns to print, so I will want to display
10-at-a-time, print them, get the next 10, etc. while keeping the same page formatting for each set of ten columns.

The columns will be activities in a course. The rows will be students
within a course. The data intersecting the rows and columns will be the
score (or grade).

Title of Report: Table of Grades

DataSource: qryTableOfGrades (cross-tab query)

Grouped by: [courses].[courseDescription]
(or the query's representation of it)

Sorted (within each course) by: [students].[student name]
(or the query's representation of it)

Each course will perhaps have different activities, so I could filter the
report by the course displayed in the form from which the report is called.

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sofia | last post by:
My name is Sofia and I have for many years been running a personals site, together with my partner, on a non-profit basis. The site is currently not running due to us emigrating, but during its...
6
by: Chris Foster | last post by:
I am trying to implement a very fast queue using SQL Server. The queue table will contain tens of millions of records. The problem I have is the more records completed, the the slower it gets....
3
by: Jack A | last post by:
OK Guys. I'm fed up of the query below taking too much time. I CANT change the query since it is generated by a 3rd party product. I can change indexes and add new indexes though. The schema of...
2
by: Oliver Burnett-Hall | last post by:
I'm trying to move to using tableless page layouts, but I've come across what appears to be a bug in IE5's rendering that I can't find a way to overcome. The page has a sidebar to the left of...
9
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
1
by: Peggy Go | last post by:
Hi! I've downloaded postgreqsql-base-7.2.4.tar.gz but it says in the readme file that "This distribution also contains several language bindings, including C, Perl, Python, and Tcl, as well as a...
5
by: HotRod | last post by:
I am new to this so please go easy. We currently have some students doing some work on some web based tracking documents for us. They are currently using VB .net to develop what we requested....
13
by: Alex Vinokur | last post by:
Why do we need non-virtual destructor? Because of vtable? Alex Vinokur email: alex DOT vinokur AT gmail DOT com http://mathforum.org/library/view/10978.html http://sourceforge.net/users/alexvn
3
by: Dean Craig | last post by:
I'm working with the new ASP.NET AJAX Control Toolkit. I have a map that has several key areas (hot spots) where when the user hovers over them, I want to pop up a small window with information in...
43
by: Frodo Baggins | last post by:
Hi all, We are using strcpy to copy strings in our app. This gave us problems when the destination buffer is not large enough. As a workaround, we wanted to replace calls to strcpy with strncpy....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.