Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 12th, 2005, 01:20 PM
Authorized User
 
Join Date: Mar 2005
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to aehb
Default Error on crystal report

I made a simple Access database consisting of one table for a phone index that includes the following fields: Name, Home Phone, Mobile Phone, and I make a crystal report which uses this database as data source. The problem arises when I try to view the report in my application using the CrystalReportViewer control, I get an error message says "Buffer too small ..... null string" or something alike, I don't remember the message precisely, can any one please tell me where is the mistake and how can I solve that??? Thanks a lot for your help, by the way; all the fields are of type string
 
Old March 14th, 2005, 12:38 AM
Authorized User
 
Join Date: Mar 2005
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to aehb
Default

I found the error,

that was because of the path of the database file was tooooooooooooo long:
"D:\Documents and Settings\Eihab.BENHA-7105CAE04\My Documents\Visual Studio
Projects\CSharp Projects\My Database Projects\Crystal Reports Projects\Chapter02
\CustomerListing\PhoneIndex.mdb"

and it works with me now, but a new problem arises:
I specify the data source when I make the report, and on the output the whole database is
displayed, but what if I want to filter it, something like:
"select * from phoneIndex where area = 'cairo'" ?

of course I can make the query at the design time of the report, but no, I want to make
it at the run time to enable the user to search the index.

I tried to get the search subset nad bind it to a ReportDocument Object, but I still get
the full records of the database:

////////////////////////////////////////////////////////////////
string connectionString = "provider=Microsoft.JET.OLEDB.4.0; "
                + "data source = .\\phoneindex.mdb";
            string commandString = "select * from PhoneIndex where area = 'cairo'";

            dataAdapter = new OleDbDataAdapter(commandString, connectionString);
            dataSet = new DataSet();
            dataAdapter.Fill(dataSet);

            reportDocument1 = new CrystalDecisions.CrystalReports.Engine.ReportDocum ent();
            string path = @"D:\Documents and Settings\Eihab.BENHA-7105CAE04\My Documents\Visual Studio Projects\CSharp Projects\My Database Projects\Crystal Reports Projects\Chapter02\CustomerListing\CrystalReport1. rpt";
            reportDocument1.Load(path);
            reportDocument1.SetDataSource(dataSet);
            reportDocument1.Refresh();
            crystalReportViewer1.ReportSource = reportDocument1;
////////////////////////////////////////////////////////////////


I hope to get help from you how can I do that, thanks a lot.





Similar Threads
Thread Thread Starter Forum Replies Last Post
error in crystal report naeem_wajid BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 0 November 30th, 2007 06:54 AM
crystal report error azymd777 Crystal Reports 0 July 3rd, 2007 10:52 PM
crystal report error sureshbabu Crystal Reports 3 September 11th, 2006 01:42 AM
I get error in Crystal Report, can you help? aehb BOOK: Professional Crystal Reports for VS.NET 1 March 14th, 2005 12:36 AM
Error While printing report (Crystal report) vikaspaweb Pro VB 6 0 March 8th, 2004 09:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.