469,938 Members | 2,458 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,938 developers. It's quick & easy.

Can't create instance of Crystal Report

VMI
For my website, I created CrystalReportTest.rpt (through the designer in VS
2005) and I'd like to be able to display it in viewer.aspx (all in the same
project). Viewer.aspx has a Crystal Report viewer but for some reason, I
can't create an instance of this report. Therefore, I can't set any of its
properties. The only way I was able to run it was through:

CrystalReportViewer.ReportSource = Server.MapPath("CrystalReportTest.rpt");

Since I'm getting a Logon page everytime I open the page with the viewer
(which I don't want), I wanted to try the solution in
http://aspalliance.com/490, but that requires me to instantiate my report.
CrystalReportTest.rpt also doesn't have any code-behind (there are no other
files related to the rpt).
Any help is appreciated. Everything's done in VS 2005 framework 2.0

Thanks,
VMI
Apr 27 '06 #1
4 5190
Hi,
Why are you loading a report?

CR by default create a class with the same name than the report:

ReportDocument report = new CrystalReportTest();
CrystalReportViewer.ReportSource = report;
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"VMI" <VM*@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
For my website, I created CrystalReportTest.rpt (through the designer in
VS
2005) and I'd like to be able to display it in viewer.aspx (all in the
same
project). Viewer.aspx has a Crystal Report viewer but for some reason, I
can't create an instance of this report. Therefore, I can't set any of its
properties. The only way I was able to run it was through:

CrystalReportViewer.ReportSource =
Server.MapPath("CrystalReportTest.rpt");

Since I'm getting a Logon page everytime I open the page with the viewer
(which I don't want), I wanted to try the solution in
http://aspalliance.com/490, but that requires me to instantiate my report.
CrystalReportTest.rpt also doesn't have any code-behind (there are no
other
files related to the rpt).
Any help is appreciated. Everything's done in VS 2005 framework 2.0

Thanks,
VMI

Apr 27 '06 #2
VMI
The report doesn't take any parameters, so I just figured it would be easier
to load the report once Viewer.aspx opens up.
Crystal Reports didn't create a class. Does it have to do with some type of
configuration when creating the report?
The problem is that it asks for login information when the report opens up.

Thanks.

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,
Why are you loading a report?

CR by default create a class with the same name than the report:

ReportDocument report = new CrystalReportTest();
CrystalReportViewer.ReportSource = report;
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"VMI" <VM*@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
For my website, I created CrystalReportTest.rpt (through the designer in
VS
2005) and I'd like to be able to display it in viewer.aspx (all in the
same
project). Viewer.aspx has a Crystal Report viewer but for some reason, I
can't create an instance of this report. Therefore, I can't set any of its
properties. The only way I was able to run it was through:

CrystalReportViewer.ReportSource =
Server.MapPath("CrystalReportTest.rpt");

Since I'm getting a Logon page everytime I open the page with the viewer
(which I don't want), I wanted to try the solution in
http://aspalliance.com/490, but that requires me to instantiate my report.
CrystalReportTest.rpt also doesn't have any code-behind (there are no
other
files related to the rpt).
Any help is appreciated. Everything's done in VS 2005 framework 2.0

Thanks,
VMI


Apr 27 '06 #3
Hi,
"VMI" <VM*@discussions.microsoft.com> wrote in message
news:81**********************************@microsof t.com...
The report doesn't take any parameters, so I just figured it would be
easier
to load the report once Viewer.aspx opens up.
Crystal Reports didn't create a class. Does it have to do with some type
of
configuration when creating the report?
I find weird that CR did not create the class, did you try the code I posted
and see if it works?
The problem is that it asks for login information when the report opens
up.


This is a completely different matter, what is your data source? a dataset ?
a sql server?
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Apr 27 '06 #4
VMI
I already found a possible solution to the login problem. But the solution
requires that I create an instance of the report, and I can't do that since
CR didn't generate a class for it.
The report doesn't have a datasource. Everything needed to run the report is
in the report. I just need to call it (I don't pass anything to it).

Thanks.

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,
"VMI" <VM*@discussions.microsoft.com> wrote in message
news:81**********************************@microsof t.com...
The report doesn't take any parameters, so I just figured it would be
easier
to load the report once Viewer.aspx opens up.
Crystal Reports didn't create a class. Does it have to do with some type
of
configuration when creating the report?


I find weird that CR did not create the class, did you try the code I posted
and see if it works?
The problem is that it asks for login information when the report opens
up.


This is a completely different matter, what is your data source? a dataset ?
a sql server?
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Apr 27 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

By using this site, you agree to our Privacy Policy and Terms of Use.