473,395 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Crystal Reports in ASP.NET

Hello,

I am trying to add some reporting features to a quite large asp.net web application. I have created a webform that contains a few fields for filtering data to be displayed in a Crystal Report.

I have created a sample report that has a few parameters but I cannot get any data returned to me if those parameters don't have values.

Is there a way for Crystal Reports to ignore parameters that don't have a value specified?

Or alternatively, is there a way to just change the set of data (maybe with the use of a System.DataSet) that the report displays at run-time?

This is the code that i am using in order to pass the parameter values. If there is no value specified I use a different report that doesn't expect parameters simply because I get an error if I don't...

CrystalReportViewer1.ParameterFieldInfo.Clear();
if (docNumTxt.Text.Trim().Length > 0)
{
CrystalReportViewer1.ReportSource = Server.MapPath("ReportWithParam.rpt");
ParameterFields ParamFields = CrystalReportViewer1.ParameterFieldInfo;
ParameterField p_docID = new ParameterField();
p_docID.Name = "p_DOC";
ParameterDiscreteValue p_docID_Value = new ParameterDiscreteValue();
p_docID_Value.Value = docNumTxt.Text;
p_docID.CurrentValues.Add(p_docID_Value);
ParamFields.Add(p_docID);
}
else
{
CrystalReportViewer1.ReportSource = Server.MapPath("ReportWithoutParam.rpt");
}

Thanks in advance, I know my knowledge on the subject is sub-standard however I have a very important deadline coming up and I really need some help.

TedManowar
Sep 4 '07 #1
1 1583
Hello again,


I believe that I have solved all my problems with Crystal Reports with a pretty easy solution. Instead of creating parameters for the reports i simply change the report query (using CR syntax) on runtime depending on what the user has filled in.

This is the code which I recommend to anyone that wants to filter the report data. It is the easiest way...

CrystalReportViewer1.ParameterFieldInfo.Clear();

CrystalReportViewer1.ReportSource = Server.MapPath("DocumentReport.rpt");

if (docNumTxt.Text.Trim().Length > 0)

{

CrystalReportViewer1.SelectionFormula = "{DOCUMENT.DOC} = " + docNumTxt.Text.Trim() + "";

}

CrystalReportViewer1.RefreshReport();

TedManowar



PS: Crystal Reports are by far the most frustrating reporting tool that I have ever used... I have learned other reporting tools for .NET e.g. telerik Reporting, within minutes...
Sep 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
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...
5
by: BStorm | last post by:
I have a transaction log file where the DataSet table's Description column is actually delimited into "subcolumns" based upon the transaction id. I would like to parse these into separate fields...
3
by: Gheaci Maschl | last post by:
Hi all! I would like to have your opinion about my problem and my proposal how to solve it: Ingredients: - BTriev database - Crystal Reports - maybe MS Access - Liinos6 (small ERP software)
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
0
by: Robert Warnestam | last post by:
Hello, I have some problems deploying Crystal Reports. I'm using Visual Studio 2005 Beta 1. In this version Crystal Reports (9.7.3500.0) is included. I created a small test application...
3
by: VMI | last post by:
I know this may not be the best NG for this, but I feel you guys know more about this than any of the other NGs. I need to build several simple reports (over 50 of them and they get their data...
1
by: Lyners | last post by:
Hello all, I have created an ASP.NET website that uses Crystal Reports that works on the localhost (my PC), but when I copy it to the server it does not. The problem is...
2
by: =?Utf-8?B?Um9zcyBNYXNvbg==?= | last post by:
Hi I am interested in using crystal reports for the first time but have a few questions that someone maybe able to help with before I get started. The background to my query is that a client is...
3
by: Miro | last post by:
Hi, Just wondering what a good book is on visual studios 2008 ( or 2005 if no 2008 ) that teaches you how to properly use crystal reports with it. Or im assuming that as long as I can create a...
1
by: =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?= | last post by:
On reflection, you could possibly make the app a self extracting zip file which extracts the EXE and a settings file and then starts the app, then when you app closes, it can repack the settings...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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
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,...

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.