473,503 Members | 1,869 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.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.

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

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

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

//load the report from disk
crReportDocument.Load(@"C:\Inetpub\wwwroot\MyApp\R eports\MySummary.rpt");
crReportDocument.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
DiskFileDestinationOptions dfdOptions = new
DiskFileDestinationOptions();
dfdOptions.DiskFileName = strPathFname;

//set the exporting information
ExportOptions crExportOptions = new ExportOptions();
crExportOptions = crReportDocument.ExportOptions;
crExportOptions.DestinationOptions = dfdOptions;
crExportOptions.ExportDestinationType =
ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;

//Export the report and write the file to the client browser
crReportDocument.Export();
Jul 21 '05 #1
4 14233
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.public.dotnet.crystalreports group?

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

Scott
I am trying to build a Crystal report VisualStudio.NET 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.crystaldecisions.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_adodotnet.exe
ri*******@alliantenergy.com (Rick Thiel) wrote in message news:<39**************************@posting.google. com>...
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.

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

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

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

//load the report from disk
crReportDocument.Load(@"C:\Inetpub\wwwroot\MyApp\R eports\MySummary.rpt");
crReportDocument.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
DiskFileDestinationOptions dfdOptions = new
DiskFileDestinationOptions();
dfdOptions.DiskFileName = strPathFname;

//set the exporting information
ExportOptions crExportOptions = new ExportOptions();
crExportOptions = crReportDocument.ExportOptions;
crExportOptions.DestinationOptions = dfdOptions;
crExportOptions.ExportDestinationType =
ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;

//Export the report and write the file to the client browser
crReportDocument.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=.;Database=Northwind;Integra ted
Security=true;");
SqlDataAdapter adapter = new SqlDataAdapter("select EmployeeID, LastName,
Firstname, HireDate from employees",myConn);
adapter.Fill(myNorthwindDS,"Employees");
myNorthwindReport.SetDataSource(myNorthwindDS);
crystalReportViewer1.ReportSource = myNorthwindReport;

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*******@alliantenergy.com (Rick Thiel)
!Newsgroups: microsoft.public.dotnet.general
!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**********@google.com
!NNTP-Posting-Date: 15 Sep 2003 13:13:29 GMT
!Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTN GXA05.phx.gbl!TK2MSFTNGP08
..phx.gbl!newsfeed00.sul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!n
ews.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!news-in-sterling.
newsfeed.com!pd2nf1so.cg.shawcable.net!residential .shaw.ca!sn-xit-03!sn-xit-
01!sn-xit-09!supernews.com!postnews1.google.com!not-for-mail
!Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.general:108219
!X-Tomcat-NG: microsoft.public.dotnet.general
!
!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.crystaldecisions.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_adodotnet.exe
!
!
!ri*******@alliantenergy.com (Rick Thiel) wrote in message
news:<39**************************@posting.google. com>...
!> 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.
!>
!> Any help would be greatly appreciated! thanks, --Rick
!>
!> //Here is the code I have so far...
!> ReportDocument crReportDocument = new ReportDocument();
!>
!> //Grab the dataset from session
!> DataSet ds = (DataSet)Session["CRDataset"];
!> DataTable dt = ds.Tables["MY_TABLE"];
!>
!> //load the report from disk
!> crReportDocument.Load(@"C:\Inetpub\wwwroot\MyApp\R eports\MySummary.rpt");
!> crReportDocument.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
!> DiskFileDestinationOptions dfdOptions = new
!> DiskFileDestinationOptions();
!> dfdOptions.DiskFileName = strPathFname;
!>
!> //set the exporting information
!> ExportOptions crExportOptions = new ExportOptions();
!> crExportOptions = crReportDocument.ExportOptions;
!> crExportOptions.DestinationOptions = dfdOptions;
!> crExportOptions.ExportDestinationType =
!> ExportDestinationType.DiskFile;
!> crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
!>
!> //Export the report and write the file to the client browser
!> crReportDocument.Export();
!

Jul 21 '05 #4
Hi, Scott

Crystal Reports has always generated a lot of questions.
Microsoft.public.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.me>
| 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.public.dotnet.general
|
| 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.public.dotnet.crystalreports group?
|
| Sorry for not being able to help with your question. <g>
|
| Scott
|
| > I am trying to build a Crystal report VisualStudio.NET 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
19127
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...
0
2545
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...
2
18835
by: Pierre | last post by:
Hi, Can anyone tell me how I can populate Crystal Reports, using a DataTable in C#? Regards, Pierre
3
5226
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...
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...
3
1633
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....
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...
3
36432
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 -...
0
1859
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...
0
7093
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...
0
7348
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7006
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...
0
7467
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...
0
5592
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,...
1
5021
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...
0
4685
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3175
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...
0
397
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.