how to printing selected record (on MultiSelect Grid Mode)

edited December 2009 in FastReport 4.0
i want to print report base on user selection on DBGrid (No filter - MultiSelect Mode)

i already use some method:


1. Use GetValue method for TFrxUserDataSet

Sample

procedure FMain.frxItemGetValue(const VarName: string;
var Value: Variant);
begin
with DBGrid1.DataSource.DataSet do
begin
GotoBookmark(pointer(DBGrid1.SelectedRows.Items[frxItem.RecNo]));

if CompareText(VarName, 'ItemCode') = 0 then
Value := AQItemTable_ItemCode.AsString;

if CompareText(VarName, 'ItemName') = 0 then
Value := AQItemTable_ItemName.AsString;

if CompareText(VarName, 'QtyMax') = 0 then
Value := AQItemTable_QtyMax.AsString;

end;

end;


----> But this way not flexible, because more efforts for much fields


2. Use Temporary Table

We generate Temporary Table base on User Selection
But this method take long time if much data selected


Any way for solve this problem more quickly develop and quick generate report.. (Without CheckListBox)


Thanks...

Comments

  • edited 11:01PM
    My Idea is to Add a simple user function to the report then call the function in BeforePrint of the data band.

    In Delphi when this user function is called, goto next selection record.

Leave a Comment