Getting started with Fast reports

edited 3:03PM in FastReport 4.0
I have just got a copy of XE3 and decided to have a go at recoding all my reports to use FastReports instead of Rave. Most are code based and not suitable for the designer, a few are designer form based.

1. Can anybody recommend a good place to look for example projects of code based reports so I can get a feel for how they work and general design principles before I start on my rather complex reports.

2. As a start I have successfully created a designer form that I could use for one report but got stuck when looking at how to transfer data to it. Every example I can find assumes data is in a database but mine is in a Record structure - how do I transfer an element in a record to a text item on a designed page?

3. I found a post saying I could create a fastreport file from an existing rave designer report by using frxReport1.LoadFromFile() to load the rave file and then saving it but the loadfromfile command fails saying the file structure is not valid. Are there reasons why that might happen given that the file works perfectly well (it was initially created by rave 5.3 in Delphi 7 but has been updated by rave 7.7 in Delphi 2010)?

Comments

  • edited 3:03PM
    doncht wrote: »
    doncht wrote: »
    2. As a start I have successfully created a designer form that I could use for one report but got stuck when looking at how to transfer data to it. Every example I can find assumes data is in a database but mine is in a Record structure - how do I transfer an element in a record to a text item on a designed page?

    I would like to get an opinion to that please.

    Is my question really so difficult that nobody can answer it?

    Lets try a different approach. I start a new vcl forms application. I add an OK button + TfrxReport + TfrxUserDataSet (with one field) to the form and double click the TfrxReport to design a print with a 3 column page and a title band and a second band which is TfrxMasterData. I set the DataSet to the userdataset on the main form, add two memos to it. One has hard coded text, the other is set to the field in the userdataset.

    I save the designed print form and in the onclick event of the button I put:

    //code
    Dataset1.Fields[0] := 'Some text';
    frxReport1.ShowReport;
    //end code

    I get the title and the hard coded text but do not get 'Some text'. What do I need to do to display the text?

    I also get the hard coded text repeated 3 times across the page and down the page for what seems to be an infinite print - how do I control how many times it prints (actually what I need is to print the masterdata band one at a time until my data runs out. In the real case the data is in an array of TRecord that contains many fields with text, symbols and numbers.
  • edited 3:03PM
    OK - I found the OnGetValue event and have worked out how to get the data and also found that RangeEndCount only works if you reset RangeEnd at the same time so I can do most of what I want.

    I have one annoying issue however - I want my output in 3 columns counting 1,2,3 across the page then 4,5,6 in row 2 etc. I can do this by setting page columns to 1 and databand columns to 3 but if the total results are not divisible by 3 the box surrounding the last result expands across the page. How can I stop that? If I set page columns to 3 it solves that issue but counts down the page rather than across it.

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.