473,657 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Crystal Report Unbound Fields

Hello,

I am trying to build a Crystal report VisualStudio.NE T for an ASP.NET
application. I would like to build a report that doesn't connect to
any particular database at design time because I am planning to pass a
dataset to the report at runtime. From what I have read, it sounds
like unbound fields might be the answer. However, I am having trouble
figuring out how to bind these unbound fields to my dataset at
runtime.

Any help would be greatly appreciated! thanks, --Rick

//Here is the code I have so far...
ReportDocument crReportDocumen t = new ReportDocument( );

//Grab the dataset from session
DataSet ds = (DataSet)Sessio n["CRDataset"];
DataTable dt = ds.Tables["MY_TABLE"];

//load the report from disk
crReportDocumen t.Load(@"C:\Ine tpub\wwwroot\My App\Reports\MyS ummary.rpt");
crReportDocumen t.SetDataSource (dt);

//*************** **************
// TODO: I have an unbound field named "UnboundString1 "
// I need to assign a column from the dataset to that field.
// Is that possible on an ASP.NET application
//*************** **************

//set the options for saving the exported file to disk
DiskFileDestina tionOptions dfdOptions = new
DiskFileDestina tionOptions();
dfdOptions.Disk FileName = strPathFname;

//set the exporting information
ExportOptions crExportOptions = new ExportOptions() ;
crExportOptions = crReportDocumen t.ExportOptions ;
crExportOptions .DestinationOpt ions = dfdOptions;
crExportOptions .ExportDestinat ionType =
ExportDestinati onType.DiskFile ;
crExportOptions .ExportFormatTy pe = ExportFormatTyp e.PortableDocFo rmat;

//Export the report and write the file to the client browser
crReportDocumen t.Export();
Jul 21 '05 #1
4 14268
There's getting to be quite a few Crystal questions in these groups. Does
anyone know how we can get MS to add a
microsoft.publi c.dotnet.crysta lreports group?

Sorry for not being able to help with your question. <g>

Scott
I am trying to build a Crystal report VisualStudio.NE T for an ASP.NET

Jul 21 '05 #2
UPDATE: I emailed crystal about this subject and here is there response:

Hello Rick,

First I would like to thank you for using Answer By Emails (ABE) service.

Unfortunately, unbound field is not supported in Crystal Reports for
VS.NET.

For information on using Crystal Reports for Visual Studio .NET with
ADO.NET, go to 'http://support.crystal decisions.com/docs' and search for:
'crnet_adonet.p df'

For a sample application demonstrating passing an ADO.NET dataset to a
report, go to http://support.crystaldecisions.com/download and search for:
Vbnet_win_adodo tnet.exe
ri*******@allia ntenergy.com (Rick Thiel) wrote in message news:<39******* *************** ****@posting.go ogle.com>...
Hello,

I am trying to build a Crystal report VisualStudio.NE T for an ASP.NET
application. I would like to build a report that doesn't connect to
any particular database at design time because I am planning to pass a
dataset to the report at runtime. From what I have read, it sounds
like unbound fields might be the answer. However, I am having trouble
figuring out how to bind these unbound fields to my dataset at
runtime.

Any help would be greatly appreciated! thanks, --Rick

//Here is the code I have so far...
ReportDocument crReportDocumen t = new ReportDocument( );

//Grab the dataset from session
DataSet ds = (DataSet)Sessio n["CRDataset"];
DataTable dt = ds.Tables["MY_TABLE"];

//load the report from disk
crReportDocumen t.Load(@"C:\Ine tpub\wwwroot\My App\Reports\MyS ummary.rpt");
crReportDocumen t.SetDataSource (dt);

//*************** **************
// TODO: I have an unbound field named "UnboundString1 "
// I need to assign a column from the dataset to that field.
// Is that possible on an ASP.NET application
//*************** **************

//set the options for saving the exported file to disk
DiskFileDestina tionOptions dfdOptions = new
DiskFileDestina tionOptions();
dfdOptions.Disk FileName = strPathFname;

//set the exporting information
ExportOptions crExportOptions = new ExportOptions() ;
crExportOptions = crReportDocumen t.ExportOptions ;
crExportOptions .DestinationOpt ions = dfdOptions;
crExportOptions .ExportDestinat ionType =
ExportDestinati onType.DiskFile ;
crExportOptions .ExportFormatTy pe = ExportFormatTyp e.PortableDocFo rmat;

//Export the report and write the file to the client browser
crReportDocumen t.Export();

