This is a migrated thread and some comments may be shown as answers.

Need Help with PictureBox in Web / PDF

1 Answer 66 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
briankb
Top achievements
Rank 2
briankb asked on 02 May 2008, 09:00 AM
I'm trying to get a Picturebox working but nothing seems to work.

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
        Dim report As New Telerik.Reporting.Report() 
        Dim detail As New Telerik.Reporting.DetailSection() 
        Dim textBox2 As New Telerik.Reporting.TextBox() 
 
        Dim border As New Telerik.Reporting.PictureBox() 
        border.Value = "Border_Landscape.gif" 
        border.Width = New Telerik.Reporting.Drawing.Unit(2, Telerik.Reporting.Drawing.UnitType.Inch) 
        border.Height = New Telerik.Reporting.Drawing.Unit(2, Telerik.Reporting.Drawing.UnitType.Inch) 
        border.Location = New Telerik.Reporting.Drawing.PointU(New Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Inch), New Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Inch)) 
 
        textBox2.Location = New Telerik.Reporting.Drawing.PointU(New Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch), New Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch)) 
        textBox2.Value = "Hello World!" 
        textBox2.Location = New Telerik.Reporting.Drawing.PointU(New Telerik.Reporting.Drawing.Unit(1.25, Telerik.Reporting.Drawing.UnitType.Inch), New Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch)) 
        textBox2.Size = New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(4.75, Telerik.Reporting.Drawing.UnitType.Inch), New Telerik.Reporting.Drawing.Unit(0.25, Telerik.Reporting.Drawing.UnitType.Inch)) 
        detail.Items.AddRange(New Telerik.Reporting.ReportItemBase() {textBox2}) 
        detail.Height = New Telerik.Reporting.Drawing.Unit(0.3, Telerik.Reporting.Drawing.UnitType.Inch) 
 
        report.Items.Add(DirectCast(detail, Telerik.Reporting.ReportItemBase)) 
 
        ReportViewer1.Report = report 
        'ExportToPDF("Test", report) 
    End Sub 

What am I doing wrong?

1 Answer, 1 is accepted

Sort by
0
Chavdar
Telerik team
answered on 02 May 2008, 12:33 PM
Hello Briankb,

It seems that there is a small glich in the code which you have sent. In the Items collection you add only the textBox2 item. I think you have to add the picturebox item as well. So instead of

        detail.Items.AddRange(New Telerik.Reporting.ReportItemBase() {textBox2}) 
,
        detail.Items.AddRange(New Telerik.Reporting.ReportItemBase() {textBox2, border}) 

should fix the problem.


Greetings,
Chavdar
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
briankb
Top achievements
Rank 2
Answers by
Chavdar
Telerik team
Share this question
or