data grid and table object

edited 10:33AM in FastReport .NET
Hello ,
I need a component in fast report that will work like data gird in .net ,i can't use table object because it doesn't have datasource, and cant adjust it self in runtime dynamicly acording to my data source.
How can i write this kind of my own custom component , could you please send me example codes etc , i couldnt find anything in the documentation about this.


And/Or could you help me to solve this in table object ,

I use ManualBuild event like in demo , with the code below ;

DataSourceBase customers =Report.GetDataSource("DATASOURCENAME");
//Report.GetDataSource("FK_InventoryReceiptItemVariant_InventoryReceiptItem");
if( customers== null ) MessageBox.Show("null");
// init it
customers.Init();
// number of columns in the datasource
int colCount = customers.Columns.Count;

// print the table header which contains column titles. It's a row with index = 0.
Table3.PrintRow(0);
for (int i = 0; i < colCount; i++)
{
// fill the cell with column title
Cell3.Text = customers.Columns.Alias;
// print it
Table3.PrintColumn(0);
}

// now print a datasource content
while (customers.HasMoreRows)
{
// print the table body. It's a row with index = 1.
Table3.PrintRow(1);
for (int i = 0; i < colCount; i++)
{
// fill the cell with datasource column's data
Cell8.Text = customers[customers.Columns].ToString();
// print it
Table3.PrintColumn(0);
}

// move to the next row
customers.Next();
}




But this code doesnt understand the relation between the parent band and the child band which the tabel object in , also , it prints the all table for every row int the data source.




Thanks in advance

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.