Row Problem

edited February 2010 in FastReport .NET
Hello;

I'm new for FastReport.NET.I designed a report,I want to send a parameters from my program to report.But the problem is when I send a rows collection (dataset),only one row seems in the report.How can I send arrays to report without database connection.

Example

I'm using this code for it.
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                report1.SetParameterValue("Test", ds.Tables[0].Rows[i][2].ToString());
            }

Comments

  • edited 10:05AM
    Hello,

    This code just overwrites the "Test" parameter each time, so it will contain only the last value. I recommend to register the datasource in a report, instead of using the parameter.

    report.RegisterData(ds.Tables[0], "MyTable");

    In the report, you will be able to connect the MyTable datasource to a databand and print its rows.
  • edited 10:05AM
    AlexTZ wrote: »
    Hello,

    This code just overwrites the "Test" parameter each time, so it will contain only the last value. I recommend to register the datasource in a report, instead of using the parameter.

    report.RegisterData(ds.Tables[0], "MyTable");

    In the report, you will be able to connect the MyTable datasource to a databand and print its rows.


    I did it,but still there is a problem,I redesigned my report,only one row seems.
  • edited 10:05AM
    Did you connected the DataBand to the dataasource? Non-connected band will display the first row only.
  • edited 10:05AM
    Many Many Thanks Alex,the problem is solved.

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.