I have a crystal report that i added datasources to that are classes made
from linq-to-sql designer.
This report errors trying to find logon info when i tell it export data or
use it in a viewer. There is no logon info so whats up?
I am settings the SetDataSource method with the object returned from the
LINQ query. Here's the code. The report simply has the .net object classes i
selected from the available data sources.


ABBDBDataContext db = new ABBDBDataContext();
IEnumerable<Order> o = from t in db.Orders
where t.ID == orderid
select t;

if (o == null)
return;

ABB.Reports.Invoice inv = new ABB.Reports.Invoice();

inv.SetDataSource(o);

inv.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat,
"c:\test.pdf");

Re: Crystal Report Error with datasource of linq-to-sql classes by Jon

Jon
Thu Mar 13 15:02:32 CDT 2008

Trolane <Trolane@discussions.microsoft.com> wrote:
> I have a crystal report that i added datasources to that are classes made
> from linq-to-sql designer.
> This report errors trying to find logon info when i tell it export data or
> use it in a viewer. There is no logon info so whats up?
> I am settings the SetDataSource method with the object returned from the
> LINQ query. Here's the code. The report simply has the .net object classes i
> selected from the available data sources.
>
>
> ABBDBDataContext db = new ABBDBDataContext();
> IEnumerable<Order> o = from t in db.Orders
> where t.ID == orderid
> select t;
>
> if (o == null)
> return;
>
> ABB.Reports.Invoice inv = new ABB.Reports.Invoice();
>
> inv.SetDataSource(o);
>
> inv.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat,
> "c:\test.pdf");

If you run the query outside Crystal Reports, does it work? Have you
included the connection string in your .config file?

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Re: Crystal Report Error with datasource of linq-to-sql classes by Trolane

Trolane
Thu Mar 13 15:09:01 CDT 2008

hi, ya it has nothing to do with my linq setup.
its crystal reports saying it expects a database connection for each .net
object i added as a datasource.


"Jon Skeet [C# MVP]" wrote:

> Trolane <Trolane@discussions.microsoft.com> wrote:
> > I have a crystal report that i added datasources to that are classes made
> > from linq-to-sql designer.
> > This report errors trying to find logon info when i tell it export data or
> > use it in a viewer. There is no logon info so whats up?
> > I am settings the SetDataSource method with the object returned from the
> > LINQ query. Here's the code. The report simply has the .net object classes i
> > selected from the available data sources.
> >
> >
> > ABBDBDataContext db = new ABBDBDataContext();
> > IEnumerable<Order> o = from t in db.Orders
> > where t.ID == orderid
> > select t;
> >
> > if (o == null)
> > return;
> >
> > ABB.Reports.Invoice inv = new ABB.Reports.Invoice();
> >
> > inv.SetDataSource(o);
> >
> > inv.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat,
> > "c:\test.pdf");
>
> If you run the query outside Crystal Reports, does it work? Have you
> included the connection string in your .config file?
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> World class .NET training in the UK: http://iterativetraining.co.uk
>

Re: Crystal Report Error with datasource of linq-to-sql classes by Jon

Jon
Thu Mar 13 15:23:00 CDT 2008

Trolane <Trolane@discussions.microsoft.com> wrote:
> hi, ya it has nothing to do with my linq setup.
> its crystal reports saying it expects a database connection for each .net
> object i added as a datasource.

That sounds very odd indeed. Could you post the exact error message,
including a stack trace if you've got one?

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Re: Crystal Report Error with datasource of linq-to-sql classes by Trolane

Trolane
Thu Mar 13 15:33:03 CDT 2008

CrystalDecisions.CrystalReports.Engine.LogOnException was unhandled by user
code
Message="Logon failed.\nDetails: crdb_adoplus : Object reference not set
to an instance of an object.\rError in File
C:\\Users\\Aaron\\AppData\\Local\\Temp\\temp_282d1676-8da7-4872-9948-0a1128f99059
{616FB1AC-0B3C-4F6B-ABE0-8AD7FD2725E4}.rpt:\nUnable to connect: incorrect log
on parameters."
Source="CrystalDecisions.ReportAppServer.DataSetConversion"
StackTrace:
at
CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
at
CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
at
CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
at
CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
at
CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk(ExportFormatType formatType, String fileName)
at ABB.Invoice.Page_Load(Object sender, EventArgs e) in
C:\Users\Aaron\Documents\Visual Studio
2008\Projects\ABB\ABB\Invoice.aspx.cs:line 40
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp,
Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object
sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException: System.Runtime.InteropServices.COMException
Message="Logon failed.\nDetails: crdb_adoplus : Object reference not
set to an instance of an object.\rError in File
C:\\Users\\Aaron\\AppData\\Local\\Temp\\temp_282d1676-8da7-4872-9948-0a1128f99059
{616FB1AC-0B3C-4F6B-ABE0-8AD7FD2725E4}.rpt:\nUnable to connect: incorrect log
on parameters."
Source=""
ErrorCode=-2147217393
StackTrace:
at
CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
at
CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
InnerException:


"Jon Skeet [C# MVP]" wrote:

> Trolane <Trolane@discussions.microsoft.com> wrote:
> > hi, ya it has nothing to do with my linq setup.
> > its crystal reports saying it expects a database connection for each .net
> > object i added as a datasource.
>
> That sounds very odd indeed. Could you post the exact error message,
> including a stack trace if you've got one?
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> World class .NET training in the UK: http://iterativetraining.co.uk
>

