I am trying to use Telerik report in my application. I created a class library called ReportLib and refer it in my application using Add reference. My doubt is whether we are creating that Telerik report inside this class library or in our application. Anyway i tried both and then in one aspx page I drag report viewer and on that page load i gave like this
Dim report As EventList = New EventList()
report.DataSource = ds
ReportViewer1.Report = report
This ds is having the values which is retreiving from the stored procedure. can anyone tell what I am doing is correct or not?
Regards,
Jincy
11 Answers, 1 is accepted

I got the solution to my problem.I created the report using code only. Now I am getting the report. Now my issue is how can I set the headers for each columns through code.
Jincy
It is not clear from your post how exactly you create your report and what headers do you want to create. Our suggestion would be to create a reporting class library and play with it in design time to setup the header/footer sections. Then review how is the report and its controls instantiated in the InitializeComponent() method. We suggest you to review the following articles:
and the whole "programmatic control of reports" section.
Best wishes,
Steve
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

I can't create the report in design time using report wizard because I want the data to come from stored procedure, so I am filling the dataset and trying to create it programmatically. I refer this http://www.telerik.com/help/reporting/?DesigningReportsUnderstandingReportSections.html and create the report like this only without creating the class library. The problem is I want a heading for each column of data.For example: If you look at this link you can see two columns are created one for CustomerId and other Name, so I need to create headings for CustomerId And Name.How can it be possible? I hope now my problem is clear for me.
Regards,
Jincy
Stored procedures have nothing to do with generating headers for your report. You can fill a dataset from datatable directly or from storedprocedure - the result will be the same as far as reporting is concerned. The link you are referring contains info about report section and not programmatic creation and your other link is missing. Find attached three screenshots from design time generated report that show the report and page header and where each is used.
If still having any doubts, it would be best to provide more info or a sample report we can look into.
Thank you for the cooperation and understanding on the matter.
Greetings,
Steve
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

I will give the code I am using to create the report.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim report As New Report()
Dim detail As New DetailSection()
Dim ds As New DataSet
Dim textBox2 As New Telerik.Reporting.TextBox()
Dim textBox3 As New Telerik.Reporting.TextBox()
Dim textBox4 As New Telerik.Reporting.TextBox()
Dim textBox5 As New Telerik.Reporting.TextBox()
Dim pictureBox1 As New Telerik.Reporting.PictureBox()
ds = Session("ds")
textBox1.Value = "=StartDate"
textBox1.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))textBox1.Size = New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(1, Telerik.Reporting.Drawing.UnitType.Inch), New Telerik.Reporting.Drawing.Unit(0.25, Telerik.Reporting.Drawing.UnitType.Inch))textBox2.Value = "=Duration"
textBox2.Location = New Telerik.Reporting.Drawing.PointU(New Telerik.Reporting.Drawing.Unit(1, 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(1.75, Telerik.Reporting.Drawing.UnitType.Inch), New Telerik.Reporting.Drawing.Unit(0.25, Telerik.Reporting.Drawing.UnitType.Inch))textBox3.Value = "=ProjectHostName"
textBox3.Location = New Telerik.Reporting.Drawing.PointU(New Telerik.Reporting.Drawing.Unit(2, Telerik.Reporting.Drawing.UnitType.Inch), New Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch))textBox3.Size = New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(2.5, Telerik.Reporting.Drawing.UnitType.Inch), New Telerik.Reporting.Drawing.Unit(0.25, Telerik.Reporting.Drawing.UnitType.Inch))textBox4.Value = "=ProjectTitle"
textBox4.Location = New Telerik.Reporting.Drawing.PointU(New Telerik.Reporting.Drawing.Unit(3, Telerik.Reporting.Drawing.UnitType.Inch), New Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch))textBox4.Size = New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(4.5, Telerik.Reporting.Drawing.UnitType.Inch), New Telerik.Reporting.Drawing.Unit(0.25, Telerik.Reporting.Drawing.UnitType.Inch))detail.Items.AddRange(New Telerik.Reporting.ReportItemBase() {textBox1, textBox2, textBox3, textBox4})
detail.Height = New Telerik.Reporting.Drawing.Unit(0.3, Telerik.Reporting.Drawing.UnitType.Inch)
report.DataSource = ds
report.Items.Add(DirectCast(detail, ReportItemBase))ReportViewer1.Report = report
End Sub
No can you help me in creating the report header? And one more problem is here I want to show some images of those urls are saved in database only.
Regards,
Jincy
I have attached a sample solution which includes a class library with a report and a web site with a report viewer which shows it. The data set is created programmatically and you can change the code so that it is filled by a stored procedure. To see how to create headers (in this case it is a page header) programmatically you can refer to Report1.designer.vb and take the corresponding lines. If you prefer you can also use the Report designer to make any modifications to the report layout.
Hope this helps.
Best wishes,
Chavdar
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Now my problem of displaying headers is solved.Now I am having another doubt.I am using picturebox reportitem for displaying images.My doubt is will it be possible to show the images if the full url is saved in database only.In my case only part of the url will be coming from database.How can I display the image in that case?
Regards,
Jincy
You can use expressions for the Value property of the PictureBox item in which to concatenate the constant part of the url with the variable part. For example:
Me.PictureBox1.Value = "=""http://www.telerik.com/images/Homepage/""+Fields.ImageUrl"
The ImageUrl column should contain only the image name, e.g: "telerikLogo.gif".
Hope this helps.
All the best,
Chavdar
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Thanks for your reply. Now the problem is when I am creating image using picturebox report item, the image is coming but along that one error is also there.
Does anyone knows why this is coming?
Regards,
Jincy
You have to check whether all the image urls which are generated for the Value property of the PictureBox are valid. You may try to download the pictures by hand to see whether all the images are returned correctly.
On the other hand, if you have the images locally you can directly specify their relative locations to the Value property of the PictureBox thus avoiding the http requests.
Hope this helps.
All the best,
Chavdar
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Thanks for your reply. That works for me.
Regards,
Jincy