---------------- Working with variables -------------------------------------Q: How I can fill variables list (in data dictionary) programmatically?
A: All variables and categories from data dictionary stored in
TfrReport.Dictionary.Variables. with frReport1.Dictionary do
begin
// creating category (space in category name required!)
Variables[' New category'] := '';
// creating variables
Variables['New Variable'] := 'CustomerData.Customers."CustNo"';
Variables['Another Variable'] := 'Page#';
end;Q: I define my variable and assign string to it: with frReport1.Dictionary do
Variables['Month'] := 'March'; But when I run report, I get an error. Why?
A: Because FastReport assumes that string values, assigned to the data
dictionary variables, are expressions which it should parse and calculate.
Use additional quotes: with frReport1.Dictionary do
Variables['Month'] := '''' + 'March' + '''';
A: All variables and categories from data dictionary stored in
TfrReport.Dictionary.Variables. with frReport1.Dictionary do
begin
// creating category (space in category name required!)
Variables[' New category'] := '';
// creating variables
Variables['New Variable'] := 'CustomerData.Customers."CustNo"';
Variables['Another Variable'] := 'Page#';
end;Q: I define my variable and assign string to it: with frReport1.Dictionary do
Variables['Month'] := 'March'; But when I run report, I get an error. Why?
A: Because FastReport assumes that string values, assigned to the data
dictionary variables, are expressions which it should parse and calculate.
Use additional quotes: with frReport1.Dictionary do
Variables['Month'] := '''' + 'March' + '''';
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货