PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

Dataset created in Code cannot be used in Crystal Reports designer

 
 
=?Utf-8?B?Q2hyaXM=?=
Guest
Posts: n/a
 
      28th Jan 2005
Hello,

I've created a Dataset in code on my form based on an OLEDB provider also
created in code. I want to be able to use this dataset in a Crystal Report,
but the dataset is not listed in the report designer? I'm not sure how to
resolve this problem, any ideas are helpfull.

Thank you
 
Reply With Quote
 
 
 
 
Sahil Malik
Guest
Posts: n/a
 
      28th Jan 2005
You need to create an XSD that mimics this dataset created in code and
specify that as the datasource for your crystal report. That'll give you
various fields you can databind with on the report, then with a little C#
magic you can easily bind the dataset to the report.

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik


"Chris" <(E-Mail Removed)> wrote in message
news:1BB2AD73-8ED3-4D45-A675-(E-Mail Removed)...
> Hello,
>
> I've created a Dataset in code on my form based on an OLEDB provider also
> created in code. I want to be able to use this dataset in a Crystal
> Report,
> but the dataset is not listed in the report designer? I'm not sure how to
> resolve this problem, any ideas are helpfull.
>
> Thank you



 
Reply With Quote
 
Norman Yuan
Guest
Posts: n/a
 
      28th Jan 2005
I like to use DataSet created at runtime as report data source. As you
already know, if it is not a strong named DataSet (no XSD file exist in
design time), it will not listed in report designer. There is a simple way
to solve this, though. You simply specify a dummy "SELECT..." SQL Statement
in the report designer as data source, which contains all the columns in you
DataSet. Say, you want a table in the dataset to be a report's source, which
has columns: "Persion", "LastName", "FirstName", "BirthDate", "Height".
Then, in the report designer, point the report source to a command with this
SQL Statement:

"SELECT '' AS Person,'' AS FirstName,'' AS LastName,NULL AS BirthDate,0.00
AS Height FROM AnyTable WHERE 1=2"

Of course this SQL won't grab any record from a database. You will PUSH your
own dataset at runtime to the report, right?

"Chris" <(E-Mail Removed)> wrote in message
news:1BB2AD73-8ED3-4D45-A675-(E-Mail Removed)...
> Hello,
>
> I've created a Dataset in code on my form based on an OLEDB provider also
> created in code. I want to be able to use this dataset in a Crystal

Report,
> but the dataset is not listed in the report designer? I'm not sure how to
> resolve this problem, any ideas are helpfull.
>
> Thank you



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Studio DataSet designer doesn't regenerate designer.cs code Barney Microsoft C# .NET 3 15th Oct 2007 04:15 PM
Crystal Reports ActiveX Designer can't connect to Oracle 10g Big George Microsoft ASP .NET 0 24th Nov 2006 02:05 PM
Crystal Reports customer designer Konrad Microsoft Dot NET 0 29th Nov 2004 05:14 AM
Customizing reports during runtime using Crystal Reports Designer? Eric Cherng Microsoft Dot NET Framework Forms 0 7th Apr 2004 07:44 PM
RE: Crystal Reports Designer: How do I set the ruler? Lion Shi Microsoft Dot NET Framework Forms 0 15th Jul 2003 01:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:57 AM.