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

SearchCriteria and Global variables.

edited January 2003 in DADE
Hi there,

I'm using RB 6.03 and D&.

I have a report that consists of several dataviews. How many dataviews there
is, is not known prior to loading the report. The report is loaded into the
TppReport from file. All the dataviews needs the same inputvalue in the
searchcriteria. I do'nt need to display a dialog to set this inputvalue. The
code below shows how i create a global variable and assign a value to it.

if GetCodeObject(rptMain,lCodeModule) then
begin
lCreateProgram := lCodeModule.GlobalCreateProgram;
if (lCreateProgram=nil) then
begin
lCreateProgram := TraProgram.Create;
lCreateProgram.ProgramName := 'GlobalOnCreate';
lCreateProgram.ChildType := ctCreateProgram;
lCreateProgram.ProgramType := ttProcedure;

lCreateProgram.SourceLines.Clear;
lCreateProgram.SourceLines.Add('procedure GlobalOnCreate; ');
lCreateProgram.SourceLines.Add('begin ');
lCreateProgram.SourceLines.Add(' KontraktNummer := '+AValues+';
');
lCreateProgram.SourceLines.Add('end; ');

lCodeModule.GlobalCreateProgram := lCreateProgram;
lCodeModule.DSExclude([pppcEmpty]);

lCodeModule.BuildAll(true);
end;
end;

My question is. How can i assign the value of this global variable to the
searchcriteria of each dataview?

Thanks,

Terje

Comments

This discussion has been closed.