Telerik Forums
Reporting Forum
2 answers
103 views
Hi there,

We have set up may reports that are all working fine but have an issue with formatting....

Each report has been formatted so that when data is output to 'grid' type layout - using the detail section - we place a border around each text box to provide a simple layout that clearly shows all lines and columns of the report.

The borders are set using the properties toolbar and not via code.

Everything works fine when we run it in Preview mode - all formatting is correct.

But when the report is viewed in HTML mode any empty text boxes that have no value have no formatting - so no borders at all.

I have tried adding a Conditional Formatting rule to the boxes but this does not work either.

Its a weird one as we have managed to create may reports but cannout publish them for clients as when there is no data in a box it applies no formatting and as such the report looks terrible.

Can you help?

Thanks in advance.
Geoff
Top achievements
Rank 1
 answered on 30 May 2011
7 answers
964 views

Hi,

I am trying to build a report programmatically without using the wizard. In this report am using parameter which also should be done programmatically according to my data, and through a query that also be added.

 

I tried this >> http://www.telerik.com/help/reporting/programmatic-creating-report.html

 

But I don’t know why am getting and empty report?!

 

Also the parameters and filter?!

 

Is there is any procedures behind that


this is a part of what i did, i might be missing something,, lemme know please?
Thanks in advance

Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Imports Telerik.Reporting
Imports Telerik.Reporting.Drawing
Imports System.Data.SqlClient
  
