ASP.NET Report Document Cannot Load Crystal Report 
Author Message
 ASP.NET Report Document Cannot Load Crystal Report

Hi.  Here's my set up on my machine....
- Windows xp pro
- .NET framework sp2
- Crystal Reports version 8.5.0.461

I want to view a crystal report (that I generated through Crystal
Reports and not through Visual Studio) through the browser using
asp.net.  I'm using Visual Studio.net to create a form that has a
CrystalReportViewer and ReportDocument component.  My code is posted
below.  When I run my page in debug mode through Visual Studio, the
browser does not show anything...it just hangs (no error displays).
If I leave it for a couple of minutes, eventually it'll read Server
Not Available.  If I step through my code, it hangs on the
ReportDocument1.Load line.  I have done a couple of days of research
and found nothing similar anywhere (keep in mind that I have not seen
any error message displayed in the browser for my problem yet).

I've tried creating a report through Visual Studio and that didn't
work.  I've tried different syntax for the Load function (like using
"\\" or through the network).  I even tried changing permissions on
the folder (even though I'm running everything from the same
computer).  Lastly, I downloaded and installed the newest Crystal hot
fixes but nothing works.  Does anyone have a similar problem?  Any
advice would be greatly appreciated.  Thank you in advance.

Try
    reportDocument1.Load("E:\Reports\Report_Master.rpt")
    crv1.ReportSource = reportDocument1
    crv1.DataBind()
Catch ex As Exception
    Response.Write(ex.Message)
End Try



Mon, 07 Nov 2005 05:28:35 GMT  
 ASP.NET Report Document Cannot Load Crystal Report
Hi Marci

Do you think that everything is installed right? The normal cases you
get errors like 'Query Engine Error'. I think your problem lies in your
data source. What do you do there?

Quote:
> Try
>     reportDocument1.Load("E:\Reports\Report_Master.rpt")
>     crv1.ReportSource = reportDocument1
>     crv1.DataBind()
> Catch ex As Exception
>     Response.Write(ex.Message)
> End Try

// a simple sample in C# - sorry
ReportDocument rd = new ReportDocument ();                      
rd.Load(this.Page.MapPath("offer.rpt"));
// the DataSet includes my XML data out of the sql server
rd.SetDataSource(ds);                  
CrystalReportViewer1.ReportSource = rd;        

--
Regards Niclas



Mon, 07 Nov 2005 15:19:55 GMT  
 ASP.NET Report Document Cannot Load Crystal Report
Hi Niclas.  Thank you for your help.  I believe I have everything
installed correctly.  I haven't received any error messages after any
installations.  My datasource is defined within the crystal report.
In other words, when I created my report, I assigned the database to a
sql database on my own machine (so I don't programmatically set the
data source to anything in my code).  Then when I tried to load this
report through my asp.net project, that's when the webpage hangs.  In
all the examples I found over the web, it doesn't say I need to "code"
the data source if it's an "external" report.  Do you think that's
what I'm missiing?

Thanks again.
-Marci

Quote:

> Hi Marci

> Do you think that everything is installed right? The normal cases you
> get errors like 'Query Engine Error'. I think your problem lies in your
> data source. What do you do there?

> > Try
> >     reportDocument1.Load("E:\Reports\Report_Master.rpt")
> >     crv1.ReportSource = reportDocument1
> >     crv1.DataBind()
> > Catch ex As Exception
> >     Response.Write(ex.Message)
> > End Try

> // a simple sample in C# - sorry
> ReportDocument rd = new ReportDocument ();                  
> rd.Load(this.Page.MapPath("offer.rpt"));
> // the DataSet includes my XML data out of the sql server
> rd.SetDataSource(ds);                      
> CrystalReportViewer1.ReportSource = rd;



Tue, 08 Nov 2005 06:39:49 GMT  
 ASP.NET Report Document Cannot Load Crystal Report

Quote:
>-----Original Message-----
>Hi.  Here's my set up on my machine....
>- Windows xp pro
>- .NET framework sp2
>- Crystal Reports version 8.5.0.461

