Access to program procedures/functions
Hi,
I have a database with records that may be individual or linked with another record (always after). So, for example, i have a type field which may be A, B, C, LinkedA etc and a distance feild. So for types B,C i wish to display just the record, but for A and LinkedA i would like to display extra information (namely distanceA - distanceLinkedA) which spans across these two records. Is there an easy way to do this?
Further down the track i would like to plot these values on a chart and import into the report. I have a function in my application that does this, so is there a way to access this function in the OnbeforePrint event of a picture? This way i can do the following:
procedure SpanPictureOnBeforePrint(Sender: TfrxComponent);
begin
MainForm.LoadSpanData(<IncidentDataSet."ID">); //this displays my desired information in a chart on the mainform
//now i can export the chart and load it to picture
tFrxPictureView(Sender).Picture.ASsign(MainForm.Chart.TeeCreateMetaFile(False,Rect(0,0,Round(Sender.Width),Round(Sender.Height)));
end;
The problem i am getting currently is i get an undeclared identifier (mainForm) but if i try and add MainUnit.pas to the uses list i get a 'begin expected' error.
Is there any way i can access my application variables/procedures from within FR script?
Thanks
I have a database with records that may be individual or linked with another record (always after). So, for example, i have a type field which may be A, B, C, LinkedA etc and a distance feild. So for types B,C i wish to display just the record, but for A and LinkedA i would like to display extra information (namely distanceA - distanceLinkedA) which spans across these two records. Is there an easy way to do this?
Further down the track i would like to plot these values on a chart and import into the report. I have a function in my application that does this, so is there a way to access this function in the OnbeforePrint event of a picture? This way i can do the following:
procedure SpanPictureOnBeforePrint(Sender: TfrxComponent);
begin
MainForm.LoadSpanData(<IncidentDataSet."ID">); //this displays my desired information in a chart on the mainform
//now i can export the chart and load it to picture
tFrxPictureView(Sender).Picture.ASsign(MainForm.Chart.TeeCreateMetaFile(False,Rect(0,0,Round(Sender.Width),Round(Sender.Height)));
end;
The problem i am getting currently is i get an undeclared identifier (mainForm) but if i try and add MainUnit.pas to the uses list i get a 'begin expected' error.
Is there any way i can access my application variables/procedures from within FR script?
Thanks
Comments
I sugest you read the programmer's and user's manual on working with variables.
for other procedures and functions read the developer's manual.