Re: Crystal Report Error with datasource of linq-to-sql classes by Jon

Jon
Thu Mar 13 15:40:58 CDT 2008

Trolane <Trolane@discussions.microsoft.com> wrote:
> CrystalDecisions.CrystalReports.Engine.LogOnException was unhandled by user
> code
> Message="Logon failed.\nDetails: crdb_adoplus : Object reference not set
> to an instance of an object.\rError in File
> C:\\Users\\Aaron\\AppData\\Local\\Temp\\temp_282d1676-8da7-4872-9948-0a1128f99059
> {616FB1AC-0B3C-4F6B-ABE0-8AD7FD2725E4}.rpt:\nUnable to connect: incorrect log
> on parameters."

Okay, that's not saying it's failing to *find* the log on parameters -
they're just incorrect.

Is it possible that this is due to the account that ASP.NET is running
under? Can you see the data from other pages in the same web app?

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Re: Crystal Report Error with datasource of linq-to-sql classes by Trolane

Trolane
Thu Mar 13 15:50:03 CDT 2008

there are no logon parameters. crystal isnt talking to sql server. the linq
is and the linq is reading from the web.config for the connection string.
the linq woirks all over the site and its in the debugger so there is no
permission issues because it runs as admin.


"Jon Skeet [C# MVP]" wrote:

> Trolane <Trolane@discussions.microsoft.com> wrote:
> > CrystalDecisions.CrystalReports.Engine.LogOnException was unhandled by user
> > code
> > Message="Logon failed.\nDetails: crdb_adoplus : Object reference not set
> > to an instance of an object.\rError in File
> > C:\\Users\\Aaron\\AppData\\Local\\Temp\\temp_282d1676-8da7-4872-9948-0a1128f99059
> > {616FB1AC-0B3C-4F6B-ABE0-8AD7FD2725E4}.rpt:\nUnable to connect: incorrect log
> > on parameters."
>
> Okay, that's not saying it's failing to *find* the log on parameters -
> they're just incorrect.
>
> Is it possible that this is due to the account that ASP.NET is running
> under? Can you see the data from other pages in the same web app?
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> World class .NET training in the UK: http://iterativetraining.co.uk
>

Re: Crystal Report Error with datasource of linq-to-sql classes by Jon

Jon
Thu Mar 13 16:11:34 CDT 2008

Trolane <Trolane@discussions.microsoft.com> wrote:
> I have a crystal report that i added datasources to that are classes made
> from linq-to-sql designer.
> This report errors trying to find logon info when i tell it export data or
> use it in a viewer. There is no logon info so whats up?
> I am settings the SetDataSource method with the object returned from the
> LINQ query. Here's the code. The report simply has the .net object classes i
> selected from the available data sources.
>
>
> ABBDBDataContext db = new ABBDBDataContext();
> IEnumerable<Order> o = from t in db.Orders
> where t.ID == orderid
> select t;
>
> if (o == null)
> return;
>
> ABB.Reports.Invoice inv = new ABB.Reports.Invoice();
>
> inv.SetDataSource(o);
>
> inv.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat,
> "c:\test.pdf");

No sub-reports that need extra data? I'm grasping at straws here, to be
honest, based on Google searches you've probably done yourself...

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Re: Crystal Report Error with datasource of linq-to-sql classes by Trolane

Trolane
Fri Mar 14 10:07:04 CDT 2008

nope :(
and i don't use google hehe. Gotta stick by Microsoft as much as possible.


"Jon Skeet [C# MVP]" wrote:

> Trolane <Trolane@discussions.microsoft.com> wrote:
> > I have a crystal report that i added datasources to that are classes made
> > from linq-to-sql designer.
> > This report errors trying to find logon info when i tell it export data or
> > use it in a viewer. There is no logon info so whats up?
> > I am settings the SetDataSource method with the object returned from the
> > LINQ query. Here's the code. The report simply has the .net object classes i
> > selected from the available data sources.
> >
> >
> > ABBDBDataContext db = new ABBDBDataContext();
> > IEnumerable<Order> o = from t in db.Orders
> > where t.ID == orderid
> > select t;
> >
> > if (o == null)
> > return;
> >
> > ABB.Reports.Invoice inv = new ABB.Reports.Invoice();
> >
> > inv.SetDataSource(o);
> >
> > inv.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat,
> > "c:\test.pdf");
>
> No sub-reports that need extra data? I'm grasping at straws here, to be
> honest, based on Google searches you've probably done yourself...
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> World class .NET training in the UK: http://iterativetraining.co.uk
>

Re: Crystal Report Error with datasource of linq-to-sql classes by Trolane

Trolane
Wed Apr 16 08:17:03 CDT 2008

i never found a solution for it. Ended up making a dataset and loading that
with the data from the LINQ. such a waste of resources to do it though.


"Sachin poddar" wrote:

>
>
> Hi, I am having the similar problem. I am using visual studio 2008
> having Project's .net objects as data source When I assign the .net
> objects as new data source at run time report prompts me to enter
> database login & password which fails to login.
>
> *** Sent via Developersdex http://www.developersdex.com ***
>