Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to achieve multiple detail bands with columns?
Message
 
To
29/07/2003 13:14:23
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00809019
Message ID:
00814862
Views:
32
To get the Page Header information you have a couple of choices. One is to leave the information in the table and create a relation between the new cursor and that table so as the report prints, that table is always on the correct record. In the report definition, clarify those fields with tablename.fieldname. The second option you have is to join each SELECT statement with that table so you can pull in those fields. Either method will work so flip a coin.

As far as the "Operator/Operand type mismatch" error goes, my guess is that you have different data types in your SELECT statements that are being UNIONed together. Check each field in each SELECT statement and make sure that you always have the same data type in the same position of each SELECT statement.

Cathy


>Heres the revised code.
>
>
SELECT '4' AS SortKey, 'Family History' AS Group, ;
>    PFullName AS Extra1, PAddress1 AS Extra2, PAddress2 AS Extra3, ;
>    PCity as Extra4, PProvince as Extra5, PPostal as Extra6,;
>    STR(PPhone) as Extra7, Marital as Extra8, Gender as Extra9,;
>    ChartNum as Extra10, PatRefernc as Extra11,;
>    Occupation as Extra12, WorkPhone as Extra13, Pharmacy as Extra14,;
>    BirthDate AS Date1, Initvisit AS Date2, GenAssess as Date3,;
>    OnCpp as Date4,;
>    PHealthNum AS HealthNum, PersonData AS Descr FROM PatSummary;
>    WHERE PatSummary.PHealthNum = mHealthNum AND NOT DELETED();
>  UNION ALL SELECT '5' AS SortKey, 'Past History' AS Group, ;
>    PFullName AS Extra1, PAddress1 AS Extra2, PAddress2 AS Extra3, ;
>    PCity as Extra4, PProvince as Extra5, PPostal as Extra6,;
>    STR(PPhone) as Extra7, Marital as Extra8, Gender as Extra9,;
>    ChartNum as Extra10, PatRefernc as Extra11,;
>    Occupation as Extra12, WorkPhone as Extra13, Pharmacy as Extra14,;
>    BirthDate AS Date1, Initvisit AS Date2, GenAssess as Date3,;
>    OnCpp as Date4,;
>    PHealthNum as HealthNum, PastHist AS Descr FROM PatSummary;
>    WHERE PatSummary.PHealthNum = mHealthNum AND NOT DELETED();
>  UNION ALL SELECT '6' AS SortKey, 'Allergies' AS Group, ;
>    PFullName AS Extra1, PAddress1 AS Extra2, PAddress2 AS Extra3, ;
>    PCity as Extra4, PProvince as Extra5, PPostal as Extra6,;
>    STR(PPhone) as Extra7, Marital as Extra8, Gender as Extra9,;
>    ChartNum as Extra10, PatRefernc as Extra11,;
>    Occupation as Extra12, WorkPhone as Extra13, Pharmacy as Extra14,;
>    BirthDate AS Date1, Initvisit AS Date2, GenAssess as Date3,;
>    OnCpp as Date4,;
>    PHealthNum as HealthNum, Allergies AS Descr FROM PatSummary; && TableA
>    WHERE PatSummary.PHealthNum = mHealthNum AND NOT DELETED();
>  UNION ALL SELECT '1' AS SortKey, 'Conditions' AS Group, ;
>    '' AS Extra1, '' AS Extra2, '' AS Extra3, ;
>    '' as Extra4, '' as Extra5, '' as Extra6,;
>    "0" as Extra7, '' as Extra8, '' as Extra9,;
>    '' as Extra10, OGReferenc as Extra11,;
>    '' as Extra12, '' as Extra13, ''as Extra14,;
>    RecordDate AS Date1, ResolvDate AS Date2, {} as Date3, {} as Date4,;
>    HealthNum, HealthCond AS Descr FROM OnGoingHealth; && TableB
>    WHERE OnGoingHealth.HealthNum = mHealthNum AND NOT DELETED();
>  UNION ALL SELECT '2' AS SortKey, 'Medications' AS Group, ;
>    '' AS Extra1, '' AS Extra2, '' AS Extra3, ;
>    '' as Extra4, '' as Extra5, '' as Extra6,;
>    "0" as Extra7, '' as Extra8, '' as Extra9,;
>    '' as Extra10, TReference as Extra11,;
>    '' as Extra12, '' as Extra13, ''as Extra14,;
>    StartDate AS Date1, EndDate AS Date2, {} as Date3, {} as Date4,;
>    HealthNum, Regimen AS Descr FROM Treatment; && TableC
>    WHERE Treatment.HealthNum = mHealthNum AND NOT DELETED();
>  UNION ALL SELECT '3' AS SortKey, 'Consultations' AS Group, ;
>    '' AS Extra1, '' AS Extra2, '' AS Extra3, ;
>    '' as Extra4, '' as Extra5, '' as Extra6,;
>    "0" as Extra7, '' as Extra8, '' as Extra9,;
>    '' as Extra10, CReference as Extra11,;
>    '' as Extra12, '' as Extra13, ''as Extra14,;
>    Daterefer AS Date1, {} AS Date2, {} as Date3, {} as Date4,;
>    HealthNum, Specialist AS Descr FROM Consultants; &&TableD
>    WHERE Consultants.HealthNum = mHealthNum AND NOT DELETED();
>ORDER BY 1, 18 ; && 1 refers to col.1 SortKey, 18 is col.18 HealthNum
>INTO CURSOR TmpData
>
>Problem: The report Page Header has fields for Name, Address, City, Province, Postal Code, Gender, Marital Status and Phone. These are not being displayed now. Table PatSummary is the only table that has the values for these fields. How do I deal with this? I also got an "Operator/Operand type mismatch" error message.
>
>Thanks Cathy.
Cathy Pountney, Microsoft Visual FoxPro MVP
Memorial Business Systems, Inc. (www.mbs-intl.com)

My Website: (www.frontier2000.com)
My Blog: (www.cathypountney.blogspot.com)
My Book: The Visual FoxPro Report Writer - Pushing it to the Limit and Beyond
Free MSDN Article: What's New in the VFP 9.0 Report Writer
Free MSDN Article: The VFP 9.0 Report Writer In Action
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform