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?

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 3:43AM
    Yes it can and there is a number of ways to accomplish what you want.
    ;)
  • edited 3:43AM
    I too am interested in this. I currently use WPTools but would require an upgrade for what I am working on. If FR can do it for me that would be great.

    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?
  • gordkgordk St.Catherines On. Canada.
    edited 3:43AM
    yes use an rtf memo instead of a plain text memo.
    you can create rtf in design mode or load from file or from a steam
    insert data variables where required.
    ;)
  • edited 3:43AM
    I added a richtext field to my test file and put some fields in the following expression:
    [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.
  • gordkgordk St.Catherines On. Canada.
    edited 3:43AM
    use a complex if function and some variables
    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
    ;)

  • edited 3:43AM
    I realize that I can write a function as you indicated. I often fill in memos and expressions with such functions. However, I was hoping there would be a convenient property setting like the 'removeblanklines' in QuickReports for expression memos. Would be possible to create a new subclassed component in Fast Reports to do the same thing?
  • edited 3:43AM
    I'm also searching for a solution for this problem. In my case I have 5 address lines. In some cases all 5 can be empty and need to be removed if so, because of other lines following these 5 address lines.

    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.

  • edited 3:43AM
    Nope can't figure this one out, but I really need this to work.
    I wrote a script that suppresses the blank lines, but more data will follow these lines. This will create a gap.

    Please help ;)
  • edited 3:43AM
    Is there a escape sequence or code I can place in the text object that adds a new line to the line?

  • edited 3:43AM
    I found a simple solution! (for me at least, I'll have educate my users in the future though).
    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;

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.