Telerik Forums
Reporting Forum
1 answer
143 views

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 Function


It's used like this in the VB code else where:

detail.Items.AddRange(c.RenderControlSet())



Where detail is the details section of the report.

I am using verison 4.0.10.423 of the Telerik.Report.dll

Thanks,

Joel
Ticket Solutions Account
Top achievements
Rank 1
 answered on 14 Aug 2010
5 answers
525 views
I've built a report based on a query which does have the OVER statement in it.  When I originally used the wizard to build this report, it worked great.  I then went back into my .xsd file to "Configure..." this query, and all of a sudden I'm getting this error.  I've been working with this report for a day now (successfully; giving me my desired results), but I can't edit it?  Anyone have any suggestions aside from starting from scratch again (I have it looking the way I want, but I just need to change one line of code in my where statement)??
Carrie
Top achievements
Rank 1
 answered on 13 Aug 2010
1 answer
165 views
I have a report with a requirement of .675in for the top margin and .275 in for the other margins. I have the snapgrid set to .05inches.  I have a report that I'm printing I'm having a problem with the top margin when I'm printed out the report.  I am trying to match a report that was previously generated in another vendor program.  The left margin is matches the old report but the top margin is wider by about a 1/16 of an inch. which pushes everything down on the page.

Are there any issues with my diminsions?  When I look in the InitializeComponent the margins have the correct values.

Thanks,
Robert
Steve
Telerik team
 answered on 13 Aug 2010
1 answer
294 views
Hello,

 Does anybody know how to get rid of the extra blank pages that occurs when you generate a PDF report? Ive been trying to figure out how to keep the document a single page document. It generates the page header and page footer twice even though it is only a 1 page document. Thank you for the help in advance.

Thanks,

john
Steve
Telerik team
 answered on 13 Aug 2010
2 answers
310 views
Can some explain why my ReportViewer Height is not changing according the heigt of my RadWindow?

When I change the horizontal size the reportviewer changes as it should be. When I change my vertical heigt then it doesn't change?

Header="Report window" WindowStartupLocation="CenterScreen" Top="-5" Width="550" Height="539" ResizeMode="CanResize">
    <Grid x:Name="LayoutRoot" VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <!--<RowDefinition Height="478"/>-->
            <RowDefinition Height="*"/>
            <RowDefinition Height="27"/>
        </Grid.RowDefinitions>
  
        <Telerik_ReportViewer_Silverlight:ReportViewer x:Name="ReportViewer" HorizontalAlignment="Stretch" VerticalContentAlignment="Stretch" Height="475" Grid.Row="0" ReportServerUri="../ReportService.svc" 
            Report="GaSuiteReportLib.EmergencyReport, GaSuiteReportLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"  ZoomPercent="80" VerticalAlignment="Top"/>
          
        <Button x:Name="OKButton" Grid.Row="1" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,0,3"/>
          
    </Grid>

For some reason the ReportViewer height of 475 stays. I have also changed this into * etc. but that won't help me?
Gilbert van Veen
Top achievements
Rank 1
 answered on 13 Aug 2010
2 answers
167 views
Hello,

is it possible to add custom buttons to the toolbar to execute custom commands (eg. close ReportVewer)?
I saw that the viewer has some styles included. How can I create my one style?

Thanks,
Manuel
Manuel
Top achievements
Rank 1
 answered on 13 Aug 2010
1 answer
100 views
Hi,
I have created a report with StackedSpline chart. The report should display the chart for each device with its parameter values(Y-Axis) vs DateTime(X-Axis). Following the code snippet of the report.

namespace Reports
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using Telerik.Reporting;
    using Telerik.Reporting.Drawing;
 
    /// <summary>
    /// Summary description for Report2.
    /// </summary>
    public partial class Report2 : Telerik.Reporting.Report
    {
        public Report2()
        {
            /// <summary>
            /// Required for telerik Reporting designer support
            /// </summary>
            InitializeComponent();
 
            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            this.reportTableAdapter1.Fill(this.temp1.report);
        }
 
        private void chart1_NeedDataSource(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.Chart procChart = (Telerik.Reporting.Processing.Chart)sender;
            procChart.DataSource = this.temp1;
 
            chart1.Series[0].DataYColumn = "ParamValue";
            chart1.PlotArea.XAxis.DataLabelsColumn = "timeDate";
            chart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 300;
            chart1.PlotArea.Appearance.Dimensions.Margins.Bottom = Telerik.Reporting.Charting.Styles.Unit.Percentage(30);
            chart1.PlotArea.Appearance.Dimensions.Margins.Right = Telerik.Reporting.Charting.Styles.Unit.Percentage(30);
        }
 
        
    }
}

The chart is plotting the values in one line for all the parameters. But I want to display the parameter values in different line for each parameter name.

My database table looks like this,

DateTimeStamp Parameter_Name ParamValue DeviceID
7:03:58 PM PM_PH_A_ABC 125 129
7:03:59 PM PM_PH_A_ABC 125 129
7:04:00 PM PM_PH_A_ABC 25 129
7:04:01 PM PM_PH_A_ABC 125 129
7:03:58 PM PM_XYZ 125 129
7:03:59 PM PM_XYZ 125 129
7:04:00 PM PM_XYZ 5 129
7:04:01 PM PM_XYZ 50 129
7:03:58 PM PM_PH_A_ABC 100 133
7:03:59 PM PM_PH_A_ABC 25 133
7:04:00 PM PM_PH_A_ABC 8 133
7:03:58 PM PM_XYZ 125 133
7:03:59 PM PM_XYZ 15 133
7:04:00 PM PM_XYZ 7 133

From the above table I need to show two lines(PM_PH_A_ABC, PM_XYZ) in the graph.

In my report I am getting one line for the two parameters. Please refer the attached output of my report

Can anyone please help me how to plot lines for each parameters(the parameters are dynamic) in the StackedSpline chart.

Thanks in advance.

Regards,
Manoj
Steve
Telerik team
 answered on 13 Aug 2010
1 answer
167 views
Dear All,

I am using telerik report in mvc 2.0,I am getting report but report toolbar is not clear.
Chavdar
Telerik team
 answered on 13 Aug 2010
1 answer
133 views
I have a report with two groups.  In this report, only the lower-level group footer is displayed, detail lines and the higher-level group footer lines are hidden.  In the footer that is displayed is a link to another report with the field values from the group footer used as parameters to the other report.  Although I am using the Last() aggregate function on both the fields displayed on the group footer and in the report parameters of the link, one of the parameter values I am passing is getting lost when it gets to the routine specified in the other report's data source even though it is displayed correctly in the footer itself.

Does anyone have any suggestions?

Thanks,

Lee Sauer
Milen | Product Manager @DX
Telerik team
 answered on 12 Aug 2010
5 answers
418 views
Is it possible to style report parameters section.

I want to put some labels on there  and plus change backgroud of dropdown lists ,also  to play with the width  and height of parameters entry textbox/dropdownlist ?

Thanks in advance

Regards

Milen | Product Manager @DX
Telerik team
 answered on 12 Aug 2010
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?