>I want to view a crystal report (that I generated through
Crystal
>Reports and not through Visual Studio) through the
browser using
>asp.net.  I'm using Visual Studio.net to create a form
that has a
>CrystalReportViewer and ReportDocument component.  My
code is posted
>below.  When I run my page in debug mode through Visual
Studio, the
>browser does not show anything...it just hangs (no error
displays).
>If I leave it for a couple of minutes, eventually it'll
read Server
>Not Available.  If I step through my code, it hangs on the
>ReportDocument1.Load line.  I have done a couple of days
of research
>and found nothing similar anywhere (keep in mind that I
have not seen
>any error message displayed in the browser for my problem
yet).

>I've tried creating a report through Visual Studio and
that didn't
>work.  I've tried different syntax for the Load function
(like using
>"\\" or through the network).  I even tried changing
permissions on
>the folder (even though I'm running everything from the
same
>computer).  Lastly, I downloaded and installed the newest
Crystal hot
>fixes but nothing works.  Does anyone have a similar
problem?  Any
>advice would be greatly appreciated.  Thank you in
advance.

>Try
>    reportDocument1.Load("E:\Reports\Report_Master.rpt")
>    crv1.ReportSource = reportDocument1
>    crv1.DataBind()
>Catch ex As Exception
>    Response.Write(ex.Message)
>End Try
>.

hello friend,
I think this not the enough code due to load the Rpt. in
dotnet.

Because Report doc. can get the username of Dsn or other
Datasources but it can't get the Password(Thro' Dotnet
code)
So, u must pass the Password of that Dsn.

Try to Following code

report.Load("C:\Inetpub\wwwroot\Reports\Sample.rpt")
Dim Tblloginfo As New TableLogOnInfo()
Tblloginfo.ConnectionInfo.Password = "sample"
report.Database.Tables("TableName").ApplyLogOnInfo
(Tblloginfo)
CrystalReportViewer1.ReportSource = report
CrystalReportViewer1.DataBind()

Ok
Bye
Sasi.M



Wed, 09 Nov 2005 11:55:20 GMT  
 ASP.NET Report Document Cannot Load Crystal Report

Quote:

> In all the examples I found over the web, it doesn't say I need to "code"
> the data source if it's an "external" report.  Do you think that's
> what I'm missiing?

Hi,
  sorry - that's my way to get out my data out of the sql server. Of
course there are other ways but I don't like the static way. I like to
do everything myself :-)

  But now - sorry - I have no idea.

Regards
Niclas



Fri, 11 Nov 2005 20:35:03 GMT  
 ASP.NET Report Document Cannot Load Crystal Report
Hi Sasi.

Thank you for your reply.  I did try your code but no luck.  When I
first created the Crystal Report, I used a "trusted connection" to
access the tables in SQL for my report fields.  Do you know if
Crystal.NET does not support a trusted connection when accessing
external reports?  I would like to avoid having permission information
in my ASP.NET pages if possible.

Any additional suggestions would be appreciated.
Thanks again for your help.
-Marci

Quote:

> >-----Original Message-----
> >Hi.  Here's my set up on my machine....
> >- Windows xp pro
> >- .NET framework sp2
> >- Crystal Reports version 8.5.0.461

> >I want to view a crystal report (that I generated through
>  Crystal
> >Reports and not through Visual Studio) through the
>  browser using
> >asp.net.  I'm using Visual Studio.net to create a form
>  that has a
> >CrystalReportViewer and ReportDocument component.  My
>  code is posted
> >below.  When I run my page in debug mode through Visual
>  Studio, the
> >browser does not show anything...it just hangs (no error
>  displays).
> >If I leave it for a couple of minutes, eventually it'll
>  read Server
> >Not Available.  If I step through my code, it hangs on the
> >ReportDocument1.Load line.  I have done a couple of days
>  of research
> >and found nothing similar anywhere (keep in mind that I
>  have not seen
> >any error message displayed in the browser for my problem
>  yet).

