Hi Michael,
Yes, you can use the DataTable as DataSource.
Please review the How to create a report dynamically KB article, to learn how to accomplish this task at runtime.
Thanks,
Andrew
Hi,
Thanks for the quick response last time. However the article you linked to does not address my exact question. I definitely do not want to build the report all in code like the example states. I want to use the report editor to make our report. I had already manually set the table I was working with as a source I just can't get it to show up in the Designer. Neither setting it manually or using the "Add a Dataset..." option allows me to select my DataSet in the field list menu. I'm sure I am just missing something here but it seems like there's no way to get it to show up.
Hi,
My major problem lies in actually assigning the dataTable as a datasource for the report. For instance if i were to create a datatable using the following code (which I took from your example):
public DataSet FillDataset() {
DataSet dataSet1 = new DataSet();
dataSet1.DataSetName = "nwindDataSet1";
DataTable dataTable1 = new DataTable();
dataSet1.Tables.Add(dataTable1);
dataTable1.TableName = "Category";
dataTable1.Columns.Add("CategoryName", typeof(string));
dataTable1.Columns.Add("count1", typeof(int));
dataTable1.Columns.Add("count2", typeof(int));
dataTable1.Columns.Add("count3", typeof(int));
dataSet1.Tables["Category"].Rows.Add(new Object[] {"Beverage",10, 30,2});
dataSet1.Tables["Category"].Rows.Add(new Object[] {"Grocerie",20, 40,4});
dataSet1.Tables["Category"].Rows.Add(new Object[] { "Meat", 30, 50 ,1});
dataSet1.Tables["Category"].Rows.Add(new Object[] { "Vegetable", 5, 5,8 });
dataSet1.Tables["Category"].Rows.Add(new Object[] { "Fish", 5, 5 ,10});
return dataSet1;
}
How would I use this created dataset to fill a report built using the design view for the xtraReport object? I'd hate to have to hand code a report when you guys have built all thos nice tools to generate them.
Mike
Hi Mike,
I've attached a sample, illustrating how to accomplish this task by using the Mail Merge feature of XtraReport Suite.
Please review it and let us know the results.
Thanks,
Andrew
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.
Facebook
Twitter
Google+