Printing datagridview in a table
Hello,
I'm trying to print a DataGridView content in a TableObject and so far am failing.
Tried to use report.RegisterData with DataGridRow, but can't get cell content, like this:
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->table[colIndex, 1].Text = String.Format("[DataGridViewRow.Cells[{0}].Value]", someIndex)<!--fontc--></span><!--/fontc-->
at report.Prepare this code throws "error CS0120: An object reference is required for the nonstatic field, method, or property 'System.Windows.Forms.DataGridViewRow.Cells.get'"
Is there another way?
BTW, IMO you could add aliasing of datasource names when business-objects are used, currently, if I understand correctly,
DataSourceName MUST be be equal to the type name (and this is not stated clearly in the documentation)
Thanks,
Georgi
I'm trying to print a DataGridView content in a TableObject and so far am failing.
Tried to use report.RegisterData with DataGridRow, but can't get cell content, like this:
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->table[colIndex, 1].Text = String.Format("[DataGridViewRow.Cells[{0}].Value]", someIndex)<!--fontc--></span><!--/fontc-->
at report.Prepare this code throws "error CS0120: An object reference is required for the nonstatic field, method, or property 'System.Windows.Forms.DataGridViewRow.Cells.get'"
Is there another way?
BTW, IMO you could add aliasing of datasource names when business-objects are used, currently, if I understand correctly,
DataSourceName MUST be be equal to the type name (and this is not stated clearly in the documentation)
Thanks,
Georgi
Comments
You may register the DataTable (or any other datasource that you use in the DataGridView) in a report, then print this datasource. See the demo.exe, the "Table/Print DataTable" report.
No, you may use any name.
I finally managed to do that by copying grid rows into a List of objects of dynamically generated type.
Are there any plans on the roadmap to add Fillable Forms when exporting a PDF, or are there other solutions to add Fillable Forms to a PDF which are generated with Fast Report .NET?