> >I've tried creating a report through Visual Studio and
>  that didn't
> >work.  I've tried different syntax for the Load function
>  (like using
> >"\\" or through the network).  I even tried changing
>  permissions on
> >the folder (even though I'm running everything from the
>  same
> >computer).  Lastly, I downloaded and installed the newest
>  Crystal hot
> >fixes but nothing works.  Does anyone have a similar
>  problem?  Any
> >advice would be greatly appreciated.  Thank you in
>  advance.

> >Try
> >    reportDocument1.Load("E:\Reports\Report_Master.rpt")
> >    crv1.ReportSource = reportDocument1
> >    crv1.DataBind()
> >Catch ex As Exception
> >    Response.Write(ex.Message)
> >End Try
> >.

> hello friend,
> I think this not the enough code due to load the Rpt. in
> dotnet.

> Because Report doc. can get the username of Dsn or other
> Datasources but it can't get the Password(Thro' Dotnet
> code)
> So, u must pass the Password of that Dsn.

> Try to Following code

> report.Load("C:\Inetpub\wwwroot\Reports\Sample.rpt")
> Dim Tblloginfo As New TableLogOnInfo()
> Tblloginfo.ConnectionInfo.Password = "sample"
> report.Database.Tables("TableName").ApplyLogOnInfo
> (Tblloginfo)
> CrystalReportViewer1.ReportSource = report
> CrystalReportViewer1.DataBind()

> Ok
> Bye
> Sasi.M



Sun, 13 Nov 2005 03:14:00 GMT  
 ASP.NET Report Document Cannot Load Crystal Report
Make sure you have the correct .dll's in your references. I had this same
problem. Here is what fixed it for me. Hope this helps you.

Quote:
>>Found my error on the Crystal discussion group. Here is the fix:
>>I fixed this!

>>The problem is that the version of the viewer that ships with MS Visual

studio .NET is based on 9.1. This >>works fine as long as you don't decide
that Crystal is worth having and buy the upgrade to Crystal 9. This
Quote:
>>upgrades the DLLs to version 9.2 which are incompatible with 9.1. As a

result, you end up with you .net >>project referencing version 9.1 of the
viewer and trying to pass it the version 9.2 ReportDocument object. This
Quote:
>>version of the object is not compatible and generates the error.

>>The fix is to open you project in VS.net. Go to the Project references.

Locate the viewer and see what version >>it shows in the Propty dialog. If
it is 9.1, delete this reference. The re-add the reference to the project.
This time >>it will be version 9.2 and everything works.

Quote:

>>j

As a note deleting and readding works but you must locate the 9.2 dll files
yourself because the 9.1 files are only displayed in .Net and not the 9.2.

The correct .dll files are in: "C:\Program Files\Common Files\Crystal
Decisions\2.0\managed\"


Quote:
> Can you email me an ASP.Net page that works for you. If I had a sample
page
> where you load a dataset and then set the CrystalReportViewer properties
it
> would help me make sure I have everything in the right place.

> Thanks.



> > Hey Ed,

> > From what I can tell the code looks fine. I've found that people often
> send
> > me code that they took from my book but it doesn't work. Upon further
> > inspection the code is fine, but something else went wrong in how the
> report
> > was setup. Unfortunately, you can't use code to see how the report was
> > setup. So here are some ideas for you to research. Of course, it may or
> may
> > not be one of these things but hoepefully this will get you going in the
> > right direction.

> > 1) You can't mix properties of the Viewer and the ReportDocument. In
other
> > words, in this example you are setting the ReportDocument poperties so
> make
> > sure that no where in your code do you set any properties of the Viewer.
> > This happens a lot when people set parameters.
> > 2) If you are using the Viewer, NEVER call the DataBind() method. If you
> > have some odd property that requires calling the DataBind() method, then
> > call it before setting any ReportDocument properties. Most people don't
> need
> > to call the DataBind() method but do so anyway b/c they once saw it in a
> > sample someplace and assume that they have to always do this. Not true.
> > 3) Make sure the table name is the same as the tablename the report is
> > expecting.
> > 4) Move this code to different methods of the ASPX form. Someone once
told
> > me that after they moved the code then everything magically started
> working.
> > However, they didn't tell me where they originally had the code in the
> first
> > place.
> > 5) Have you tried copying this code into a Windows app? This would see
if
> > you have any problems relating to the ASPNET user not having the proper
> > access to some of the folders involved.

