How to add List view item into dataset in delphi?

北战南征 提交于 2019-12-25 03:14:14

问题


i am developing invoicing system

in my application there is a listview, a fastreport, button.. when press the the button the report should show the all item in the report can anyone provide best solution for this?


回答1:


From example PrintStringList from FastReport's Demos folder:

var
  Button1: TButton;
  StringDS: TfrxUserDataSet;
  frxReport1: TfrxReport;
  StringList: TStringList;

procedure TForm1.Button1Click(Sender: TObject);
begin
  StringDS.RangeEnd := reCount;
  StringDS.RangeEndCount := StringList.Count;
  frxReport1.ShowReport;
end;

procedure TForm1.frxReport1GetValue(const VarName: String; var Value: Variant);
begin
  if AnsiCompareText(VarName, 'element') = 0 then
    Value := StringList[StringDS.RecNo];
end;


来源:https://stackoverflow.com/questions/23535533/how-to-add-list-view-item-into-dataset-in-delphi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!