Dynamic Columns
Dynamic Columns
Hello,
I am trying to adapt the printtable example, to integrate this in the events of a report. I want to have multiple objects on a page, including a databand which shows all columns of a (dynamic) datatable. I am trying to set this code in the databand/page/report beginrenderevent, and it creates the textboxes but no data is shown. Do I need another event, or what am I doing wrong?
Secondly, can the pagewidth be dynamicly be adjusted to the widht of this databand (with multiple columns)?
Thanks
Paul
dim i as integer
for i = 0 to DataTable.Columns.Count - 1
Dim DataText As New StiText(New RectangleD(i, 0, 10, 0.5))
DataText.Text.Value = "{DataTable." & DataTable.Columns(i).Name & "}"
DataText.Name = "DataText" & i
DataText.Border.Side = StiBorderSides.All
Databand1.Components.Add(DataText)
next
I am trying to adapt the printtable example, to integrate this in the events of a report. I want to have multiple objects on a page, including a databand which shows all columns of a (dynamic) datatable. I am trying to set this code in the databand/page/report beginrenderevent, and it creates the textboxes but no data is shown. Do I need another event, or what am I doing wrong?
Secondly, can the pagewidth be dynamicly be adjusted to the widht of this databand (with multiple columns)?
Thanks
Paul
dim i as integer
for i = 0 to DataTable.Columns.Count - 1
Dim DataText As New StiText(New RectangleD(i, 0, 10, 0.5))
DataText.Text.Value = "{DataTable." & DataTable.Columns(i).Name & "}"
DataText.Name = "DataText" & i
DataText.Border.Side = StiBorderSides.All
Databand1.Components.Add(DataText)
next
Re: Dynamic Columns
Hello.
Sorry, maybe we don't understand your task.
Could you describe your task with multiple objects more detailed with samples?
As about page width, you could set the Segment per Width property of the page. The segment with page width will be added.
Thank you.
Sorry, maybe we don't understand your task.
Could you describe your task with multiple objects more detailed with samples?
As about page width, you could set the Segment per Width property of the page. The segment with page width will be added.
Thank you.
Re: Dynamic Columns
On a part of the report (on a page) I want to report the content of a table, including all fields. This table is dynamic and therefore I must have multiple columns. On the first page of this report, certain statistics must be shown, this is not a dynamic page.
I am trying to adept the columns of the databand in which I want to display these records and fields, by using the beginrenderevent.
Thanks
Paul
I am trying to adept the columns of the databand in which I want to display these records and fields, by using the beginrenderevent.
Thanks
Paul
Re: Dynamic Columns
I have managed to get this working, by adding a addhandler, and using reflection to get dynamicly to the properties of the datatable (and to the fieldinformation).
Thanks
Paul
Thanks
Paul
Re: Dynamic Columns
Hello.
Did you try to create the report dynamically in code? Here is a sample. Also you could look at the Selecting Columns demo report in Dialogs section of our Demo.
Thank you.
Did you try to create the report dynamically in code? Here is a sample. Also you could look at the Selecting Columns demo report in Dialogs section of our Demo.
Thank you.
Re: Dynamic Columns
No, I used the beginrenderevent event to add code, for the creation of the fields, and adding a addhandler. The addhandler calls a function which I added in the code part of the report, getting the content of the fields. This is done using reflection, to get the content of the properties of a datasource.
All working.
Thanks
Paul
All working.
Thanks
Paul
Re: Dynamic Columns
Hello, Paul.
Good. Let us know if you need additional help.
Thank you.
Good. Let us know if you need additional help.
Thank you.
Re: Dynamic Columns
I believe I am trying to do the same thing.
I have a user supplied boolean parameter p_boolPrintProfit.
If it is TRUE, the PROFIT column should display.
If it is FALSE, the "PROFIT" column should not display.

It it solves my issue, I will post back.
I have a user supplied boolean parameter p_boolPrintProfit.
If it is TRUE, the PROFIT column should display.
If it is FALSE, the "PROFIT" column should not display.

I've downloaded this example to take a look at it.HighAley wrote:Hello.
Did you try to create the report dynamically in code? Here is a sample. Also you could look at the Selecting Columns demo report in Dialogs section of our Demo.
Thank you.
It it solves my issue, I will post back.
~Joe
Re: Dynamic Columns
Hello.
The sample shows how to create a report template in code dynamically.
If you need to hide the component in the report, you could use the Conditions and disable there Component is Enabled option.
Thank you.
The sample shows how to create a report template in code dynamically.
If you need to hide the component in the report, you could use the Conditions and disable there Component is Enabled option.
Thank you.
Re: Dynamic Columns
Thanks!
I followed this up with my own question, to stop hi-jacking this thread.
How to set Report Variable from Visual Studio code?
I followed this up with my own question, to stop hi-jacking this thread.
How to set Report Variable from Visual Studio code?
~Joe