> > Just some ideas! I hope this gets you on the right track. If you
discover
> > something I didn't mention then please post back so we can all learn
from
> > it.

> > ---------
> > A Crystal Reports.NET book for programmers? Its free!
> > * Covers ASP.NET and Windows Forms
> > * Teaches all phases of report development
> > * Alerts you to the bugs and how to get around them
> > * Maps out the complex ReportDocument object model
> > * Shows how to perform runtime customization
> > * Demonstrates all options of connecting with ADO.NET
> > * Gives complete code listings for every concept presented

> > www.CrystalReportsBook.com?cpgn=ngcr_032003



> > > I am trying to use a dataset that I manually populate with a Crystal
> > Report
> > > using the Crystal Report Viewer in my ASP.Net web page. I get the
> > following
> > > error on the CrystalReportViewer1.ReportSource = statement.

> > > Invalid Report Source.
> > > Description: An unhandled exception occurred during the execution of
the
> > > current web request. Please review the stack trace for more
information
> > > about the error and where it originated in the code.

> > > Exception Details: System.Exception: Invalid Report Source.

> > > Source Error:

> > > Line 2143:        mytestdataset.Tables("Dataset1").Rows.Add(dr_to)
> > > Line 2144:        testreport.SetDataSource(mytestdataset)
> > > Line 2145:        CrystalReportViewer1.ReportSource = testreport
> > > Line 2146:    End Function
> > > Line 2147:End Class

> > > Source File:
> > > c:\inetpub\wwwroot\ACSIReporting\Common\Windows\ReportDialog.aspx.vb
> > > Line: 2145

> > > Stack Trace:

> > > [Exception: Invalid Report Source. ]

CrystalDecisions.ReportSource.ReportSourceFactory.CreateReportSource(Object
Quote:
> > > objToBind, Object objEnterpriseLogon, Boolean isDesignMode, Boolean
> > > needHTTPCache) +1005
> > >    CrystalDecisions.Web.ReportAgentBase.set_ReportSource(Object value)
> > +234
> > >    CrystalDecisions.Web.ReportAgent.set_ReportSource(Object value) +16

CrystalDecisions.Web.CrystalReportViewerBase.set_ReportSource(Object
Quote:
> > > value) +52
> > >    ACSIReporting.WebForm11.testreportload() in

> c:\inetpub\wwwroot\ACSIReporting\Common\Windows\ReportDialog.aspx.vb:2145
> > >    ACSIReporting.WebForm11.Page_Load(Object sender, EventArgs e) in

c:\inetpub\wwwroot\ACSIReporting\Common\Windows\ReportDialog.aspx.vb:732

- Show quoted text -

Quote:
> > >    System.Web.UI.Control.OnLoad(EventArgs e) +67
> > >    System.Web.UI.Control.LoadRecursive() +29
> > >    System.Web.UI.Page.ProcessRequestMain() +724

> --------------------------------------------------------------------------
> > --
> > > ----

> > > Version Information: Microsoft .NET Framework Version:1.0.3705.288;
> > ASP.NET
> > > Version:1.0.3705.288

> > > It is a very simple report. My code is as follows. Please review and
let
> > me
> > > know what I am doing wrong.

> > > Dim testreport As New CrystalReport1()

> > > Dim mytestdataset As New Dataset1()

> > > Dim dr_to As DataRow

> > > dr_to = mytestdataset.Tables("Dataset1").NewRow()

> > > dr_to("Test1") = "Test1"

> > > dr_to("Test2") = "Test2"

> > > mytestdataset.Tables("Dataset1").Rows.Add(dr_to)

> > > testreport.SetDataSource(mytestdataset)

> > > CrystalReportViewer1.ReportSource = testreport   <--- Here is where
the
> > > error occurs in my web page

> > > Any suggestions?

> > > Thanks for your help.



Sun, 13 Nov 2005 03:28:13 GMT  
 ASP.NET Report Document Cannot Load Crystal Report
