Recent

Author Topic: [SOLVED] VST print lazreport  (Read 473 times)

Pe3s

  • Sr. Member
  • ****
  • Posts: 330
[SOLVED] VST print lazreport
« on: November 29, 2022, 12:56:59 pm »
Hello I have a question.  is it possible to print the contents of a virtualstringtree with lazreport?
« Last Edit: November 30, 2022, 04:27:10 pm by Pe3s »

GetMem

  • Hero Member
  • *****
  • Posts: 3953
Re: VST print lazreport
« Reply #1 on: November 29, 2022, 02:06:03 pm »
Hello I have a question.  is it possible to print the contents of a virtualstringtree with lazreport?
Convert the content of the VirtualStringTree to a bitmap first, then you can show it in LazReport or some other reporting tool like FPReport,  Fortes4Lazarus,  FortesReport-CE,  Fastreport.

Pe3s

  • Sr. Member
  • ****
  • Posts: 330
Re: VST print lazreport
« Reply #2 on: November 29, 2022, 04:50:55 pm »
I wrote a code that prints the selected row
Code: Pascal  [Select][+][-]
  1. procedure TForm1.frReport1GetValue(const ParName: String; var ParValue: Variant);
  2. var
  3.   Data: PData;
  4. begin
  5.    if not Assigned(VST.FocusedNode) then Exit;
  6.   Data := VST.GetNodeData(VST.FocusedNode);
  7.   if ParName = 'album' then
  8.   ParValue := Data^.album;
  9.  
  10.   if ParName = 'title' then
  11.   ParValue := Data^.title;
  12. end;
  13.  
How to write code that will print all entries in VST
« Last Edit: November 29, 2022, 07:40:14 pm by Pe3s »

jesusr

  • Sr. Member
  • ****
  • Posts: 483
Re: VST print lazreport
« Reply #3 on: November 29, 2022, 08:11:16 pm »
There is not a ready to use LazReport component for VST, but you can print almost anything using the LazReport addon lrCodeReport (<LazReport dir>/addons/lrcodereport), there is a sample project in there to get you started.

Pe3s

  • Sr. Member
  • ****
  • Posts: 330
Re: VST print lazreport
« Reply #4 on: November 29, 2022, 08:39:40 pm »
I know there is no plugin for VST, but there is a frUserDataset component, but I have no idea how to code it for VST yet

dseligo

  • Hero Member
  • *****
  • Posts: 888
Re: VST print lazreport
« Reply #5 on: November 30, 2022, 11:45:29 am »
I know there is no plugin for VST, but there is a frUserDataset component, but I have no idea how to code it for VST yet

Select frUserDataset1 as DataSource in your Master Data Band.
frUserDataset has OnFirst, OnNext and OnCheckEOF events which are used to set, advance and check if your data is at the end.

I made a small example so you can see how to use it.

Pe3s

  • Sr. Member
  • ****
  • Posts: 330
Re: VST print lazreport
« Reply #6 on: November 30, 2022, 04:26:52 pm »
@dseligo, Thank you very much. Regards

 

TinyPortal © 2005-2018