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

Adding reports to a reportbook

2 Answers 274 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Paul Henriques
Top achievements
Rank 1
Paul Henriques asked on 30 Mar 2011, 04:00 PM
Hello all.

I am trying to setup a report book (programmatically) to load in three reports into a web viewer.  Each report is one page of a large 3 page report that I am trying to duplicate here.  I had to break it up because each page had different page setting (mainly the orientation).  Now I am hoping to read a table and print all three reports for each record of the table (thus producing a three page report for each record).  At some point I will pass an ID variable to each report for every record.

I started out with the following code but get an error that the reports are not declared (the OFC21, OCF21b, and OFC21c reports).

        Dim reportBook As New ReportBook()
        reportBook.Reports.Add(OFC21)
        reportBook.Reports.Add(OFC21b)
        reportBook.Reports.Add(OFC21c)

Then I tried to create the report object first and then pass it to the report book but I get the same error when I try to declare the reports.

        Dim reportBook As New ReportBook()
        Dim rOFC21 As New OCF21()
        Dim rOFC21b As New OCF21b
        Dim rOFC21c As New OCF21c

        reportBook.Reports.Add(rOFC21)
        reportBook.Reports.Add(rOFC21b)
        reportBook.Reports.Add(rOFC21c)


At this point I have no idea why it is having an issue reading the reports.  The reports were created in a class library project and the dll was brought into this one.

Funny thing is, if I drop a report book control on the page and try and add the reports through there, it sees the reports without and issues. 


Any help would be much appreciated.

Paul.

2 Answers, 1 is accepted

Sort by
0
Squall
Top achievements
Rank 1
answered on 01 Apr 2011, 04:05 PM
What is the error you get when instantiate the reports?  
0
Paul Henriques
Top achievements
Rank 1
answered on 01 Apr 2011, 04:08 PM
I stumbled upon my solution yesterday.

I just need to identify the class name (ClassLibrary1.OFC21) and this worked fine.



Thanks for the effort.


Paul.


Tags
General Discussions
Asked by
Paul Henriques
Top achievements
Rank 1
Answers by
Squall
Top achievements
Rank 1
Paul Henriques
Top achievements
Rank 1
Share this question
or