Hi Ed.  Thanks for your input but unfortunately, I have Crystal 8.5
installed so I don't have any dlls in C:\Program Files\Common
Files\Crystal Decisions\2.0\managed\. Sorry... my mistake because I
forgot to mention what version I have.  Any other ideas?

Thanks again.
-Marci

Quote:

> Make sure you have the correct .dll's in your references. I had this same
> problem. Here is what fixed it for me. Hope this helps you.

> >>Found my error on the Crystal discussion group. Here is the fix:

> >>I fixed this!

> >>The problem is that the version of the viewer that ships with MS Visual
> studio .NET is based on 9.1. This >>works fine as long as you don't decide
> that Crystal is worth having and buy the upgrade to Crystal 9. This
> >>upgrades the DLLs to version 9.2 which are incompatible with 9.1. As a
> result, you end up with you .net >>project referencing version 9.1 of the
> viewer and trying to pass it the version 9.2 ReportDocument object. This
> >>version of the object is not compatible and generates the error.

> >>The fix is to open you project in VS.net. Go to the Project references.
> Locate the viewer and see what version >>it shows in the Propty dialog. If
> it is 9.1, delete this reference. The re-add the reference to the project.
> This time >>it will be version 9.2 and everything works.

> >>j

> As a note deleting and readding works but you must locate the 9.2 dll files
> yourself because the 9.1 files are only displayed in .Net and not the 9.2.

> The correct .dll files are in: "C:\Program Files\Common Files\Crystal
> Decisions\2.0\managed\"



> > Can you email me an ASP.Net page that works for you. If I had a sample
>  page
> > where you load a dataset and then set the CrystalReportViewer properties
>  it
> > would help me make sure I have everything in the right place.

> > Thanks.



> > > Hey Ed,

> > > From what I can tell the code looks fine. I've found that people often
>  send
> > > me code that they took from my book but it doesn't work. Upon further
> > > inspection the code is fine, but something else went wrong in how the
>  report
> > > was setup. Unfortunately, you can't use code to see how the report was
> > > setup. So here are some ideas for you to research. Of course, it may or
>  may
> > > not be one of these things but hoepefully this will get you going in the
> > > right direction.

> > > 1) You can't mix properties of the Viewer and the ReportDocument. In
>  other
> > > words, in this example you are setting the ReportDocument poperties so
>  make
> > > sure that no where in your code do you set any properties of the Viewer.
> > > This happens a lot when people set parameters.
> > > 2) If you are using the Viewer, NEVER call the DataBind() method. If you
> > > have some odd property that requires calling the DataBind() method, then
> > > call it before setting any ReportDocument properties. Most people don't
>  need
> > > to call the DataBind() method but do so anyway b/c they once saw it in a
> > > sample someplace and assume that they have to always do this. Not true.
> > > 3) Make sure the table name is the same as the tablename the report is
> > > expecting.
> > > 4) Move this code to different methods of the ASPX form. Someone once
>  told
> > > me that after they moved the code then everything magically started
>  working.
> > > However, they didn't tell me where they originally had the code in the
>  first
> > > place.
> > > 5) Have you tried copying this code into a Windows app? This would see
>  if
> > > you have any problems relating to the ASPNET user not having the proper
> > > access to some of the folders involved.

> > > Just some ideas! I hope this gets you on the right track. If you
>  discover
> > > something I didn't mention then please post back so we can all learn
>  from
> > > it.

> > > ---------
> > > A Crystal Reports.NET book for programmers? Its free!
> > > * Covers ASP.NET and Windows Forms
> > > * Teaches all phases of report development
> > > * Alerts you to the bugs and how to get around them
> > > * Maps out the complex ReportDocument object model
> > > * Shows how to perform runtime customization
> > > * Demonstrates all options of connecting with ADO.NET
> > > * Gives complete code listings for every concept presented

> > > www.CrystalReportsBook.com?cpgn=ngcr_032003



> > > > I am trying to use a dataset that I manually populate with a Crystal
>  Report
> > > > using the Crystal Report Viewer in my ASP.Net web page. I get the
>  following
> > > > error on the CrystalReportViewer1.ReportSource = statement.

