there is a smalle demo that shows variable access at http://forum.lazarus.freepascal.org/index.php/topic,40304.msg278363.html#msg278363
@Hydexon
You should switch to Fortesreport. It's based on Quickreport, it also has bands, but you can access the report components directly. It's far better then Lazreport in my opinion. Download link: https://packages.lazarus-ide.org/fortes4lazarus3.24.zip
Sorry this makes no sense to me, what "uses an really cumbersome way" means exactly? does it work or not? If it works then use if not provide a demo showing the problem.there is a smalle demo that shows variable access at http://forum.lazarus.freepascal.org/index.php/topic,40304.msg278363.html#msg278363 (http://forum.lazarus.freepascal.org/index.php/topic,40304.msg278363.html#msg278363)
Already tried it, but uses an really cumbersome way to do those things, some reports of mine have LOTS of TfrMemoView using those variables, and i have a lot of complex reports which needs to load a lot of data
When i mean about cumbersome, i mean of this:is that from GetMem's demo? I didn't looked it I assume that the code I posted was enough for variables.
if (View is TfrMemoView) then begin if (View as TfrMemoView).Name = 'mPost' then (View as TfrMemoView).Memo.Text := ' ' + edPost.Text; if (View as TfrMemoView).Name = 'mDepartment' then (View as TfrMemoView).Memo.Text := ' ' + edDepartment.Text; if (View as TfrMemoView).Name = 'mDate' then (View as TfrMemoView).Memo.Text := ' ' + FormatDateTime('MM.DD.YYYY', DP.Date); end;
in the frReportEnterRect event, and also i need to load the data and set the variables once (where talking about dozens of variables, and many of them are from different reports), since i call my database several times. i prefer do like this, an more cleaner way to do things:How about this?
procedure TBoletaViewerForm.SetRecordsData; begin frReport1.Values.FindVariable('FieldVarTest').Field := 'TEST' ; end;
frReport1.Values.FindVariable('FieldVarTest').Field := 'TEST' ;
QuotefrReport1.Values.FindVariable('FieldVarTest').Field := 'TEST' ;
If this doesn't raise an access violation this means that you have actually defined a 'variables editor' variable, how is that defined? as linked to a dataset field, as "other" and then as an expression?, is it assigned to [NONE]?.
If it is set to [NONE] in the editor then this might be the answer, you are changing the field but its marked as unasigned, is not much useful this way, at run time you would have to change the type to other than vtNotAssigned.