Generate report with external TADOQuery

A_BA_B
edited 8:47AM in FastReport 4.0
Hi,

I have a DBGrid (that filled by an ADOQuery) in the form and want to dynamically generate columns in Fast Reports with the data in that DBGrid. I want I have a function to get a DBGrid as argument and then generate a simple grid in the Fast Reports (something same as QuickReport). Basically, is it possible?

Thanks for assist.

Comments

  • Anu de DeusAnu de Deus Hampshire, UK
    edited 8:47AM
    Sure, I do it all the time, but there is no automatic way of doing it, you will have to do all the work/code (like I did).

    For i:= 0 to Adoquery1.fields.count-1 do
    lMemo := TfrxMemoView.create .....

    Then you set the text property of the memo, then the left property, then the dataset property, and so on.

    It's not difficult, but it's not a 3 lines solution like you may have expected...

  • A_BA_B
    edited 8:47AM
    Hi;

    I prepared ADOConnection, ADOQuery and then multiple Memos in the FastReport; But I don't know how to assign memo to a Band (ex. Master Data Band) via code. Can you show me a sample working code for do that?

    Regards.
  • gordkgordk St.Catherines On. Canada.
    edited 8:47AM
    read the programmer's manual chapters on building reports from code.
    the memoviews must be created in the context of the band;

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.