> > > > Invalid Report Source.
> > > > Description: An unhandled exception occurred during the execution of
>  the
> > > > current web request. Please review the stack trace for more
>  information
> > > > about the error and where it originated in the code.

> > > > Exception Details: System.Exception: Invalid Report Source.

> > > > Source Error:

> > > > Line 2143:        mytestdataset.Tables("Dataset1").Rows.Add(dr_to)
> > > > Line 2144:        testreport.SetDataSource(mytestdataset)
> > > > Line 2145:        CrystalReportViewer1.ReportSource = testreport
> > > > Line 2146:    End Function
> > > > Line 2147:End Class

> > > > Source File:
> > > > c:\inetpub\wwwroot\ACSIReporting\Common\Windows\ReportDialog.aspx.vb
> > > > Line: 2145

> > > > Stack Trace:

> > > > [Exception: Invalid Report Source. ]

>  CrystalDecisions.ReportSource.ReportSourceFactory.CreateReportSource(Object
> > > > objToBind, Object objEnterpriseLogon, Boolean isDesignMode, Boolean
> > > > needHTTPCache) +1005
> > > >    CrystalDecisions.Web.ReportAgentBase.set_ReportSource(Object value)
>  +234
> > > >    CrystalDecisions.Web.ReportAgent.set_ReportSource(Object value) +16

>  CrystalDecisions.Web.CrystalReportViewerBase.set_ReportSource(Object
> > > > value) +52
> > > >    ACSIReporting.WebForm11.testreportload() in

>  c:\inetpub\wwwroot\ACSIReporting\Common\Windows\ReportDialog.aspx.vb:2145
> > > >    ACSIReporting.WebForm11.Page_Load(Object sender, EventArgs e) in

>  c:\inetpub\wwwroot\ACSIReporting\Common\Windows\ReportDialog.aspx.vb:732
> > > >    System.Web.UI.Control.OnLoad(EventArgs e) +67
> > > >    System.Web.UI.Control.LoadRecursive() +29
> > > >    System.Web.UI.Page.ProcessRequestMain() +724

> > --------------------------------------------------------------------------
> > > --
> > > > ----

> > > > Version Information: Microsoft .NET Framework Version:1.0.3705.288;
>  ASP.NET
> > > > Version:1.0.3705.288

> > > > It is a very simple report. My code is as follows. Please review and
>  let
>  me
> > > > know what I am doing wrong.

> > > > Dim testreport As New CrystalReport1()

> > > > Dim mytestdataset As New Dataset1()

> > > > Dim dr_to As DataRow

> > > > dr_to = mytestdataset.Tables("Dataset1").NewRow()

> > > > dr_to("Test1") = "Test1"

> > > > dr_to("Test2") = "Test2"

> > > > mytestdataset.Tables("Dataset1").Rows.Add(dr_to)

> > > > testreport.SetDataSource(mytestdataset)

> > > > CrystalReportViewer1.ReportSource = testreport   <--- Here is where
>  the
> > > > error occurs in my web page

> > > > Any suggestions?

> > > > Thanks for your help.



Mon, 14 Nov 2005 03:25:12 GMT  
 ASP.NET Report Document Cannot Load Crystal Report
I add reports that I create all the time in Crystal to my ASP.Net
applications. One thing I do that you do not mention is that you have to
right click the report and say include in project. .Net will then create the
necessary objects etc. for that report. You can still edit the report
outside of .Net I also do that all the time. But the report needs to be in
your project so it is copied etc. to your web server and compiled correctly.

Just a suggestion.


Quote:
> Hi Ed.  Thanks for your input but unfortunately, I have Crystal 8.5
> installed so I don't have any dlls in C:\Program Files\Common
> Files\Crystal Decisions\2.0\managed\. Sorry... my mistake because I
> forgot to mention what version I have.  Any other ideas?

> Thanks again.
> -Marci




Quote:
> > Make sure you have the correct .dll's in your references. I had this
same
> > problem. Here is what fixed it for me. Hope this helps you.

