Access to program procedures/functions

edited 2:33AM in FastReport 4.0
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

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 2:33AM
    variable values can be retreived using the ongetvalue event or passing them in in any of the tfrxreport components events.
    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.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.