Hello,
I need to be able to present a user with, say, a list of check boxes which represent individual reports. The user checks reports of interest and clicks "export" button. Then, in code behind, I need to be able to dynamically create the multiple selected reports and export each report into an individual Excel worksheet within a single workbook. The user is then prompted to save the workbook as a result of the browser detected content type.
I have seen an example of this export capability, but it was in conjunction with an existing Report Viewer control already on the page.
If this is not possible, I think my next solution might be to add Report Viewer control to page design time, then populate it with reports selected by user via the check boxes. Then, from Report Viewer export utility, create the multiple worksheet/single workbook file.
Thanks in advance for your time.
Jason
Hi,
I'm trying to add a panel programatically to a report. I have a class that programattically generates a bunch of controls, then puts them in a panel, then returns the panel as an array of ReportItemBase with length of 1.
When i do this it appears to put a page break in after each panel.
I've tried altering the class to return just the controls without the panel parent and it works fine.
This is a problem though, because the reason I'm using a panel to put them inside of, is that I need each set of controls to make sure they are on the same page.
Here's the method
I've got commented out code line around where i've changed things to make it work. I've also tried two methods to add the controls to the panel, one is using the parent property and the other using the items.addrange, both work, but both cause the page break after each panel.
Public Overrides Function RenderControlSet(Optional ByRef parent As Telerik.Reporting.Panel = Nothing) As Telerik.Reporting.ReportItemBase() 'MyBase.RenderControlSet() Dim questionDetail As DataTable = _questionDetail Dim question As DataRow = _question Dim cbl1 As ReportsCheckBoxList = New ReportsCheckBoxList Dim pnl As New Telerik.Reporting.Panel pnl.Top = New Drawing.Unit(StartTop, UnitType.Cm) pnl.KeepTogether = True pnl.StyleName = "stylePnl" 'pnl.Style.BorderColor= If Not parent Is Nothing Then pnl.Parent = parent End If Dim t1 As New Telerik.Reporting.TextBox Dim TextBoxWidth As Drawing.Unit = New Drawing.Unit(14 - LeftMargin, UnitType.Cm) Dim TextBoxHeight As Drawing.Unit = New Drawing.Unit(0.6, UnitType.Cm) t1.Width = TextBoxWidth t1.Height = TextBoxHeight t1.Value = question("questionText").ToString() t1.Top = New Drawing.Unit(0, UnitType.Cm) 't1.Top = New Drawing.Unit(StartTop, UnitType.Cm) t1.Left = New Drawing.Unit(LeftMargin, UnitType.Cm) t1.StyleName = "styleQuestion" 'pnl.Items.AddRange(New Telerik.Reporting.ReportItemBase() {t1}) t1.Parent = pnl ' When using the below and comment out the parent line above it works fine 'ReDim Preserve Controls(Controls.Length) 'Controls(Controls.Length - 1) = t1 ResultHeight += 0.6 ' CHECK BOX LIST FOR MULTIPLE OPTIONS cbl1.StartTop = 0.6 'StartTop + 0.6 cbl1.StartTop = StartTop + 0.6 cbl1.LeftMargin = LeftMargin If CInt(question("option1")) = 0 Then cbl1.RepeatColumns = 3 Else cbl1.RepeatColumns = CInt(question("option1")) End If cbl1.DataTextField = "displayText" cbl1.DataValueField = "questionDetailId" cbl1.DataSource = questionDetail cbl1.Width = TextBoxWidth.Value Dim trb() As Telerik.Reporting.ReportItemBase trb = cbl1.Render() ResultHeight += cbl1.ResultHeight Dim x As Integer For x = 0 To trb.Length - 1 'pnl.Items.AddRange(New Telerik.Reporting.ReportItemBase() {trb(x)}) trb(x).Parent = pnl ' When using the below and comment out the parent line above it works fine 'ReDim Preserve Controls(Controls.Length) 'Controls(Controls.Length - 1) = trb(x) Next pnl.Height = New Drawing.Unit(ResultHeight, UnitType.Cm) ReDim Preserve Controls(Controls.Length) Controls(Controls.Length - 1) = pnl Return Controls End Functiondetail.Items.AddRange(c.RenderControlSet())