Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: FastReport Question


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Feb 10, 2018 3:34 AM Last Post By: Eitan Arbel Threads: [ Previous | Next ]
Madhu Gopalachari

Posts: 34
Registered: 6/4/10
FastReport Question  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 9, 2018 9:53 AM
I finally managed to generate a report using Fastreport for Intraweb. I dropped a TfrxReport component on UserSessionDatamodule and have frxdbdatasets to populate my report. I need a way of iterating through the various datasets inside the report itself and fill data conditionally. I'm using the before and after print events but I am not able seek very efficiently using If conditions and ds.next etc. This is my first report and its not anything like Quickreports which I use in conjunction wit Delphi. I have most of my data feeding through correctly.

I need some guidance. Thanks for all your help.
Eitan Arbel

Posts: 508
Registered: 2/24/13
Re: FastReport Question  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 10, 2018 3:34 AM   in response to: Madhu Gopalachari in response to: Madhu Gopalachari
here is an example of something i use in my app (i changed a little to fit your question) :

Procedure TfrmBid.LoadBidByBID(BID : Int64);
Var TempMemo1 : TfrxMemoView;
    TempX     : Integer;
Begin
//we load the Bid and the FastReport takes the info from fqBids  (fqBids = FireDAC Query)
  With UserSession.fqBids Do Begin
    If Active Then Close;
    SQL.Text:='SELECT * FROM "Bids" WHERE BID=:BID';
 
    ParamByName('BID').AsLargeInt:=BID;
 
    Open;
 
      TempMemo1:=TfrxMemoView(frxReport1.FindComponent('Memo6'));
      TempMemo1.Visible:=FieldByName('SomeFieldToShowOrNot').AsBoolean;
 
      If FieldByName('SomeField').AsInteger<>0 Then Begin
        TempMemo1:=TfrxMemoView(frxReport1.FindComponent('Memo1'));
        TempX:=FieldByName('SomeField').AsInteger;
        TempMemo1.Lines.Clear;
        TempMemo1.Lines.Append('write something here'+IntToStr(TempX));
        TempMemo1.Visible:=FieldByName('PrintValitidy').AsBoolean;
      End;
 
      TempMemo1:=TfrxMemoView(frxReport1.FindComponent('Memo10'));
      TempMemo1.Visible:=FieldByName('AnotherField').AsBoolean;
 
//    Close;//should stay opened for the printing, because the FR component is connected to the DB
  End;//With UserSession.fqBids
End;
{------------------------------------------------------------------------------}
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02