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

Can't load report in viewer (VS2005 VB.NET)

6 Answers 116 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Quan Nguyen
Top achievements
Rank 1
Quan Nguyen asked on 13 May 2010, 07:55 PM
After i referenced my test report project dll in my window app, i can't see it displayed on the report property dropdown list of the ReportViewer. I also try to load it by codes and got this error: Unable to cast object of type 'TestReport.Report1' to type 'Telerik.Reporting.IReportDocument' with these codes:

Dim

 

a As New TestReport.Report1()

 

 

 

Me.ReportViewer1.Report = a    - this line got the above error

 

 

 

Me.ReportViewer1.RefreshReport()

 

 



Attached are some screenshots. It doesn't let me to attach my source codes here.

THanks
Quan

6 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 14 May 2010, 08:59 AM
Hello Quan,

This error is usually result of incorrect references. Make sure that your windows forms project has reference to:
  • TestReport.dll
  • Telerik.Reporting.dll
  • Telerik.ReportViewer.WinForms.dll
After you add those references, rebuild your solution and you should be good to go.
Regards,
Steve
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Quan Nguyen
Top achievements
Rank 1
answered on 14 May 2010, 06:59 PM

Thanks for quick reply. However I can do that if my window app is in C#. When i use VB.NET I still have the same problem.

 

Quan

0
Steve
Telerik team
answered on 17 May 2010, 10:09 AM
Hi Quan Nguyen,

Adding references to your application is straight forward and it does not matter whether it is a C# or VB.NET one. Can you clarify what you mean by "I can do that if my app is C#" - what is "that" in this context?

Sincerely yours,
Steve
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Quan Nguyen
Top achievements
Rank 1
answered on 17 May 2010, 10:57 PM
I created 2 test window app. 1 in C# and 1 in VB.NET. I added reference of the TestReport.dll to both apps successfully.
In the C# app, I was able to select the TestReport.Report1 under the "Report" property of ReportView.
However, in the VB.NET app, I can't even see that option listed in the "Report" property.


Thanks
Quan
0
Steve
Telerik team
answered on 18 May 2010, 03:52 PM
Hi Quan Nguyen,

Your description of the problem has changed since your original post, where you stated that there is a problem setting a report to the Report property of the viewer programmatically. Now you talk about setting report through the designer. However since we were not able to reproduce such problem on our end (see attached screenshot), we kindly ask you to prepare a sample project (both class library and windows forms project) in  VB.NET, that replicates this problem so we can investigate.
In the mean time, you can set the report property programmatically like in the original post, as long as you have added the correct references and it would work.

All the best,
Steve
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Quan Nguyen
Top achievements
Rank 1
answered on 18 May 2010, 05:34 PM
Hi
In my original description, I did say this "After i referenced my test report project dll in my window app, i can't see it displayed on the report property dropdown list of the ReportViewer." I was refering to the design and did send a screenshot (untitled1.gif) of that. Anyway, my VS2005 VB.NET version might have prob. I will try this on another pc.

Thanks
Quan
Tags
General Discussions
Asked by
Quan Nguyen
Top achievements
Rank 1
Answers by
Steve
Telerik team
Quan Nguyen
Top achievements
Rank 1
Share this question
or