
Christopher Bishop
Top achievements
Rank 2
Christopher Bishop
asked on 02 Jun 2009, 01:49 PM
Ok not sure if the documentation is not clear and/or I am losing my mind over here...
I have a problem where I cannot just bind to a datasource but have to actually add rows to the report on the fly, I have tried everything I can think of, Dim textBox1 As New Telerik.Reporting.TextBox(), details.items.add(textBox1) etc... but they all add as columns "NOT" rows. So something as simple as below does not work...
I have tried, tables, panels etc. all having the same problem. What am I missing I just want to be able to add dynamic data (without a datasource) and have it go "DOWN" the page not "ACROSS" pretty simple but there is no documentation that I could find that talks about adding simple data without a datasource to your report etc.
Yes the report is built dynamicly and in this one area there is no way I am going to reshape the data and fill another dataset just to assign it. it is a little to complicated and way to much overhead for doing something like that. I am just hoping that is not my only option as that would be silly.
Thanks in advance.
I have a problem where I cannot just bind to a datasource but have to actually add rows to the report on the fly, I have tried everything I can think of, Dim textBox1 As New Telerik.Reporting.TextBox(), details.items.add(textBox1) etc... but they all add as columns "NOT" rows. So something as simple as below does not work...
Do While i < 5 | |
textBox1 = New Telerik.Reporting.TextBox | |
textBox1.Value = "Data Item: " & i | |
detail.Items.Add(textBox1) | |
i = i + 1 | |
Loop | |
I have tried, tables, panels etc. all having the same problem. What am I missing I just want to be able to add dynamic data (without a datasource) and have it go "DOWN" the page not "ACROSS" pretty simple but there is no documentation that I could find that talks about adding simple data without a datasource to your report etc.
Yes the report is built dynamicly and in this one area there is no way I am going to reshape the data and fill another dataset just to assign it. it is a little to complicated and way to much overhead for doing something like that. I am just hoping that is not my only option as that would be silly.
Thanks in advance.
7 Answers, 1 is accepted
0
Hello Christopher,
Should we assume that you set Height, Width and Location for these dynamically created items, as you should? If not they would be overlapped and rendered as a single one. If you're referring to multicolumn reports, making columns appear Across-then-Down is currently not possible.
Regards,
Steve
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Should we assume that you set Height, Width and Location for these dynamically created items, as you should? If not they would be overlapped and rendered as a single one. If you're referring to multicolumn reports, making columns appear Across-then-Down is currently not possible.
Regards,
Steve
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0

Christopher Bishop
Top achievements
Rank 2
answered on 02 Jun 2009, 03:07 PM
Yeppers, (height, width etc.) All set the problem is if you look at the code it is pretty simple create a textbox X times and add it to the details section... I understand that by doing that it is creating columns for the most part and yes they go left to right etc. but what I need to do is add rows not columns... I have tried hooking up the table but cannot get it to display anything using datasource= and/or needsdatasource etc.
Here is what I am trying to do...
Category
ItemCaption | ItemCaption | ItemCaption | ItemCaption Category Roll Up Values
1: Data | Data | Data | Data CatData1 | CatData2
2: Data | Data | Data | Data
3: Data | Data | Data | Data
ItemCaption | ItemCaption | ItemCaption | ItemCaption
4: Data | Data | Data | Data
5: Data | Data | Data | Data
6: Data | Data | Data | Data
Category
ItemCaption | ItemCaption | ItemCaption | ItemCaption Category Roll Up Values
7: Data | Data | Data | Data CatData1 | CatData2
8: Data | Data | Data | Data
9: Data | Data | Data | Data
This repeats for X amounts of categories, I have to build the report dynamicly from the server because there is no standard template that I can get away with... I don't care if I have to use a table or any other means to get the "Category Roll Up Values" going on but they only display "once" per category and are based on the underlying row data (not unlike a summary footer in the grid)...
If you can explain how I can make that table (or using any other object) then I should be fine...
Am I making a little more sense I just got cafe so will be a little more aware as the day goes on lol...
Here is what I am trying to do...
Category
ItemCaption | ItemCaption | ItemCaption | ItemCaption Category Roll Up Values
1: Data | Data | Data | Data CatData1 | CatData2
2: Data | Data | Data | Data
3: Data | Data | Data | Data
ItemCaption | ItemCaption | ItemCaption | ItemCaption
4: Data | Data | Data | Data
5: Data | Data | Data | Data
6: Data | Data | Data | Data
Category
ItemCaption | ItemCaption | ItemCaption | ItemCaption Category Roll Up Values
7: Data | Data | Data | Data CatData1 | CatData2
8: Data | Data | Data | Data
9: Data | Data | Data | Data
This repeats for X amounts of categories, I have to build the report dynamicly from the server because there is no standard template that I can get away with... I don't care if I have to use a table or any other means to get the "Category Roll Up Values" going on but they only display "once" per category and are based on the underlying row data (not unlike a summary footer in the grid)...
If you can explain how I can make that table (or using any other object) then I should be fine...
Am I making a little more sense I just got cafe so will be a little more aware as the day goes on lol...
0

