How to change fastreport layout in xe7

I want to change the layout or group into a quick report depending on the dataset value, as can be done in fastreport 5.0 And I am using delphiXE7
If it is a car ticket, I want to print the car, and if its bike I want to print the bike data, have my dataset has values ​​of all orders in which some orders may have car and bike tickets, so when I create a report (ticket report for my application) based on the dataset value, if its a car I want to show images of the car, and if his bike will display different bike images based on dataset values ​​and different style, how can this be done?

OR Can this be done by modifying the .fr3 file?

  with  frxCODOrdersDBDataset.DataSet do
    begin
       First;
    while not Eof do
    begin     
      if FieldByName('draw_name').AsString='CAR_TICKET' then
       begin
   frxCODOrdersReport.LoadFromFile(ExtractFilePath(Application.ExeName) + '\WebTicketPdf\CarTicketPdf.fr3');
   frxCODOrdersReport.PrepareReport();
       end
       else if FieldByName('draw_name').AsString='BIkE_TICKET' then
       begin
   frxCODOrdersReport.LoadFromFile(ExtractFilePath(Application.ExeName) + '\WebTicketPdf\BikeTicketPdf.fr3');
       end;
      Next;
    end;
    end;
   Screen.Cursor := crDefault;  // Or you can restore a saved cursor.
   frxCODOrdersReport.ShowReport();

      

But the above generates the code and it prints or generates only the first car ticket pdf only.

0


source to share


1 answer


var IsFirst: Boolean;
with  frxCODOrdersDBDataset.DataSet do
begin
  First;
  IsFirst := True;
  while not Eof do
   begin     
      if FieldByName('draw_name').AsString='CAR_TICKET' then
       begin
        frxCODOrdersReport.LoadFromFile(ExtractFilePath(Application.ExeName) + '\WebTicketPdf\CarTicketPdf.fr3');
        frxCODOrdersReport.PrepareReport(IsFirst);
       end
   else if FieldByName('draw_name').AsString='BIkE_TICKET' then
     begin
       frxCODOrdersReport.LoadFromFile(ExtractFilePath(Application.ExeName) + '\WebTicketPdf\BikeTicketPdf.fr3');
       frxCODOrdersReport.PrepareReport(IsFirst);
     end;
    if IsFirst then IsFirst := False; 
    Next;
  end;
end;
Screen.Cursor := crDefault;  // Or you can restore a saved cursor.
frxCODOrdersReport.ShowPreparedReport();

      



0


source







All Articles