Report from multiselect DBGrid

I have a multiselect DBGrid that contain MasterData.
Some table / dataset is detail for MasterData.

I want user can print only selected row.

This is working like "Chosing record to Print" on demo program. But not use internal form FastReport.


Can fastreport handle this?

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 5:17PM
    Yes for single item
    set the properties of the frxdbdataset before calling report.
    range properties, open close dataset properties,
    set them back to normal after running report.

    or to use the dialog of the report
    change code
    to connect to the outside frxdbdatasource datasource to populate the listbox.
    ie
    assumes band4 is connected to frxdbdatasource
    procedure DialogPage1OnShow(Sender: TfrxComponent);
    begin

    CheckListBox1.Items.clear;
    band4.dataset.first;
    while not band4.dataset.EOF do
    begin
    CheckListBox1.Items.Add(VarToStr(<Customers."Company">));
    band4.dataset.Next;
    end;
    band4.dataset.first;
    end;
    code for obp of band is the same as in the demo
  • edited June 2010
    But how to do it with my program?
    I have many files FR3 and I can not change this at any!

    I tried to use the OnBeforePrint event of frxReport component:
    wrote:
    if xDBGrid1.Columns[0].IsCheckBoxValue(False) then xDBGrid1.DataSource.DataSet.Next;

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.