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

Data fields in page header

Status
Not open for further replies.

philsky

Programmer
Sep 21, 2001
8
US
I want to print database fields (that appear in each row of data) in the page header and sort them horizontally. That is, I'm trying to circumvent the limitations of CR's crosstab report. I've got a (SQL Server) stored procedure that populates a temp table, whose structure looks like this:

RowID int (identity field)
Method varchar
Compound varchar
C1H1 varchar (column 1, header 1)
C1H2 varchar (column 1, header 2)
...
C6H5 varchar (column 6, header 5)
Data1 varchar (column 1 data point)
Data2 varchar (column 2 data point)
...
Data6 varchar (column 6 data point)

The temp table is populated with the header fields' values sorted properly.

Then in my Crytal Report I order the records by the RowID field, and I stack the header fields in 6 columns in the page header. But I'm still not getting the results I would expect.

Any ideas or suggestions wold be greatly appreciated!! Thanks!

 
What result did you expect?
What did you get?
Which limitation are you trying to deal with? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
The primary limitation is that the total number of columns produced by crosstab'ing the data varies according to the criteria specified at run time. It can be anywhere from just a few up to 60 or more. But I want to print 6 columns (not including method and compound) on each page. Since I build my temp table with 'Select Distinct' queries, I don't need (or want!) totals.

I group by method, and sort by rowID, method and compound. The method should not be duplicated for a given set of column headers (i.e. C1H1 thru C6H5).

I expect to see something like this:

Loc1 Loc2 Loc3 .... Loc6
QC1 QC2 QC3 .... QC6
<header row 3>
< 4 >
< 5 >
METHOD1
Comp1 <datapt> <datapt> ...
Comp2
...

METHOD2
...
(continuing for as many pages as necessary for this set of header fields)


The results I get, however, include problems such as:
1. the header fields are not sorted horizontally at all
2. the methods are not sorted and duplicates are not suppressed
etc.

I tried eliminating the method group, including this field with the detail rows, and then sorting them and suppressing duplicates, but that did not help in any way.

Do I need a subreport? a crosstab section?

Thanks!

Phil
 
I am not sure I understand your data.

Do the data values to print as Column Headings (Loc1, QC1) repeat through a group of records? Would they be the same for all of Method 1?

Do you want one method per page? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
I have fixed all my problems... so far.

Thanks for your responses!!

Phil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top