> > >>Found my error on the Crystal discussion group. Here is the fix:

> > >>I fixed this!

> > >>The problem is that the version of the viewer that ships with MS
Visual
> > studio .NET is based on 9.1. This >>works fine as long as you don't
decide
> > that Crystal is worth having and buy the upgrade to Crystal 9. This
> > >>upgrades the DLLs to version 9.2 which are incompatible with 9.1. As a
> > result, you end up with you .net >>project referencing version 9.1 of
the
> > viewer and trying to pass it the version 9.2 ReportDocument object. This
> > >>version of the object is not compatible and generates the error.

> > >>The fix is to open you project in VS.net. Go to the Project
references.
> > Locate the viewer and see what version >>it shows in the Propty dialog.
If
> > it is 9.1, delete this reference. The re-add the reference to the
project.
> > This time >>it will be version 9.2 and everything works.

> > >>j

> > As a note deleting and readding works but you must locate the 9.2 dll
files
> > yourself because the 9.1 files are only displayed in .Net and not the
9.2.

> > The correct .dll files are in: "C:\Program Files\Common Files\Crystal
> > Decisions\2.0\managed\"



> > > Can you email me an ASP.Net page that works for you. If I had a sample
> >  page
> > > where you load a dataset and then set the CrystalReportViewer
properties
> >  it
> > > would help me make sure I have everything in the right place.

> > > Thanks.



> > > > Hey Ed,

> > > > From what I can tell the code looks fine. I've found that people
often
> >  send
> > > > me code that they took from my book but it doesn't work. Upon
further
> > > > inspection the code is fine, but something else went wrong in how
the
> >  report
> > > > was setup. Unfortunately, you can't use code to see how the report
was
> > > > setup. So here are some ideas for you to research. Of course, it may
or
> >  may
> > > > not be one of these things but hoepefully this will get you going in
the
> > > > right direction.

> > > > 1) You can't mix properties of the Viewer and the ReportDocument. In
> >  other
> > > > words, in this example you are setting the ReportDocument poperties
so
> >  make
> > > > sure that no where in your code do you set any properties of the
Viewer.
> > > > This happens a lot when people set parameters.
> > > > 2) If you are using the Viewer, NEVER call the DataBind() method. If
you
> > > > have some odd property that requires calling the DataBind() method,
then
> > > > call it before setting any ReportDocument properties. Most people
don't
> >  need
> > > > to call the DataBind() method but do so anyway b/c they once saw it
in a
> > > > sample someplace and assume that they have to always do this. Not
true.
> > > > 3) Make sure the table name is the same as the tablename the report
is
> > > > expecting.
> > > > 4) Move this code to different methods of the ASPX form. Someone
once
> >  told
> > > > me that after they moved the code then everything magically started
> >  working.
> > > > However, they didn't tell me where they originally had the code in
the
> >  first
> > > > place.
> > > > 5) Have you tried copying this code into a Windows app? This would
see
> >  if
> > > > you have any problems relating to the ASPNET user not having the
proper
> > > > access to some of the folders involved.

> > > > Just some ideas! I hope this gets you on the right track. If you
> >  discover
> > > > something I didn't mention then please post back so we can all learn
> >  from
> > > > it.

> > > > ---------
> > > > A Crystal Reports.NET book for programmers? Its free!
> > > > * Covers ASP.NET and Windows Forms
> > > > * Teaches all phases of report development
> > > > * Alerts you to the bugs and how to get around them
> > > > * Maps out the complex ReportDocument object model
> > > > * Shows how to perform runtime customization
> > > > * Demonstrates all options of connecting with ADO.NET
> > > > * Gives complete code listings for every concept presented

> > > > www.CrystalReportsBook.com?cpgn=ngcr_032003



> > > > > I am trying to use a dataset that I manually populate with a
Crystal
> >  Report
> > > > > using the Crystal Report Viewer in my ASP.Net web page. I get the
> >  following
> > > > > error on the CrystalReportViewer1.ReportSource = statement.

