Setting the size of a Virtual Dataset at via Code

Gordk,

You have been very helpful in answering my last few questions. I think this is the final question I need answered in order to complete my cross-tab report.

I need to know how to set the Virtual Dataset size at runtime via code, both on the MasterBand and Crossbands. How do I do this?


BTW: Here is my plan for the cross-tab report.

I will open and process my db dataset, do all the grouping and summing etc., storing the results in-memory in a specially constructed data structure. Having done this, and then knowing the dimensions in rows and columns, I set the virtual dataset sizes. Each data item calls my in-memory data structure wrt column and row positions.

This should satisfy my application requirements.

Comments

  • edited 5:03PM
    Ooh. Brain-fade.

    I know how to do this: Attach an OnBeforePrint handler to the band object that calls an onuserfunction that supplies the virtual dataset size, like this:

    begin
    recordCount := getRecordCount(nil,nil,nil)
    end

    ;)
  • edited 5:03PM
    Nope. I"m wrong. It is more complicated than that.

    Gordk,

    How do I:
    (1) Set the Record Count of a Master Data band with a virtual dataset at runtime?
    (2) Set the Record Count of a Cross Data band with a virtual dataset for each crossed band at runtime?

    ;)
  • gordkgordk St.Catherines On. Canada.
    edited 5:03PM
    you could declare 2 variables in dictionary to handle the counts pass in when report loaded then in title band set datasource prop ovirtual dataset of each band
    masterdata1.datasource:= [variablename]
    or from outside
    var
    b:tfrbandview;
    begin
    code to loadreport
    b:=frreport1.findobject;
    b.datasource := inttostr(someint);
    code to show report or prepare or whatever
    regards ;)

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.