Fastreport VCL DB Fields Concat

edited November 2020 in FastReport VCL

.Net Solution:

https://forum.fast-report.com/en/discussion/15756/how-to-concatenate-two-fields-or-two-strings


I need the same solution for Delphi/VCL.

How can i concat two DB fields ?


1) [<frxDBPool."NAME_VATER">]/[<frxDBPool."RASSE_VATER">]

2) [<frxDBPool."NAME_VATER">+'/'+<frxDBPool."RASSE_VATER">]

3) Is it necessary to set the Dataset ?


I'm getting in both cases exceptions or the field won't show up on the generated Report.

Using: Fastreport 6.7, RAD Studio 10.3


Regards,

Int3g3r

Comments

  • [<frxDBPool."NAMEVATER">+'/'+<frxDBPool."RASSEVATER">] should works if you concat string fields

    Try [VarToStr(<frxDBPool."NAMEVATER">)+'/'+VarToStr(<frxDBPool."RASSEVATER">)]

  • Hello gpi,

    I tested both solutions that you have suggested. Both don't work.

    Everything is fine in the designer preview.

    As soon i generate the PDF-report in my application then i see only "/" on my report.

    The Datafields are not empty. Follow code shows how i generate the report.


               dmMain.frxPDFExport.Background := True;

               dmMain.frxPDFExport.ShowProgress := False;

               dmMain.frxPDFExport.ShowDialog := False;

               dmMain.frxReport.LoadFromFile(ApplicationPath+'\GlobaleReport\Waagschein_A4.fr3');

               WSFileName := 'WS_'+dmMain.qryReportPool.RecNo.ToString+'_'+dmMain.qryReportPoolOM_4_WERT.AsString+'.pdf';

               dmMain.frxPDFExport.FileName := ApplicationPath+'\PDF\'+WSFileName;

               dmMain.frxReport.PrepareReport;

               dmMain.frxReport.Export(dmMain.frxPDFExport);


    Any other suggestions ?


    Thank you,

    Regards Int3g3r

  • Everything is fine in the designer preview.

    So, FR works OK

    As soon i generate the PDF-report in my application then i see only "/" on my report.

    Replace

    dmMain.frxReport.PrepareReport;

    with

    dmMain.frxReport.DesignReport;

    dmMain.frxReport.ShowReport;

    and look what is wrong in the your application

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.