Link to home
Start Free TrialLog in
Avatar of Gert76
Gert76

asked on

Generating a Report using TRichEdit

How do I generate a report from a SQL database,
reading the fields into a TRichEdit, knowing the
length of the fields and their text discriptions and
going over to a new line if the fields and their
discriptions exceed the RichEdit components width (wordwrap is disabled) ?
Avatar of Slavak
Slavak

why RichEdit?
Avatar of Gert76

ASKER

The client wants a RichEdit report because they want to save the report as tab delimited file and they want to
edit the information in the report etc. The previous
reports before I got involved in the project was all done
with RichEdit's so I don't think they will change this.
ASKER CERTIFIED SOLUTION
Avatar of Slavak
Slavak

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
A problem with the RTFExportFilter is that all components that need to be on one line of the RTF need to have their Top properties exactly the same.

Regards Jacco
Hi Gert,

Are you still here?
Avatar of Gert76

ASKER

Hi Jaco

To save the file as RTF is not an option !
They want to save the file as a tab delimited file to
import and edit it in Excel.

Thanks
Gert
Hi Gert,

Then you might consider using:

procedure TForm1.Button1Click(Sender: TObject);
var
  lFilter: TQRCommaSeparatedFilter;
begin
  lFilter := TQRCommaSeparatedFilter.Create('test.csv');
  try
    QuickRep1.ExportToFilter(lFilter);
  finally
    lFilter.Free;
  end;
end;

This will give you a file you can import into Excel.

Regards Jacco
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

split points between Slavak and Jacco

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thanks,

geobul
EE Cleanup Volunteer