Christopher Bishop
Top achievements
Rank 2
answered on 03 Jun 2009, 03:04 PM
So is this layout to hard to do dynamicly or is it something that will require an actual report (at least for this section) and then just do the whole include report stuff?
0
Hi Christopher,
Creating a report programmatically requires some extra work. The easiest way to learn how to do this is looking at the code of the InitializeComponet() method of the report, created by the designer. Feel free to check the code of our examples as well. In case you have further questions, feel free to ask them.
For your convenience we have prepared a simple WinForms project that demonstrates how to place textboxes in columns with small modification of your code snippet.
We would nevertheless like to stress that setting Size and Location properties of the textboxes is obligatory. If all textboxes are with Size.Width=0, Size.Height=0, Location.X=0 and Location.Y=0, and you try to export the report in pdf, for example, you won't see anything at all.
The definition of the report is similar to the definition of a windows form, where Size and Location is obligatory.
All the best,
Hrisi
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Creating a report programmatically requires some extra work. The easiest way to learn how to do this is looking at the code of the InitializeComponet() method of the report, created by the designer. Feel free to check the code of our examples as well. In case you have further questions, feel free to ask them.
For your convenience we have prepared a simple WinForms project that demonstrates how to place textboxes in columns with small modification of your code snippet.
We would nevertheless like to stress that setting Size and Location properties of the textboxes is obligatory. If all textboxes are with Size.Width=0, Size.Height=0, Location.X=0 and Location.Y=0, and you try to export the report in pdf, for example, you won't see anything at all.
The definition of the report is similar to the definition of a windows form, where Size and Location is obligatory.
All the best,
Hrisi
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0

Christopher Bishop
Top achievements
Rank 2
answered on 04 Jun 2009, 02:28 PM
That works fine and see what the problem is, I was assuming that Location was relative to its row so I was always setting it to 0...
With the exception of this solution not working with wordwraping... it is exactly what I need, canGrow/canShrink don't seem to work in this scenario? Is there a way for me to tell how many lines are in a text box? returning "height" doesn't show the actual size just the one I set it to during the .Size.
I can obviously say X amount of Characters can fit in this area and therefore Lines * 0.2 etc. to change the height in the process... Not a big deal either way just thought if there was some kind of "linecount" for a textbox that would be dandy...
Thanks for pointing out the Y = (0.2 * i) had to slap myself in the head.
With the exception of this solution not working with wordwraping... it is exactly what I need, canGrow/canShrink don't seem to work in this scenario? Is there a way for me to tell how many lines are in a text box? returning "height" doesn't show the actual size just the one I set it to during the .Size.
I can obviously say X amount of Characters can fit in this area and therefore Lines * 0.2 etc. to change the height in the process... Not a big deal either way just thought if there was some kind of "linecount" for a textbox that would be dandy...
Thanks for pointing out the Y = (0.2 * i) had to slap myself in the head.
0
Hi Christopher,
We're glad that our sample and explanation helped. As for your new inquiry - it is not possible to check how many lines are in a textbox. Report items cannot be looked at as raw lines and if you need to make such a checks, then you probably do not need our software.
CanShrink would only work, when there is nothing on the right hand side of the item it is supposed to shrink. This feature is explained in details in this help article.
Best wishes,
Steve
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
We're glad that our sample and explanation helped. As for your new inquiry - it is not possible to check how many lines are in a textbox. Report items cannot be looked at as raw lines and if you need to make such a checks, then you probably do not need our software.
CanShrink would only work, when there is nothing on the right hand side of the item it is supposed to shrink. This feature is explained in details in this help article.
Best wishes,
Steve
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0

Christopher Bishop
Top achievements
Rank 2
answered on 04 Jun 2009, 02:59 PM
Yeah I figured as much because in order to determine sections and page breaks you need some fixed stuff going on... It isn't a big deal as that is the only dynamic area the rest is on a datasource.
Thanks for the help on this btw as I have been a little foggy with 18hr days. Helped out a lot.
Thanks for the help on this btw as I have been a little foggy with 18hr days. Helped out a lot.