> > > > > Invalid Report Source.
> > > > > Description: An unhandled exception occurred during the execution
of
> >  the
> > > > > current web request. Please review the stack trace for more
> >  information
> > > > > about the error and where it originated in the code.

> > > > > Exception Details: System.Exception: Invalid Report Source.

> > > > > Source Error:

> > > > > Line 2143:        mytestdataset.Tables("Dataset1").Rows.Add(dr_to)
> > > > > Line 2144:        testreport.SetDataSource(mytestdataset)
> > > > > Line 2145:        CrystalReportViewer1.ReportSource = testreport
> > > > > Line 2146:    End Function
> > > > > Line 2147:End Class

> > > > > Source File:

c:\inetpub\wwwroot\ACSIReporting\Common\Windows\ReportDialog.aspx.vb
Quote:
> > > > > Line: 2145

> > > > > Stack Trace:

> > > > > [Exception: Invalid Report Source. ]

CrystalDecisions.ReportSource.ReportSourceFactory.CreateReportSource(Object
Quote:
> > > > > objToBind, Object objEnterpriseLogon, Boolean isDesignMode,
Boolean
> > > > > needHTTPCache) +1005
> > > > >    CrystalDecisions.Web.ReportAgentBase.set_ReportSource(Object
value)
> >  +234
> > > > >    CrystalDecisions.Web.ReportAgent.set_ReportSource(Object value)
+16

> >  CrystalDecisions.Web.CrystalReportViewerBase.set_ReportSource(Object
> > > > > value) +52
> > > > >    ACSIReporting.WebForm11.testreportload() in

c:\inetpub\wwwroot\ACSIReporting\Common\Windows\ReportDialog.aspx.vb:2145
Quote:
> > > > >    ACSIReporting.WebForm11.Page_Load(Object sender, EventArgs e)
in

c:\inetpub\wwwroot\ACSIReporting\Common\Windows\ReportDialog.aspx.vb:732

- Show quoted text -

Quote:
> > > > >    System.Web.UI.Control.OnLoad(EventArgs e) +67
> > > > >    System.Web.UI.Control.LoadRecursive() +29
> > > > >    System.Web.UI.Page.ProcessRequestMain() +724

> --------------------------------------------------------------------------
> > > > --
> > > > > ----

> > > > > Version Information: Microsoft .NET Framework

Version:1.0.3705.288;

- Show quoted text -

Quote:
> >  ASP.NET
> > > > > Version:1.0.3705.288

> > > > > It is a very simple report. My code is as follows. Please review
and
> >  let
> >  me
> > > > > know what I am doing wrong.

> > > > > Dim testreport As New CrystalReport1()

> > > > > Dim mytestdataset As New Dataset1()

> > > > > Dim dr_to As DataRow

> > > > > dr_to = mytestdataset.Tables("Dataset1").NewRow()

> > > > > dr_to("Test1") = "Test1"

> > > > > dr_to("Test2") = "Test2"

> > > > > mytestdataset.Tables("Dataset1").Rows.Add(dr_to)

> > > > > testreport.SetDataSource(mytestdataset)

> > > > > CrystalReportViewer1.ReportSource = testreport   <--- Here is
where
> >  the
> > > > > error occurs in my web page

> > > > > Any suggestions?

> > > > > Thanks for your help.



Mon, 14 Nov 2005 05:50:47 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Web Reports (ASP.NET and Crystal Reports for .Net)

2. Crystal Reports 8.5 (VB6) to Crystal Reports NET (VB.NET) conversion

3. Crystal Reports from ASP.NET without compiling VB.NET on SQL/ADO changes

4. crystal.net report from asp.net created (temporary) table

5. problem with crystal report for .net in asp.net

6. VB.net and crystal reports.net Multiple reports

7. Linking Crystal Report with a stored Procedure -- crystal report for visual studio.net

8. vb .net crystal reports not compatible with Crystal Reports 8.5

9. ?:Cannot read report - version 4.0/Error loading report.

10. Crystal Reports "Cannot Find Report."

11. Cannot update report using Crystal Reports

12. Progress Bar While Crystal Reports Loads A Report

 

 
Powered by phpBB® Forum Software