Crystal Reports
-
Hi All, I am trying to view some Reports online through my Internet site. I am using C# on a Windows 2000 server running IIS5. I have looked around the internet and found some examples but they are not working. I have the following at the moment.
In design view I cn now see my report, but when I compile and view my page I get
CS1009: Unrecognized escape sequence
???? Can someone let me know where I am going wrong and how to sort this out. Thanks, Gavin
-
Hi All, I am trying to view some Reports online through my Internet site. I am using C# on a Windows 2000 server running IIS5. I have looked around the internet and found some examples but they are not working. I have the following at the moment.
In design view I cn now see my report, but when I compile and view my page I get
CS1009: Unrecognized escape sequence
???? Can someone let me know where I am going wrong and how to sort this out. Thanks, Gavin
it's the back slashes in your ReportSource string. why do you have it as a server side string??? change it to: ReportSource='C:\Inetpub\wwwroot\Outbreak\Reports\test.rpt'
-
it's the back slashes in your ReportSource string. why do you have it as a server side string??? change it to: ReportSource='C:\Inetpub\wwwroot\Outbreak\Reports\test.rpt'
It was set as a server side string because that is how the Crystal Report Viewer set it itself. What I did was I dragged the CrystalReportViewer off the toolbox and dropped it onto my form. I then selected it and in the properties window click on the ... next to databindings. I then went into the ReportSource and put in the exact Source and clicked ok and it did the rest :)... I changed it as you suggested and am now getting the following error.
Cannot create an object of type 'System.Object' from its string representation 'C:\Inetpub\wwwroot\Outbreak\Reports\test.rpt' for the 'ReportSource' property
I'm sure this is meant to be a lot simpler than it has turned out to be? Thanks for the help
-
It was set as a server side string because that is how the Crystal Report Viewer set it itself. What I did was I dragged the CrystalReportViewer off the toolbox and dropped it onto my form. I then selected it and in the properties window click on the ... next to databindings. I then went into the ReportSource and put in the exact Source and clicked ok and it did the rest :)... I changed it as you suggested and am now getting the following error.
Cannot create an object of type 'System.Object' from its string representation 'C:\Inetpub\wwwroot\Outbreak\Reports\test.rpt' for the 'ReportSource' property
I'm sure this is meant to be a lot simpler than it has turned out to be? Thanks for the help
ok, so try this: ReportSource='<%# "C:\\Inetpub\\wwwroot\\Outbreak\\Reports\\test.rpt" %>' or: ReportSource='<%# @"C:\Inetpub\wwwroot\Outbreak\Reports\test.rpt" %>'
-
ok, so try this: ReportSource='<%# "C:\\Inetpub\\wwwroot\\Outbreak\\Reports\\test.rpt" %>' or: ReportSource='<%# @"C:\Inetpub\wwwroot\Outbreak\Reports\test.rpt" %>'
Okay well that has solved the invalid escape sequence thingie, BUT :) now I am getting the following error
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
CrystalDecisions.Web..get_7() +189
CrystalDecisions.Web.CrystalReportViewer.OnInit(EventArgs e) +352
System.Web.UI.Control.InitRecursive(Control namingContainer) +235
System.Web.UI.Control.InitRecursive(Control namingContainer) +179
System.Web.UI.Control.InitRecursive(Control namingContainer) +179
System.Web.UI.Page.ProcessRequestMain() +169Would this be a problem with the actual report (which seems to work fine of opened in Crystal) or is it still a coding error? Thanks