Missing DataSets

Hi,

I have a common method that loads data for every report run. Prior to printing or designing the report, I call this method, which clears existing DataSets, and adds the necessary DataSets.

frxReport1.DataSets.Clear;
frxReport1.DataSets.Add(fsData1);
if iCount>1 then
frxReport1.DataSets.Add(fsData2);
if iCount>2 then
frxReport1.DataSets.Add(fsData3);

Some reports display that DataSets in the Data tab, on the right side. However, other reports, do not display any DataSets, and the right side says: "No data available." The Report->Data menu items opens a Connections dialog, which is empty. However, I do not have connections for any report. I just have the DataSets that I, programmatically, add. I can confirm frxReport1.DataSets.Count is greater than zero, on all reports. I can even confirm that the RecordCount > 0.

I am using 5.2. Any ideas as to what might cause this behavior?

Thanks,

David

Comments

  • gpigpi
    edited 4:53AM
    Try
    frxReport1.DataSets.Clear;
    frxReport1.EnabledDataSets.Clear;
    frxReport1.DataSets.Add(fsData1);
    frxReport1.EnabledDataSets.Add(fsData1);
    if iCount>1 then
      begin
        frxReport1.DataSets.Add(fsData2);
        frxReport1.EnabledDataSets.Add(fsData2);
      end;
    if iCount>2 then
      begin
        frxReport1.DataSets.Add(fsData3);
        frxReport1.EnabledDataSets.Add(fsData3);
      end;
    
  • To add to this. Report from code stopped working when we upgraded to Fast Report 6 from Fast Report 5. I needed to add frxReport1.EnabledDataSets.Add(fsData1) to make it work. So you helped me a lot. Thanks.

    Gisli

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.