Recent

Author Topic: Crosspost: Lazreport with Richtext and Tabs  (Read 5480 times)

manhu

  • New Member
  • *
  • Posts: 24
Crosspost: Lazreport with Richtext and Tabs
« on: August 21, 2017, 03:20:05 pm »
Hi, i posted a "Problem" in lazreport and it also involves Richmemo. So i allow myself to make a Crosspost since Nobody answered under Lazreport:

Quote
I ported a Application from Delphi to Lazarus.  "Almost" every ting works great.
Just one big Problem:
How can i print Richtext or if this is not going to work at least text with Tabs ( ASCII Code 9 ).

I tried Fastreport and Lazreport with no success.
I use Lazarus 1.64 and the Data is stored in a MySQL DB. In the Application everything works fine.
The Memofield is a TDBMemo. I also used a TDBRichMemo but the Problem is in the Printing...

Thanks for any Tips.
Shalom Manfred

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2290
    • havefunsoft.com
Re: Crosspost: Lazreport with Richtext and Tabs
« Reply #1 on: August 22, 2017, 03:30:04 am »
As long as you're trying to print RichMemo in Windows, it should work.
I mean, tabs should print the offsets properly (if you set "tabs")

RichMemo Print doesn't work (yet) for any other platforms but Windows
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

manhu

  • New Member
  • *
  • Posts: 24
Re: Crosspost: Lazreport with Richtext and Tabs
« Reply #2 on: August 22, 2017, 02:45:20 pm »
Thank you for your response..
( It is a TDBRichmemo )

In fastreport it is not possible ( sadly not supported in Lazarus > reported by Fastreport Support ).

In Lazreport i am testin now and the Field looks like this:
Quote
{\rtf1\ansi\ansicp1252\deff0\deflan1033{\fonttbl{\f0\fcharset0 Arial;}}\f0\fs24\ulnone \pard\li0\sl240\slmult1 D\f0\fs24 a\f0\fs24 n\f0\fs24 k\f0\fs24 e\f0\fs24 n\f0\fs24 :\f0\fs24    \f0\fs24 -\f0\fs24  \f0\fs24 f\f0\fs24 \u252 \f0\fs24 r\f0\fs24  \f0\fs24 d\f0\fs24 i\f0\fs24 e\f0\fs24  \f0\fs24 v\f0\fs24 i\f0\fs24 e\f0\fs24 l\f0\fs24 e\f0\fs24 n\f0\fs24  \f0\fs24 m\f0\fs24 i\f0\fs24 t\f0\fs24  \f0\fs24 N\f0\fs24 T\f0\fs24 \u8217 \f0\fs24 s\f0\fs24  \f0\fs24 a\f0\fs24 u\f0\fs24 s\f0\fs24 g\f0\fs24 e\f0\fs24 r\f0\fs24 \u252 \f0\fs24 s\f0\fs24 t\f0\fs24 e\f0\fs24 t\f0\fs24 e\f0\fs24 n\f0\fs24  \f0\fs24 H\f0\fs24 o\f0\fs24 t\f0\fs24 e\f0\fs24 l\f0\fs24 s\f0\fs24  \f0\fs24 u\f0\fs24 n\f0\fs24 d\f0\fs24  \f0\fs24  \f0\fs24 H\f0\fs24 o\f0\fs24 t\f0\fs24 e\f0\fs24 l\f0\fs24 s\f0\fs24 c\f0\fs24 h\f0\fs24 i\f0\fs24 f\f0\fs24 f\f0\fs24 e\f0\fs24 .\f0\fs24 \par \f0\fs24 \pard\li0\sl240\slmult1    \f0\fs24    \f0\fs24 -\f0\fs24  \f0\fs24 f\f0\fs24 \u252 \f0\fs24 r\f0\fs24 

The Field in the Database is a Blob-Field.

manhu

  • New Member
  • *
  • Posts: 24
Re: Crosspost: Lazreport with Richtext and Tabs
« Reply #3 on: August 22, 2017, 05:33:22 pm »
I tried also TRichmemo and the Content looks ( in the Report ) Almost the Same.

Witch Report Generator do you use?
I Tryed LazReport and Fastreport.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 849
Re: Crosspost: Lazreport with Richtext and Tabs
« Reply #4 on: August 22, 2017, 06:15:16 pm »
I Tryed LazReport and Fastreport.

You might try both versions of FortesReport:

eBOOK or Wiki Download
http://forum.lazarus.freepascal.org/index.php/topic,35633.msg235866.html#msg235866

and the new fpReport:
Lazarus, report and CGI
http://forum.lazarus.freepascal.org/index.php/topic,31191.msg257126.html#msg257126

manhu

  • New Member
  • *
  • Posts: 24
Re: Crosspost: Lazreport with Richtext and Tabs
« Reply #5 on: August 22, 2017, 07:37:50 pm »
 Thanks for the suggestion.
I just find it interesting that there is so little information about that issue.

Shalom Manfred

manhu

  • New Member
  • *
  • Posts: 24
Re: Crosspost: Lazreport with Richtext and Tabs
« Reply #6 on: August 23, 2017, 04:42:18 pm »
The fpReport look realy interesting especially this:
Quote
- Standard support for Memo (with HTML tags embedded), image, shape and checkbox elements

Did not find a download yet, but i think this will be available soon.
Shalom
Manfred

manhu

  • New Member
  • *
  • Posts: 24
Re: Crosspost: Lazreport with Richtext and Tabs
« Reply #7 on: September 01, 2017, 02:50:18 pm »
Hi
If anybody is interested, i did now the following:
On Print > Save Richedit with Stream to a File > Open Word with the File.

Code: Pascal  [Select]
  1. procedure Tfrm_minutes.btn_current_minute_wordClick(Sender: TObject);
  2. var
  3.    fs: TFileStream;
  4. begin
  5.     fs := TFileStream.Create(xls_dir+'minutes.rtf', fmCreate);
  6.     try
  7.            RichMemo1.SaveRichText(fs);
  8.     finally
  9.            fs.Free;
  10.     end;
  11.     //
  12.     custom_field := (xls_dir+'minutes.rtf');
  13.     DM.open_folder(Sender);
  14.     //OpenDocument(xls_dir+'minutes.rtf');
  15. end;  

Shalom
Manfred