473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

CrystalReportViewer - manually creating the object

I'm trying to create an instance of the CrystalReportViewer control
within my class in an attempt to return the rendered HTML back to the
consumer of the class. Because I haven't added the
CrystalReportViewer control directly to a web page, but have
instantiated in manually I've explicitly called the OnLoad, OnInt,
OnPreRender and OnUnload in an attempt to get the control to be
initialised correctly.

Dim stringWrite As New System.IO.StringWriter
Dim htmlWrite As New
System.Web.UI.HtmlTextWriter(stringWrite)

MyBase.OnInit(e)
MyBase.ReportSource = "C:\Sample2.rpt"
MyBase.OnLoad(e)

MyBase.Render(htmlWrite)

MyBase.OnPreRender(e)
MyBase.OnUnload(e)

return stringWrite.ToString
The returned HTML renders the Crystal toolbar and the area where the
report should be is yellow and includes the text - CrystalViewer
Error: Object reference not set to an instance of an object.

So, it looks like there is still something I need to set in the
control, but I don't have any idea what that might be. I'm thinking
it may be viewstate or the page context - something that ASP.Net would
usually set up for the control.

FYI - I'm not using the ReportDocument object to export the HTML
becuause I need to have the ability to drill down, which the export
function doesn't do.

Does anyone have any ideas or suggestions for manually setting up the
CrystalReportViewer control correctly? I've spent a few days trying
to get this to work, so I'm getting a little frustrated at the moment.
Nov 19 '05 #1
0 1360

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Michael | last post by:
Hello, Is there a way to display Crystal Report file without depending on the Win form with CrystalReportViewer control in it, such as evoke the Crystal Report engine directly or something like...
3
by: Reza Nabi | last post by:
Hello I created a very simple page just to load a crystal report which was working just great Code started throwing the following exception, after I installed crystal report 9 advanced edition ...
4
by: Stan Sainte-Rose | last post by:
Hi, How to capture the CrystalReportViewer Events. I need to do some actions when the user clicks on the close and print icons. By the way, I thank you for your contributions... Stan
4
by: tg | last post by:
My sincere apologies for the crosspost. I posted in one other ng. I am not sure which is the correct ng for this question.I'm using .NET 2003. This is the first time I've tried to use Crystal...
0
by: Richard Thayne | last post by:
I hope someone can help. When adding the CrystalReportViewer Control to my C# aspx web form I get the control with red letters "Error Creating Control CrystalReportViewer1". I am using VS .NET...
1
by: Richard Thayne | last post by:
When adding the CrystalReportViewer Control to my aspx web form I get the control with red letters "Error Creating Control CrystalReportViewer1". I am using VS .NET 2003 and Crystal Reports XI. It...
3
by: roopsd | last post by:
I am using VS.NET 2003 with crystal reports XI release 2. I get a runtime error at the following line: oRptForm.crystalReportViewer.ReportSource = oReport An unhandled exception of type...
0
by: roopsd | last post by:
Hi Thank you for yuour help. I am using VS.NET 2003 with Crystal XI r2. I am getting NullReferenceException at the following line in my code. oRptForm.crystalReportViewer.ReportSource =...
0
by: Rod | last post by:
I've got Crystal Reports XI Release 2, for development with Visual Studio ..NET 2005. I've taken a VS .NET 2003 WinForms application that I wrote in C#, and upgraded it to VS .NET 2005. It has...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.