Suitability for Forms/Letters
I am currently using Quick Reports Std. 3.5 in Delphi 5 for my reporting needs and am now considering a switch to a report engine that has end-user capability. In addition to normal banded type reports, I print a number of form letters that have fields filled at runtime. Typically, these are a single instance of one page letters so I extract the individual record to a memory file before printing. An important requirement is the need to populate fields with multi-line expressions containing data such as name/address or other multiline variable information. It is necessary to be able to suppress the printing of blank lines (there are two lines of street address information but the second is usually empty). It is also necessary to print calculated fields. In running the demo, I notice that the FR memo object cannot suppress blank lines, or maybe I am missing something.
My general question is whether FR3 is suitable for printing such single page forms and letters?
My general question is whether FR3 is suitable for printing such single page forms and letters?
Comments
My biggest hurtle would be providing the end user with an easy to use interface as they are currently used to having a word processing UI to create form letters. Would any of your solutions be able to accomplish this?
you can create rtf in design mode or load from file or from a steam
insert data variables where required.
[frxDBDataset1."FNAME1"] [frxDBDataset1."MI1"][frxDBDataset1."LNAME1"]
[frxDBDataset1."ADDR11"]
[frxDBDataset1."ADDR12"]
[frxDBDataset1."CITY1"], [frxDBDataset1."STATE1"] [frxDBDataset1."ZIP1"]
What do I do to suppress the printing of a blank line? I looked at the help file for FR 3, the component properties and events available and I didn't see anything obvious.
iif(expression,truevalue, falsevalue)
[frxDBDataset1."FNAME1"] [frxDBDataset1."MI1"][frxDBDataset1."LNAME1"]
[frxDBDataset1."ADDR11"]
[frxDBDataset1."ADDR12"]
[frxDBDataset1."CITY1"], [frxDBDataset1."STATE1"] [frxDBDataset1."ZIP1"]
what you have is 4 lines, you problem starts when line 3 is empty
what you want is to put line 4 in line 3 pos
and an empty string in line 4
create 2 categorized vars A3 expression will be [frxDBDataset1."ADDR12"],
and A4 contains what you want on line4 the reason for doing this is it makes the complex iffunction much easier to write.
so now you replace [frxDBDataset1."ADDR12"] in the rtg memo with
[iif([frxDBDataset1."ADDR12"] = '','[A4]','[A3]')]
and the next line with
[iif([frxDBDataset1."ADDR12"] = '','','[A4]')]
the sample above tests for an empty string if you want to test for null
set reportengine option convert null to false, and write the expression accordingly
btw you could write this complex expression in the expression of the variable itself
At this moment I'm writing a script to do this for me, but it would be a great option to suppress blank lines if available, just like the Hide Zero option.
I wrote a script that suppresses the blank lines, but more data will follow these lines. This will create a gap.
Please help
I wrote a script, I attached the report to this email, but I'll paste it below too:
procedure Page1OnBeforePrint(Sender: TfrxComponent);
begin
if <frxDBDataset1."address1"> = '' then
begin
DetailData1.Visible := False;
end
else
begin
DetailData1.Visible := True;
end;
if <frxDBDataset1."address2"> = '' then
begin
DetailData2.Visible := False;
end
else
begin
DetailData2.Visible := True;
end;
if <frxDBDataset1."address3"> = '' then
begin
DetailData3.Visible := False;
end
else
begin
DetailData3.Visible := True;
end;
if <frxDBDataset1."address4"> = '' then
begin
DetailData4.Visible := False;
end
else
begin
DetailData4.Visible := True;
end;
if <frxDBDataset1."address5"> = '' then
begin
DetailData5.Visible := False;
end
else
begin
DetailData5.Visible := True;
end;
end;