|
Thanks and you are welcome
Pankaj A. Chitriv
|
|
|
|
|
CrystalDecisions.CrystalReport.Engine.ParameterFie ldCurrentValueException:
Missing parameter values.
This is the error that I get when the report is subjected to print.
Could you help me solve this?
Ansaf
|
|
|
|
|
Dear Pankaj A. Chitriv,
I look your example and have next question:
I have a report file.rpt and datasource is view (database in SQL Server).
I make a web page and put control crystalreportviewer and crystalreportsource.
In other web page have a gridview and button Report, I need to click button active crystalreport(file.rpt) and pass parameter where currentrowindex is posicionate in gridview.
How make this?
Can you help me please?
Thanks for your help,
Regards.
|
|
|
|
|
I have read your article, first thank you for you time. My questions is pretty straight forward, in your example you know all the stored procedures to call at design time, do you know of a way to get the name of the stored procedures at design time for the Crystal Parameters?
|
|
|
|
|
Hi,
I am working with asp.net 1.1(C#) and i want to show report using Crystal Report 9.0.I have written code to fill ado.net dataset and assign that dataset to crystalreport but it is giving error "LOGON FAILED".
Why this error is coming?
how can i resolve it.
Please Help..............
Thanks
Pramod
|
|
|
|
|
Can you try by giving enableUseridpassword for the crystalreportviewer false and try
|
|
|
|
|
How do we pass sql command parameter to Crystal Report?
For Example: Select * From TABLE Where VALUE = 5
Crystal Report must show the result of this query. Please help me. Thanks.
|
|
|
|
|
Hi!
You should see CrystalReport's RecordSelectionFormula property. You can set Primary key of the table according to you requirement like:
rpt.RecordSelectionFormula = "{YourTable.PrimaryKeyfieldName}=" & Val(TxtCode.Text)
Here:
txtcode.text will contain the value of the PrimaryKeyfieldName of the table.
Hope it helps!
|
|
|
|
|
I want to know if this code works for Oracle with the stored procedure? If not can someone give an example?
Also in your code: The stored procedure input parameters are: @vDepartment and @iSalesYear. I can see you setting the values for those parameters. But where are you setting the stored procedure name 'Sel_SalesData' and associating it to the report.
Can you please explain - Because I may have several stored procedures, how does the report know which stored procedure to call?
vhrao
-- modified at 18:07 Thursday 12th October, 2006
|
|
|
|
|
Thanks Pankaj,
Works great in VS 2005!!!! No Problems what-so-ever. Didn't have to change anything except Datasource location and DB logon (of course).
Don't let the negative posts keep you from adding more articles if so inclined. I wonder if the negative Nancy's are having trouble setting up the SQL Server end of it.
Thanks again for the effort.
|
|
|
|
|
VS 2003 + SQL2000
public virtual new void SetDatabaseLogon ( System.String user , System.String password , System.String server , System.String database )
CrystalDecisions.CrystalReports.Engine.ReportDocument
public virtual new void SetDatabaseLogon ( System.String user , System.String password )
CrystalDecisions.CrystalReports.Engine.ReportDocument
not the fifthly parameter??????????
ice.boat
mail:b_zhou_cn@yahoo.com
|
|
|
|
|
Hi, there,
I'm getting a problem when generating crystal report in .net.
There is always a popup window called " Database login", asking input for ServerName, Database, LoginId and password. And whatever login id and password I've enterred, It gives me the error message "Logon Failed. Please try again."
I've checked the SQL Server Enterprise Manager, the permission of the table I'm accessing has been setted up to public access. It doesn't seem like the problem.
So, any advice?
Thanks in advance.
|
|
|
|
|
Hi
I am developing a windows application in C#. I have a problem while using MS Sql Stored procesures in Crystal reports. If there are only select statements in procedure, it works fine. But if there is any insert statements in the stored procedure( of cource, the last statement I provided is a select statement to get the rows in report), no fields are listed while trying to create a report with the same. So I am unable to desingn the report with those procedures.
If anyone can give a solution, it will be a greate help for me.
Thanks
Gireesh Viswanathan
-- modified at 8:54 Tuesday 18th October, 2005
|
|
|
|
|
Gireesh
I am having the same problem. Did you ever resolve it?
I can't believe that stored procedures with INSERT cannot be used .NET.
Thanks.
Barry Walter
|
|
|
|
|
Recently I saw a documentation about this.
It says that you can get results from only your first query.
|
|
|
|
|
I'm trying to build an application in C# to export reports in HTML format and other...
But they are no possibilities for me to change the database location into the RPT file. I'm trying but still no result.
I've put the source code to change the database location what I used, help me please, I'm so tired to try and get damn errors who have no sense!
sc:
__________________________________________________________________________________________________________________________________
ReportDocument MyReport = new ReportDocument();
MyReport.Load(rpt_src);
MyReport.SetDatabaseLogon("user", "userpwd", "DSN", "DBName", false);
crystalReportViewer1.ReportSource = MyReport;
__________________________________________________________________________________________________________________________________
After that, the login box is shown to put the db's connection infos! Why?
I've tryed another methode to change the connection infos :
__________________________________________________________________________________________________________________________________
ReportDocument MyReport = new ReportDocument();
MyReport.Load(rpt_src);
for (int i = 0; i <= (MyReport.Database.Tables.Count)-1; i++)
{
TableLogOnInfo logOnInfo = new TableLogOnInfo();
logOnInfo = MyReport.Database.Tables[i].LogOnInfo;
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo = logOnInfo.ConnectionInfo;
connectionInfo.DatabaseName = database;
connectionInfo.ServerName = server;
connectionInfo.Password = password;
connectionInfo.UserID = user;
connectionInfo.AllowCustomConnection = true;
MyReport.Database.Tables[i].ApplyLogOnInfo(logOnInfo);
}
crystalReportViewer1.ReportSource = MyReport;
__________________________________________________________________________________________________________________________________
But nothing is better...
I don't understand what is the damn logic with CR ...
|
|
|
|
|
http://msdn.microsoft.com/msdnmag/issues/02/05/Crystal/
This article was particularly helpful to me. It even had some useful information on how to get the Procs available as a datasource and a bug in the Crystal Services under IIS. It explains parameters a bit, even admiting that they are somewhat convoluted.
Hope it helps.
|
|
|
|
|
Hi,
Could you please tell me how i show report contents on the bases of any input. I mean i have two tables [Stduent Master and Student Detail] one table have a field Student ID which is primary key and has two more field [ Student Name, Student Class]. In table two i have three record and Student Id as well, Now i want to show those record from Student Detail which have Student ID same in Crystal Report Detail Section.
StudentMaster.Student_id = StudentDetail.Student_ID
//Report Format
//Report Page Section
Student ID //From Master Table
Student Name //From Master Table
//Report Detail Section
Student ID | Student Fee Month | Student Fee
==============================================
1 | Jan | Rs 1,000
1 | Feb | Rs 1,000
1 | Mar | Rs 1,000
1 | Apr | Rs 1,000
==============================================
May be you got my points.Sorry for the English.
|Muhamad Waqas Butt|
waqasb4all@yahoo.com
www.sktech.freewebspace.com
|
|
|
|
|
Does anyone know how to make Crystal Reports prompt for parameter values when exporting or printing a report that has parameters. I am using VS.Net with the Crystal intergration. My application has reports that come standard with the application, but supports custom reports. If a user adds a custom report that has parameters and chooses to export or print the report, I get exceptions that the parameter has no value.
|
|
|
|
|
Hi everyone. I had the same problem with this article as you all seem to have: the Crystal Report in question was not created with the special OEM version of Crystal that is bundled with Visual Studio 2003, and it won't work.
However, all by my little self I managed to figger out how to use stored procs that have parameters with the Crystal Reports version that i s included with VS Studio 2003. It was agony, so I thought I'd share a bit so others don't have to go through the 2 days I did. I'm not going to include much code, but I don't need to.
Like most of you, probably, I asked myself, "OK, I see there are CR parameters, but where the f___ are the parms in the CR Report Expert or the Data Expert? How do I set the stored proc parm values like I do for an ADO.NET cmd in the CR object model? How do I pass through the values? Arrrghhhh!" Well, here's the big, dark secret: the CR parameters ARE the stored proc parameters; they're effectively the same thing!
Here's what happens: when you add a "table" to your CR report using the Report Export or whatever, and you choose a stored proc as the data source for that 'table', the CR designer *automatically* creates CR parameter fields that match any stored proc parameters. You can see them right after you add the table - in the Field Explorer when your report is an active window inside VS Studio 2003. Not only that, but you don't have to write any code to copy the values from the CR parameters to some stored proc parameter that's a property of the CR table object, or something, because there isn't any. CR just seems to do it for you. Is this explained ANYWHERE IN THE DOCUMENTATION OR ANYWHERE ON THE WEB? I couldn't find it, if there is. Somehow, we're all just supposed to know this? Anyway, I'm still a little bitter as you can see ... but my code now works!
To finish up, I'll explain that I have a C# web page that sets the values of 2 date fields. I simply pass those values to the CR parameter fields that got created in the CR designer in Visual STudio, and poof! it works. In my C# code-behind class, I used the SetParameterValue() method of the ReportDocument object like this:
_Report.SetParameterValue("@prmBeginDate", _ReportBeginDate);
_Report.SetParameterValue("@prmEndDate", _ReportEndDate);
However it happens, these values make it the stored proc in question; it's all very puzzling and not well documented. But don't ask questions, just do it. It works.
BillyB
|
|
|
|
|
Addendum to my previous post:
While the information I posted previously was accurate as far as it went, it didn't go far enough. The code worked - but only the first time. On subsequent postbacks, the web page did not use the new values of the parameters from the 2 lines of code I included. Upon further investigation, I learned that the SetParameterValue() method is not the way to go. If you want to set parameters and refresh the Crystal Report properly in an ASP.NET processing cycle, you need to use related methods of the CrystalDecisions.Web.CrystalReportViewer class instead. I've included code from the 3 relevant methods of my code-behind page below. Additional comments:
1. You must create the CR report object only once; save it to a session variable and reload on subsequent postbacks or you'll get weird results - sometimes works, sometimes doesn't, not to mention performance issues.
2. _Report and crViewer are my ReportDocument and CrystalReportViewer objects, respectively.
3. SetReportPrintOptions() and SetReportConnectionInfo() are methods of my own in the web page code-behind that set values in the ReportDocument object, but are not relevant to this discussion.
4. txtBeginDate and txtEndDate are the textbox controls on the web page where the date parameter values are set by users, and _ReportBeginDate and _ReportEndDate are DateTime fields of the code-behind class that I hold the values in before passing to the CR object in my SetReportParameters() method.
5. This code definitely works, definitely passes the correct values to a SQL Server 2000 stored proc, and definitely refreshes the report the user sees on his web page in round-trips to the server.
6. Apologies for my premature post. Hope this makes up for it.
private void Page_Load(object sender, System.EventArgs e)
{
if (this.IsPostBack)
{
ReLoadCrystalReport();
}
else // first-time stuff
{
InitCrystalReport();
}
/********** Code that's executed every time below here **********/
}
private void InitCrystalReport()
{
/* Set up begin, end dates with default values */
_ReportEndDate = DateTime.Now.Date.AddDays(1);
_ReportBeginDate = _ReportEndDate.AddYears(-2);
txtBeginDate.Text = _ReportBeginDate.ToShortDateString();
txtEndDate.Text = _ReportEndDate.ToShortDateString();
_Report = new crTotalShippedByDate();
SetReportPrintOptions();
SetReportConnectionInfo();
SetReportParameters();
crViewer.ReportSource = _Report;
Session["Report"] = _Report;
}
private void ReLoadCrystalReport()
{
_Report = (crTotalShippedByDate)Session["Report"];
_ReportBeginDate = Convert.ToDateTime(txtBeginDate.Text);
_ReportEndDate = Convert.ToDateTime(txtEndDate.Text);
SetReportParameters();
crViewer.ReportSource = _Report;
crViewer.RefreshReport();
}
private void SetReportParameters()
{
/* Begin Date */
ParameterField pfBeginDate = new ParameterField();
ParameterDiscreteValue pvBeginDate = new ParameterDiscreteValue();
pfBeginDate.ParameterFieldName = "@prmBeginDate";
pvBeginDate.Value = _ReportBeginDate;
pfBeginDate.CurrentValues.Add(pvBeginDate);
/* End Date */
ParameterField pfEndDate = new ParameterField();
ParameterDiscreteValue pvEndDate = new ParameterDiscreteValue();
pfEndDate.ParameterFieldName = "@prmEndDate";
pvEndDate.Value = _ReportEndDate;
pfEndDate.CurrentValues.Add(pvEndDate);
/* Add to viewer parameters */
ParameterFields pFields = new ParameterFields();
pFields.Add(pfBeginDate);
pFields.Add(pfEndDate);
crViewer.ParameterFieldInfo = pFields;
}
|
|
|
|
|
Logon Failed
Details: IM006: [Microsoft][ODBC DRIVER MANAGER]Driver's SQLSETCOnnectATTr field
Please let me know we got to use driver's provided by Crystal reports only?
Please Please mail me urgently?
** A Fighter Never Loses !!!!
|
|
|
|
|
hi sir,
I am Selvambikai.k.I am using asp.net with c# as code behind.Crystal report are already created by using stored procedures.Now I have to link the crystal report with webpage.I try to fill dataset and set datasource property to datagrid it will work but when I set datasurce property to report object it will show an error as missing parameter field value.I try to give @ nad ? infront of fieldname but no use.
please refer the coding
private void Page_Load(object sender, System.EventArgs e)
{
InputParameter();
}
public void InputParameter()
{
try
{
OracleConnection cn=new OracleConnection(constrg);
OracleCommand cmd=new OracleCommand();
cmd.Connection=cn;
cn.Open();
cmd.CommandText="PROC_RPT_IMMUNIZATION_RECORDS";
cmd.CommandType=CommandType.StoredProcedure;
OracleParameter p1=new OracleParameter();
p1.ParameterName="ImmunizationRecords";
p1.Value="ImmunizationRecords";
p1.Direction=ParameterDirection.Output;
p1.OracleType=OracleType.Cursor;
cmd.Parameters.Add(p1);
OracleParameter p2=new OracleParameter();
p2.ParameterName="NPATID";
p2.Value=2317530;
p2.Direction=ParameterDirection.Input;
p2.OracleType=OracleType.Number;
cmd.Parameters.Add(p2);
OracleDataAdapter da=new OracleDataAdapter(cmd);
DataSet ds=new DataSet();
da.Fill(ds);
rep.SetDataSource(ds);
CrystalReportViewer1.ReportSource=rep;
CrystalReportViewer1.DataBind();
CrystalReportViewer1.Visible=true;
DataGrid1.Visible=false;
//DataGrid1.DataSource=ds;
//DataGrid1.DataBind();
cn.Close();
}
catch(Exception ex)
{
Response.Write(ex.Message);
}
}
please reply soonIt is very urgent
many thanks in advance
Regards
k.selvambikai
Be good Do good
|
|
|
|
|
Hi
I am using CR10 with C#. I am using ReportDocument.Load method to open my report and then export report in specified format after setting all parematers. When I run my project, at start everythinf is fine. But as the load increases on server, reportdocument.load(rptName) method starts taking too much time (it takes more than 30 mins. for loading report) but it is sure that it gives the result and no exception occurs at all.
********************************************************
********************* CODE *****************************
********************************************************
ReportDocument rd =new ReportDocument();
rd.Load(rptName);
/* Set LogOn Info */
/* Set Parameters' Values */
/* Export report to specified path on hadrdisk in specified format*/
rd.close();
Please help me that what the problem is exactly ????
Any help or suggestion will be highly appriciated !!
Thanks in advance.
erganesh
|
|
|
|
|
Has someone tried to use the Crystal Report Viewer with Web Forms???
|
|
|
|