Partial Public Class Visitreport
    Inherits Telerik.Reporting.Report
    Public Sub New()
        InitializeComponent()
        Dim report As New Report()
        'Dim sql As String = "SELECT  "
        Dim sql As String = ""
        Dim connectionString As String = ""
        Dim adapter As New SqlDataAdapter(sql, connectionString)
        report.DataSource = adapter
        'creating item programatically 
        Dim detail As New DetailSection()
        Me.detail.Height = New Telerik.Reporting.Drawing.Unit(3, Telerik.Reporting.Drawing.UnitType.Inch)
        Me.detail.Name = "detail"
        report.Items.Add(DirectCast(detail, ReportItemBase))
  
        Dim panel1 As New Telerik.Reporting.Panel()
        Dim textBox1 As New Telerik.Reporting.TextBox()
  
        'panel1
  
  
        panel1.Location = New Telerik.Reporting.Drawing.PointU(New Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Cm), New Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Cm))
        panel1.Size = New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(8.5, Telerik.Reporting.Drawing.UnitType.Cm), New Telerik.Reporting.Drawing.Unit(3.5, Telerik.Reporting.Drawing.UnitType.Cm))
        panel1.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid
  
        'textBox1
  
  
        textBox1.Location = New Telerik.Reporting.Drawing.PointU(New Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Cm), New Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Cm))
        textBox1.Name = "NameDataTextBox"
        textBox1.Size = New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(5, Telerik.Reporting.Drawing.UnitType.Cm), New Telerik.Reporting.Drawing.Unit(0.6, Telerik.Reporting.Drawing.UnitType.Cm))
        textBox1.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid
        textBox1.StyleName = "Data"
        textBox1.Value = "=Fields.AssignTo"
  
        panel1.Items.AddRange(New Telerik.Reporting.ReportItemBase() {textBox1})
        detail.Items.AddRange(New Telerik.Reporting.ReportItemBase() {panel1})
  
        Dim reportParameter1 As New Telerik.Reporting.ReportParameter()
        reportParameter1.Name = "Parameter1"
        reportParameter1.Text = "Enter Value for Parameter1"
        reportParameter1.Type = Telerik.Reporting.ReportParameterType.Integer
        reportParameter1.AllowBlank = False
        reportParameter1.AllowNull = False
        reportParameter1.Value = "=10"
        reportParameter1.Visible = True
        report.ReportParameters.Add(reportParameter1)
        reportParameter1.AvailableValues.DataSource = adapter
        reportParameter1.AvailableValues.ValueMember = "= Fields.AssignTo"
        reportParameter1.AvailableValues.DisplayMember = "= Fields.AssignTo"
        Dim filter1 As New Telerik.Reporting.Data.Filter()
        filter1.Expression = "=Fields.AssignTo"
        filter1.Operator = Telerik.Reporting.Data.FilterOperator.Equal
        filter1.Value = "=Parameters.AssignTo"
        reportParameter1.AvailableValues.Filters.AddRange(New Telerik.Reporting.Data.Filter() {filter1})
        Dim sorting1 As New Telerik.Reporting.Data.Sorting()
        sorting1.Expression = "=Fields.AssignTo"
        sorting1.Direction = Telerik.Reporting.Data.SortDirection.Asc
        reportParameter1.AvailableValues.Sortings.AddRange(New Telerik.Reporting.Data.Sorting() {sorting1})
  
  
        '   report.ReportParameters("AssignTo").Value = ""
  
    End Sub
  
    Private Sub detail_ItemDataBound(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles detail.ItemDataBound
        'Take the Telerik.Reporting.Processing.Report instance
        'Dim report As Telerik.Reporting.Processing.Report = DirectCast(sender, Telerik.Reporting.Processing.Report)
  
        ' Transfer the value of the processing instance of ReportParameter
        ' to the parameter value of the sqlDataSource component
        '   Me.SqlDataSource1.Parameters(0).Value = report.Parameters("AssignTo").Value
  
        ' Set the SqlDataSource component as it's DataSource
        report.DataSource = Me.SqlDataSource1
  
    End Sub
End Class
veena
Top achievements
Rank 1
 answered on 29 May 2011
2 answers
792 views

Hi,,..

I had added a parameter, however am not able to build the datasourse object

 

I do not want to use the sqldatasourse control, so how can I build it to get the data from the parameter I create.

How to bind the data to it

 

I use this code to build the parameter



Dim reportParameter1 As New Telerik.Reporting.ReportParameter()
        reportParameter1.Name = "Parameter1"
        reportParameter1.Text = "Category"
        reportParameter1.Type = Telerik.Reporting.ReportParameterType.String
        reportParameter1.AllowBlank = False
        reportParameter1.AllowNull = False
        reportParameter1.Value = "= Fields.Category"
        reportParameter1.Visible = True
        Report.ReportParameters.Add(reportParameter1)
  
reportParameter1.AvailableValues.DataSource = objectDataSource1
        reportParameter1.AvailableValues.ValueMember = "= Fields.Category"
        reportParameter1.AvailableValues.DisplayMember = "= Fields.Category"

Furthermore, I wanna bind this parameter to a objectdatasourse,,so I found this code but I could not use it


Public Sub HowToObjectDataSourceParameters()
    Dim objectDataSource1 As New Telerik.Reporting.ObjectDataSource()
    objectDataSource1.DataMember = "GetCars"
    objectDataSource1.DataSource = GetType(Cars)
    objectDataSource1.Parameters.Add(New Telerik.Reporting.ObjectDataSourceParameter("year", GetType(Integer), 2010))
    objectDataSource1.Parameters.Add(New Telerik.Reporting.ObjectDataSourceParameter("color", GetType(String), "=Parameters.Color"))
End Sub

objectDataSource1.DataSource = GetType(Cars)<>>>> what is Cars? <<>>what do they mean by this type,, i did not get it.

Thanks in advance
Anoop
Top achievements
Rank 1
 answered on 29 May 2011
4 answers
141 views
I have a SQLDataSource that produces three columns:AccountNumber, Date, Amount.  I want to databind a LineChart to have the AccountNumber drive the series, PostDate on XAxis and Amount on YAxis.  I'm part way there.  I have the DataGroupColumn set to AccountNumber so when I run the report a line generates for each AccountNumber.  The amount shows on the YAxis but I am getting 1,2,3,4,5 on the XAxis.  How do I get my date values to show on the XAxis?  I tried usagechart.PlotArea.XAxis.DataLabelsColumn = "PostDate" but thats not doing anything.  Can I format my data values to not show cents?  Do I have to do that in the NeedDatasource or can I do it from the designer?
MikeWiese
Top achievements
Rank 1
 answered on 28 May 2011
2 answers
184 views
Hi,

I have a Telerik report that I preview in a web page with a standard telerik:ReportViewer.

Within code of the report viewer page I would like to read data from textboxes on the report being previewed (or from the datasource of the report if that is easier).  I have tried getting a reference to the report and then the report section and then the textbox, but all I get
back from the textbox.value is the formula of the value property (eg "=Fields.assessment_id") not the actual data.

Is what I am trying to do possible?

Could anyone send me a snippet (VB if possible) to get me going, or point me in the direction of an article that discusses this topic?

Thanks in advance.

Mike
Mike Sorel
Top achievements
Rank 1
 answered on 28 May 2011
1 answer
61 views
Just lost half a day debugging a "Null reference" exception inside the ReportService. The strange thing is that in case of a disable Session State a null reference exception is fired. I can understand that it might be required, but I can't find this in the documentation. Besides the missing documentation I'd have liked a proper exception.

Hope a change in both documentation and library will happen to help others.

-
Mark Monster
Peter
Telerik team
 answered on 27 May 2011
17 answers
444 views
Hi,

I have a requirement where in the report I need to dynamically generate textboxes with navigate to url actions based on the data bound to it. I'm connecting to a sqldatasource.

I tried the following. Placed a Panel in the cell. Hooked up to the ItemDataBound event. But I'm not able to reach to that particular field in the DataObject. If I can get to it I can generate TextBoxes on the fly and add to the panel. Is this possible to do?

Cheers,
Ganesh
Steve
Telerik team
 answered on 27 May 2011
1 answer
67 views

Telerik.Reporting.Processing.Table tblCrosstab = (Telerik.Reporting.Processing.Table)sender;
FairDataList = null;
 
var tbl_EEEEE_STUDENT_ID = tblCrosstab.DataObject["EEEEE_STUDENT_ID"];
 
if (strEEEEE_STUDENT_ID != null)
{
    if (_objCrosstab != null)
    {
        if (tbl_EEEEE_STUDENT_ID!= null && tbl_EEEEE_STUDENT_ID.ToString() == strEEEEE_STUDENT_ID)
        {
            FairDataList = _objCrosstab.GetFAIRDataDetailK2_1(this.ReportParameters["SchoolYear"].Value.ToString(),
                                                            this.ReportParameters["District"].Value.ToString(),
                                                            this.ReportParameters["School"].Value.ToString(),
                                                            this.ReportParameters["Grade"].Value.ToString(),
                                                           strEEEEE_STUDENT_ID);
 
 
            if (FairDataList.Count > 0)
            {
                if (tblCrosstab.DataSource == null)
                {
 
                    tblCrosstab.DataSource = FairDataList;
                }
 
            }
        }
    }
}
Peter
Telerik team
 answered on 27 May 2011
3 answers
230 views
I'm trying to render a report in HTML format and use the result stream in a aspx page using a Literal or Text control. My problem is that the rendered result contains tags that are causing the output to break, like <html>, <body>, <head>, etc. I just need the html code that's inside the <body> tag.
I will also like the option to strip all styling from the output and get the raw html without styles.

Thank you.
Steve
Telerik team
 answered on 27 May 2011
1 answer
134 views
Good Day

i am using the telerik Report , i am trying to load the Report on page load in Silverlight. this used to work perfectly in a Silverlight Page, now i am using  the report in a SilverlightChild Window and whenever my code reaches this pl
var layoutRoot = (FrameworkElement)VisualTreeHelper.GetChild(reportViewer, 0);

it fails with the Error

Specified argument was out of the range of valid values. Parameter name: childIndex


so to make sure that it does not find the elements i used the code like this

if (VisualTreeHelper.GetChildrenCount(reportViewer) > 0)
            {
                var layoutRoot = (FrameworkElement)VisualTreeHelper.GetChild(reportViewer, 0);
                var viewerModel = (ReportViewerModel)layoutRoot.DataContext;
                var refreshCommand = viewerModel.RefreshReportCommand;
                if (refreshCommand.CanExecute(null))
                {
                    refreshCommand.Execute(null);
                }
            }


I see it does not find an element.

Thanks
Steve
Telerik team
 answered on 27 May 2011
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?