Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Assign a variable to a label caption

edited June 2001 in General
Stats
D5
DBISAM 2.10
rb 5.56 enterprise
Using report Templates

I have a label lblUser on each of my reports(templates) which I want to
display the Curent User (loginID see the sample code below)
Problem: I cannot seem to assign a value to the lbUser.Caption ; a Compile
error [Error] InMain.pas(1075): Undeclared identifier: 'lblUser'. I tried
RAP On print event lblUser.Caption := ADDM.CURRENT_USER; I get a comple
error "Undeclared Identifier ADDM"
What Can I do. ?


TIA

Allan

Sample
LOOKDM.OpenReportingTables;
LOOKDM.tblVend_.Indexname := '';
If FormPrintAlpha.Showmodal = mrOK Then
Begin
If FormPrintAlpha.rgprint.ItemIndex = 0 Then
LOOKDM.tblVend_.Indexname := 'KNOWN_NAME';
FormInvReports.ppInvReport.Template.FileName := Config.Reports +
'\APVendorListDetail.rtm';
{Run the report}
FormInvReports.ppInvReport.Template.LoadFromFile;
// ================
FormInvReports.ppInvReport.lblUser.Caption := ADDM.CURRENT_USER;
< -----here is what i want
// ================
FormInvReports.ppInvReport.Print;
End;
LOOKDM.tblVend_.Indexname := '';
LOOKDM.CloseReportingTables;

Comments

  • edited June 2001
    If you are using templates, then use RAP for the event handlers.

    What is ADDM? Is it a variable in your application? RAP isn't aware of
    global variables in your application. You would need to either code a
    pass-thru function to surface this value in RAP (see the RAP demos in your
    installation), or create a JIT pipeline and use the pipeline to send the
    value.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.