Storing No Of Records in a variable

edited 12:22PM in FastReport 3.0
dear friends,

i have to calculate number of records thats displayed
so i'm using COUNT(MAsterdata1) since only one master band is vailable.

In the program

dim i as variant

i=count(MasterData1)

showmessgae(VarToSTr(i))

But this is giving me only blank msg box without nay value.

How to store number of records in a varibale??? ;)

Comments

  • edited 12:22PM
    This is my 5th question and no response
    from FR Forum..
    Somebody lpz answer NEwbies question....

    PS:
    Den i hav seen u answering some comlpex queries,
    these questions may not be of ur level.still for me it is important

    Regards
    seshadri.r
  • gordkgordk St.Catherines On. Canada.
    edited 12:22PM
    Please give more info version of fr, where you are trying to write code in report script or delphi. Since you are a newbie I suggest that you read the user manual and try the examples, the programmers manual, as well as compile and run the main demo, it contains many example reports, covering about 90% of most requirements.
    ;)
  • edited 12:22PM
    Thanx gordk,

    i'm using FR3.17.

    I'm writing the code in Basic Scripts inside fast Report.


    I just want to get the count of records in a masterdata band
    and store it in a variable.

    The COUNT(MasterData1) gives the coutn but i'm not able to store them
    in a variable and use it.

    1. one more query was to move the cursor to next record.
    2. Wat is the syntax for End Of File if any in BAsic Scripts??

    i have gone through Manual but i think these points are not available
  • gordkgordk St.Catherines On. Canada.
    edited 12:22PM
    from your reply i assume you are using studio version and vbscript as the language is this correct ? or are you using delphi ide and basic script language in the
    code page?
    in what event are you writing this code?
    ;)
  • edited 12:22PM
    ur right gordk

    i'm using studio version and basic script as language.

    i'm writing in OnBeforeMasterData1Print
  • gordkgordk St.Catherines On. Canada.
    edited 12:22PM
    you should really be posting in the studio forum.
    im a delphi pascal person and i am not sure of all available in studio edition.
    generally
    be careful where you try to retrieve aggregate values they aren't available until after something has been processed
    ie a memo in a footer might contain
    [COUNT(MAsterdata1)]

    declare your variable as integer, you may also want to declare it at the start of the code page so it is available globally rather than in an event .where it exists only for the life of the event.
    and use the correct function to display it in showmessage.

    normally a master band is connected to data through the dataset property of the band( choice of available datasets) which are usually frdbdatasets,or using specific internal dbengine controls.
    this controls the number of times the band appears,
    memos within the band are connected to a datafield of the dataset and display the value of the current record. You only setrowcount property when you do not have the band connected to a dataset.
    So unless you are doing some fancy manipulation you should not need to try to move to the next record.
    hope this helps
    ;)




  • edited 12:22PM
    Yup gordk,

    got it.actually i have changed the delimiter and trying
    with diferent delimiter.Thts the problem..
    Thanx for your gyan on FR3..

    NExt time will post in appropriate forum. ;)

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.