Working with reports without DataSource

edited 10:52AM in FastReport .NET
I want to be able to design a report and use it without a DataSource. I want to fill the data programatically in the various controls of the report.
What would be the best way to do this?

Comments

  • edited 10:52AM
    You may put several "Text" objects on a report. To get a reference to an object, use the FindObject method of the Report object:

    TextObject text1 = report1.FindObject("Text1") as TextObject;
    text1.Text = "my text";
  • edited 10:52AM
    AlexTZ wrote: »
    You may put several "Text" objects on a report. To get a reference to an object, use the FindObject method of the Report object:

    TextObject text1 = report1.FindObject("Text1") as TextObject;
    text1.Text = "my text";

    Yes but what should I do to make a new band for every new row in my data? The same as FastReport does automatically when connected to a DataSource.
    In the piece of code above, "Text1" is actually one control in one DataBand, as designed. However at runtime, when new rows are processed and so new bands are added, every band has its own Text1 control, right?
  • edited 10:52AM
    It seems to me that I didn't understood your initial question... If you have some data source, why just not register it in FastReport, and create regular, data-bound reports?
  • edited 10:52AM
    AlexTZ wrote: »
    It seems to me that I didn't understood your initial question... If you have some data source, why just not register it in FastReport, and create regular, data-bound reports?
    For several reasons. For example I want to process records of my data in a different order than they are stored, I want custom processing for some records, I want to skip some and so on.
    On a related note, do you plan to change the actual architecture to allow creation of reports as classes derived from FastReport.Report (the same way as VS does for forms) instead of just instances of FastReport.Report ? This way I can access every object in a report directly instead of using FindObject()...
  • edited 10:52AM
    You may use built-in abilities of FastReport to sort & filter the data.
    We don't plan to change the architecture. You may save your report as a class. This is described in the programmer's manual, "Working with Windows.Forms/Storing and loading a report".

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.