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 9:00PM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.