Jul 21 '05 #3
Hello Rich,

Thanks for posting in the group and sharing the information here. I believe
it could help Crystal Report developers much here.

For the question, please try using the SetDataSource method to do it at
runtime.
Eg.:
myConn = new SqlConnection(" Server=.;Databa se=Northwind;In tegrated
Security=true;" );
SqlDataAdapter adapter = new SqlDataAdapter( "select EmployeeID, LastName,
Firstname, HireDate from employees",myCo nn);
adapter.Fill(my NorthwindDS,"Em ployees");
myNorthwindRepo rt.SetDataSourc e(myNorthwindDS );
crystalReportVi ewer1.ReportSou rce = myNorthwindRepo rt;

Hope that helps.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!From: ri*******@allia ntenergy.com (Rick Thiel)
!Newsgroups: microsoft.publi c.dotnet.genera l
!Subject: Re: Crystal Report Unbound Fields
!Date: 15 Sep 2003 06:13:28 -0700
!Organization: http://groups.google.com/
!Lines: 63
!Message-ID: <39************ **************@ posting.google. com>
!References: <39************ **************@ posting.google. com>
!NNTP-Posting-Host: 198.7.47.200
!Content-Type: text/plain; charset=ISO-8859-1
!Content-Transfer-Encoding: 8bit
!X-Trace: posting.google. com 1063631609 5918 127.0.0.1 (15 Sep 2003
13:13:29 GMT)
!X-Complaints-To: gr**********@go ogle.com
!NNTP-Posting-Date: 15 Sep 2003 13:13:29 GMT
!Path:
cpmsftngxa07.ph x.gbl!cpmsftngx a10.phx.gbl!TK2 MSFTNGXA05.phx. gbl!TK2MSFTNGP0 8
..phx.gbl!newsf eed00.sul.t-online.de!t-online.de!news-spur1.maxwell.s yr.edu!n
ews.maxwell.syr .edu!news-out1.nntp.be!pr opagator2-sterling!news-in-sterling.
newsfeed.com!pd 2nf1so.cg.shawc able.net!reside ntial.shaw.ca!s n-xit-03!sn-xit-
01!sn-xit-09!supernews.co m!postnews1.goo gle.com!not-for-mail
!Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.genera l:108219
!X-Tomcat-NG: microsoft.publi c.dotnet.genera l
!
!UPDATE: I emailed crystal about this subject and here is there response:
!
!Hello Rick,
!
!First I would like to thank you for using Answer By Emails (ABE) service.
!
!Unfortunately, unbound field is not supported in Crystal Reports for
!VS.NET.
!
!For information on using Crystal Reports for Visual Studio .NET with
!ADO.NET, go to 'http://support.crystal decisions.com/docs' and search for:
!'crnet_adonet. pdf'
!
!For a sample application demonstrating passing an ADO.NET dataset to a
!report, go to http://support.crystaldecisions.com/download and search for:
!Vbnet_win_adod otnet.exe
!
!
!ri*******@alli antenergy.com (Rick Thiel) wrote in message
news:<39******* *************** ****@posting.go ogle.com>...
!> Hello,
!>
!> I am trying to build a Crystal report VisualStudio.NE T for an ASP.NET
!> application. I would like to build a report that doesn't connect to
!> any particular database at design time because I am planning to pass a
!> dataset to the report at runtime. From what I have read, it sounds
!> like unbound fields might be the answer. However, I am having trouble
!> figuring out how to bind these unbound fields to my dataset at
!> runtime.
!>
!> Any help would be greatly appreciated! thanks, --Rick
!>
!> //Here is the code I have so far...
!> ReportDocument crReportDocumen t = new ReportDocument( );
!>
!> //Grab the dataset from session
!> DataSet ds = (DataSet)Sessio n["CRDataset"];
!> DataTable dt = ds.Tables["MY_TABLE"];
!>
!> //load the report from disk
!> crReportDocumen t.Load(@"C:\Ine tpub\wwwroot\My App\Reports\MyS ummary.rpt");
!> crReportDocumen t.SetDataSource (dt);
!>
!> //*************** **************
!> // TODO: I have an unbound field named "UnboundString1 "
!> // I need to assign a column from the dataset to that field.
!> // Is that possible on an ASP.NET application
!> //*************** **************
!>
!> //set the options for saving the exported file to disk
!> DiskFileDestina tionOptions dfdOptions = new
!> DiskFileDestina tionOptions();
!> dfdOptions.Disk FileName = strPathFname;
!>
!> //set the exporting information
!> ExportOptions crExportOptions = new ExportOptions() ;
!> crExportOptions = crReportDocumen t.ExportOptions ;
!> crExportOptions .DestinationOpt ions = dfdOptions;
!> crExportOptions .ExportDestinat ionType =
!> ExportDestinati onType.DiskFile ;
!> crExportOptions .ExportFormatTy pe = ExportFormatTyp e.PortableDocFo rmat;
!>
!> //Export the report and write the file to the client browser
!> crReportDocumen t.Export();
!

Jul 21 '05 #4
Hi, Scott

Crystal Reports has always generated a lot of questions.
Microsoft.publi c.vb.crystal gets a lot of traffic, but it also causes
confusion. because Crystal is not a Microsoft product, even though it
ships with VS.Net, Our policy has been to point our customers at Crystal's
site, http://www.crystaldecisions.com/ because that is where Crystal
Decisions has committed to be. They have a self-help section and they offer
phone & e-mail support. Their web sites states that you get two Crystal
incidents with the purchase of Visual Studio .NET.

I hope that this clarifies things a bit,

John Eikanger
Microsoft Developer Support

This posting is provided “AS IS” with no warranties, and confers no rights.
"Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward
steps listed to improve your computer’s security."

--------------------
| From: "Scott" <do**@email.m e>
| References: <39************ **************@ posting.google. com>
| Subject: Re: Crystal Report Unbound Fields
| Date: Sat, 13 Sep 2003 18:25:25 -0600
| Lines: 11
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
|
| There's getting to be quite a few Crystal questions in these groups. Does
| anyone know how we can get MS to add a
| microsoft.publi c.dotnet.crysta lreports group?
|
| Sorry for not being able to help with your question. <g>
|
| Scott
|
| > I am trying to build a Crystal report VisualStudio.NE T for an ASP.NET
|
|
|

Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
19160
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal Report at runtime? Example: private void button1_Click(object sender,
0
2571
by: Steve | last post by:
I know this might not be the best place to get help for this particular problem, but here goes.. The 2nd edition of ProfessionalCrystal Reports for Visual Studio .NET states "you will learn how to bind data from your project with this field..." regarding unbound fields. I cannot find where this is explained anywhere in the book I want to assign a string to an unbound field in my Crystal Report and I can't figure out the code This is...
2
18856
by: Pierre | last post by:
Hi, Can anyone tell me how I can populate Crystal Reports, using a DataTable in C#? Regards, Pierre
3
5235
by: Diggler | last post by:
I was working on a report that is populated with three different tables in a strongly-typed dataset. The tables are populated from custom objects rather than directly from SQL Server. I loop through the objects and add the rows one at a time. I then push the dataset to the Crystal Report. The report worked fine, until this morning. I added another field or two to the dataset, and rearranged the report fields to organize the report...
0
303
by: Téo | last post by:
Hi, I have created a crytal report based on a table of my SQL Server. Everything works fine. I would like now to fill my report with a sql request in the code behind instead of the table in the crystal report. But in the following code, the dataset created isn't "used" by the crystal report wich continues to use the table. And if i delete the table in the crystal report to use unbound fields, it doesn't work.
3
1649
by: Téo | last post by:
I don't see my question with my newsreader, just try to post a last time, sorry if it's (one more...) bug of OE... Hi, I have created a crytal report based on a table of my SQL Server. Everything works fine. I would like now to fill my report with a sql request in the code behind instead of the table in the crystal report. But in the following code, the dataset created isn't "used" by the crystal
4
517
by: Rick Thiel | last post by:
Hello, I am trying to build a Crystal report VisualStudio.NET for an ASP.NET application. I would like to build a report that doesn't connect to any particular database at design time because I am planning to pass a dataset to the report at runtime. From what I have read, it sounds like unbound fields might be the answer. However, I am having trouble figuring out how to bind these unbound fields to my dataset at runtime.
3
36448
by: Tmuld | last post by:
Hello, I was provided a .rpt file which is Crystal Reports report. It opened with VS .NET 2003. On the left side in the Field Explorer - there are seveal categories - Database Fields - Formula Fields
0
1873
by: amiga500 | last post by:
Hello, I am developing a crystal report called Expense Report (I am not an expert Crystal Report designer) if someone could help me in this problem I would be greatly appreciate it. The report would be as follows: Description Sun Mon
0
8421
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8325
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8844
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8518
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8621
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7354
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6177
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.