473,385 Members | 1,400 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,385 software developers and data experts.

Generate a Crystal Report with a Parameter

I have a crystal report which I need my application to generate. I can
do it like this:

ReportDocument thisReport = new ReportDocument();
thisReport.Load(inFilename);
thisReport.Refresh();
thisReport.ExportToDisk(ExportFormatType.PortableD ocFormat,outputFilename);
thisReport.Close();

This works perfectly. Now I have a crystal report that takes a
parameter called "FirewallId". I have tried to make the code like
this:

ReportDocument thisReport = new ReportDocument();
thisReport.Load(inFilename);
thisReport.SetParameterValue("FirewallId",25);
thisReport.Refresh();
thisReport.ExportToDisk(ExportFormatType.PortableD ocFormat,outputFilename);
thisReport.Close();

but I get missing parameter value. When I inspect "thisReports" fields
I am told there are two *more* parameters both called intid. Setting
them gives me errors - You cannot set parameters on linked fields and
not setting them gives me missing parameters error.

Can anyone help me please?
Jun 27 '08 #1
2 5697
Try something like this, to see all the Parameter fields, and then just set
them

foreach (ParameterField field in thisReport.ParameterFields)
{
MessageBox.Show(field.Name);
thisReport.SetParameterValue(field.Name,"whateverv alue");
}

"Philluminati" <Ph*****************@gmail.comwrote in message
news:8c**********************************@m45g2000 hsb.googlegroups.com...
>I have a crystal report which I need my application to generate. I can
do it like this:

ReportDocument thisReport = new ReportDocument();
thisReport.Load(inFilename);
thisReport.Refresh();
thisReport.ExportToDisk(ExportFormatType.PortableD ocFormat,outputFilename);
thisReport.Close();

This works perfectly. Now I have a crystal report that takes a
parameter called "FirewallId". I have tried to make the code like
this:

ReportDocument thisReport = new ReportDocument();
thisReport.Load(inFilename);
thisReport.SetParameterValue("FirewallId",25);
thisReport.Refresh();
thisReport.ExportToDisk(ExportFormatType.PortableD ocFormat,outputFilename);
thisReport.Close();

but I get missing parameter value. When I inspect "thisReports" fields
I am told there are two *more* parameters both called intid. Setting
them gives me errors - You cannot set parameters on linked fields and
not setting them gives me missing parameters error.

Can anyone help me please?

Jun 27 '08 #2
On May 23, 7:54*am, Philluminati <Phillip.Ross.Tay...@gmail.com>
wrote:
I have a crystal report which I need my application to generate. I can
do it like this:

ReportDocument thisReport = new ReportDocument();
thisReport.Load(inFilename);
thisReport.Refresh();
thisReport.ExportToDisk(ExportFormatType.PortableD ocFormat,outputFilename);
thisReport.Close();

This works perfectly. Now I have a crystal report that takes a
parameter called "FirewallId". I have tried to make the code like
this:

ReportDocument thisReport = new ReportDocument();
thisReport.Load(inFilename);
thisReport.SetParameterValue("FirewallId",25);
thisReport.Refresh();
thisReport.ExportToDisk(ExportFormatType.PortableD ocFormat,outputFilename);
thisReport.Close();

but I get missing parameter value. When I inspect "thisReports" fields
I am told there are two *more* parameters both called intid. Setting
them gives me errors - You cannot set parameters on linked fields and
not setting them gives me missing parameters error.

Can anyone help me please?
Hi,

you use ReportDocument.SetParameterValue()
Jun 27 '08 #3

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

Similar topics

1
by: Kapil Shah via DotNetMonster.com | last post by:
Hello everybody, I am trying to create a web application to generate Crystal Report with Parameters. However I noticed that ReportDocument.Load is used twice when the parameter page is loaded ....
0
by: ashok.ponnusamy | last post by:
hi, i was created crystal report in my aspx. it's work fine. but i want to change the parameter value by selecting value from dropdownlist in the aspx page. First time it's work fine.second time...
2
by: mounilkadakia | last post by:
I have a CrystalReportViewer(crv) on my form. I also have a dataset (dtsReportData) populated with the required data and i have a ReportDocument (rdReport) object. The data source for the crystal...
2
by: Badis | last post by:
Hi Guys, I'm new in using crystal reports with c#.net. I have a set of data coming from textboxes in a web form and I would like to generate a crystal report dynamically with a given name that I...
0
by: Badis | last post by:
Hi, How to generate a Crystal report dynamically the way that I can define the name of my report in run time. without having to go to Solution...|Add Item....|Cryustal Report ....etc Thanks
0
by: siddu | last post by:
Hi All, I know how to create a parameter field and Formulafield. Please tell me How to use parameter field in my Report. I Created one parameter field with name.A window opened which taking...
0
by: Shivajirp | last post by:
I want to generate crystal report by passing SQL query from the from VB form. I need help steps involved in crystal report designing and VB6 code and also I want to plot graph and show pictures
0
by: sujithck | last post by:
Hi, is it possible to generate a report using crystal report in C#.net with database as mysql5. Now i can't get the database tables when i design the report. So, how can i browse the...
0
by: SLauren | last post by:
Hi, I am new to crystal report. Can anyone please suggest how can i generate a crystal report using dataset without a report object? I have a crystal report (.rpt) with a mapped dataset. How can...
3
by: Noorain | last post by:
hi i use following codes. here crystal report open in pdf format. <?php //- Variables - for your RPT and PDF //echo "Print Report Test";
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.