473,549 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing Parameters using CRYSTAL REPORTS

51 New Member
hey all,

I am passing parameters through code to a stored procedure in both windows application (using c# and sql server & crystal reports)and web application(usi ng asp.net & sql server & crystal reports)...
the windows application works perfectly..
bt web apllication gives exception..."In valid Table Number"...

Can nebdy help...Please.. ....
Jan 12 '07 #1
6 7803
radcaesar
759 Recognized Expert Contributor
Send the code and exception u got in detail

:)
Jan 12 '07 #2
Smish
51 New Member
thanx sir.....
i am giving u the code as well as exception...... ..



this same appliction runs perfectly in windows...appli cation

when i do this like this i get logon exception failed. in web application..

in page_load am writing this code........... .......

{
CrystalReport1 rptReportClass = new CrystalReport1( );
rptReportClass. SetDatabaseLogo n("sa","");
CrystalReportVi ewer1.ReportSou rce = rptReportClass;


//am taking value from another web page....

if(Request.Quer yString["Name"]!=null )
text1 = Request.QuerySt ring["Name"];

discreteVal.Val ue = text1;
paramField.Para meterFieldName = "vDepartmen t";
paramField.Curr entValues.Add(d iscreteVal);
rptReportClass. DataDefinition. ParameterFields["@vDepartme nt"].ApplyCurrentVa lues(paramField .CurrentValues) ;
paramFields.Add (paramField);
CrystalReportVi ewer1.Parameter FieldInfo = paramFields;

}


so i get exception...

(

Logon failed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: CrystalDecision s.CrystalReport s.Engine.LogOnE xception: Logon failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


)

so i added this snip of code in the above instead of rptReportClass. SetDatabaseLogo n("sa","");



(

CrystalDecision s.Shared.Connec tionInfo conn=new ConnectionInfo( );
CrystalDecision s.CrystalReport s.Engine.Table myTable;
CrystalDecision s.Shared.TableL ogOnInfo myLog;
conn.ServerName ="VENUS";
conn.DatabaseNa me="master";
conn.UserID ="sa";
conn.Password=" ";
for(int i=0;i<rptReport Class.Database. Tables.Count;i+ +)
{

myTable=rptRepo rtClass.Databas e.Tables[i];
myLog = myTable.LogOnIn fo;
myLog.Connectio nInfo= conn;
myTable.ApplyLo gOnInfo(myLog);
myTable.Locatio n= myLog.TableName ;
}




)



bt then i get this error...

Error in File C:\WINDOWS\TEMP \temp_3a9b8810-741f-4b4f-92a7-ae4cd51a5fe0.rp t: Invalid table number.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: CrystalDecision s.CrystalReport s.Engine.Invali dArgumentExcept ion: Error in File C:\WINDOWS\TEMP \temp_3a9b8810-741f-4b4f-92a7-ae4cd51a5fe0.rp t: Invalid table number.


hope ill get solution for this........... ..
Jan 15 '07 #3
kenobewan
4,871 Recognized Expert Specialist
Here is an article that may help, C# e.g. half way down:
How to pass Database logon info to a Crystal Report at runtime in VB.NET
Jan 16 '07 #4
prabodh bansal
2 New Member
Dear sir,
I want to pass two parameters for date from and date to to the crystal report so that the output is according to it.
Can u plz guide me in this.
[email removed]

Thanks and Regards
Prabodh Bansal
Feb 15 '07 #5
markchimes
9 New Member
Hi Smish,

The error indicates that you have authenication problems with the web version of your database. Are you sure you have the same credentials set for your windows and web databases?
The 2nd error indicates that a parameter type does not match what Crystal is expecting to match against the database data type. In other words, check that the code in your web version that passes the parameter has set the same data type as the field in the data table residing in your web database.

Now, if you are using the SAME database for both Windows and Web apps you have a different set of problems. If this is the case, then obviously the problem does not reside with different authentication models or data types. The difference must be in your code. Check that the web code matches your windows code (in terms of functionality, obviously syntax will vary).

Good luck.

Cheers,
Mark Chimes



thanx sir.....
i am giving u the code as well as exception...... ..



this same appliction runs perfectly in windows...appli cation

when i do this like this i get logon exception failed. in web application..

in page_load am writing this code........... .......

{
CrystalReport1 rptReportClass = new CrystalReport1( );
rptReportClass. SetDatabaseLogo n("sa","");
CrystalReportVi ewer1.ReportSou rce = rptReportClass;


//am taking value from another web page....

if(Request.Quer yString["Name"]!=null )
text1 = Request.QuerySt ring["Name"];

discreteVal.Val ue = text1;
paramField.Para meterFieldName = "vDepartmen t";
paramField.Curr entValues.Add(d iscreteVal);
rptReportClass. DataDefinition. ParameterFields["@vDepartme nt"].ApplyCurrentVa lues(paramField .CurrentValues) ;
paramFields.Add (paramField);
CrystalReportVi ewer1.Parameter FieldInfo = paramFields;

}


so i get exception...

(

Logon failed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: CrystalDecision s.CrystalReport s.Engine.LogOnE xception: Logon failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


)

so i added this snip of code in the above instead of rptReportClass. SetDatabaseLogo n("sa","");



(

CrystalDecision s.Shared.Connec tionInfo conn=new ConnectionInfo( );
CrystalDecision s.CrystalReport s.Engine.Table myTable;
CrystalDecision s.Shared.TableL ogOnInfo myLog;
conn.ServerName ="VENUS";
conn.DatabaseNa me="master";
conn.UserID ="sa";
conn.Password=" ";
for(int i=0;i<rptReport Class.Database. Tables.Count;i+ +)
{

myTable=rptRepo rtClass.Databas e.Tables[i];
myLog = myTable.LogOnIn fo;
myLog.Connectio nInfo= conn;
myTable.ApplyLo gOnInfo(myLog);
myTable.Locatio n= myLog.TableName ;
}




)



bt then i get this error...

Error in File C:\WINDOWS\TEMP \temp_3a9b8810-741f-4b4f-92a7-ae4cd51a5fe0.rp t: Invalid table number.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: CrystalDecision s.CrystalReport s.Engine.Invali dArgumentExcept ion: Error in File C:\WINDOWS\TEMP \temp_3a9b8810-741f-4b4f-92a7-ae4cd51a5fe0.rp t: Invalid table number.


hope ill get solution for this........... ..
Mar 1 '07 #6
Smish
51 New Member
hi,
Thanx ..itz solved..

Hi Smish,

The error indicates that you have authenication problems with the web version of your database. Are you sure you have the same credentials set for your windows and web databases?
The 2nd error indicates that a parameter type does not match what Crystal is expecting to match against the database data type. In other words, check that the code in your web version that passes the parameter has set the same data type as the field in the data table residing in your web database.

Now, if you are using the SAME database for both Windows and Web apps you have a different set of problems. If this is the case, then obviously the problem does not reside with different authentication models or data types. The difference must be in your code. Check that the web code matches your windows code (in terms of functionality, obviously syntax will vary).

Good luck.

Cheers,
Mark Chimes
Mar 2 '07 #7

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

Similar topics

0
5425
by: Aaron | last post by:
The following code works fine when previewing a Crystal report using ASP, EXCEPT when it gets to a report using a SubReport and its associated parameters. The whole report just comes up blank with this error message: "The Error Message was: Error detected by database DLL.from: Crystal Reports ActiveX Designer". What am I doing wrong in the...
0
1127
by: Tom | last post by:
We have a .NET C# web-based application using Crystal Reports 9 to display reports. One of these reports has a dozen or so parameters. I would like to avoid having to build some custom parameter screen(s) that prompts the user for the parameters, but rather have the report itself (in the viewer) do the prompting (as if you were running the...
1
3617
by: Maria | last post by:
Hello! I am new to Crystal reports an I have problems passing parameters form outside to Crystal report an creating a report with data from more than one table This is the problem: I have to make a report( VS.NET, C#, Web Form) with 3 parts and with data from three tables: 1st part: all the field values form table1 coresponding to an...
0
8718
by: stephan | last post by:
I know that this has been beaten to death but I can't seem to resolve my issues (I have 2 of them). I have created a class that exposes a public method which returns a datatable as a datasource for a Crystal Report. The method has a single argument which represents a parameter required by the Stored Procedure. When I generate the report...
1
2517
by: raf_z | last post by:
Hi, I'm running a website with Asp.NET, and on one of the pages i have a crystal report with 3 user-populated parameters. However, not all params might be selected. Example: Parameters: 1. EmployeeID 2. First Name 3. Last Name
0
1517
by: lewindha | last post by:
Hi all I am new to ASP.Net and Crystal Reports. We have VS.Net 2003 and Crystal 10 where I work. I have successfully been able to view reports in a web page. My problem now is that I have a report that takes two parameters. A clientID parameter(number) and a date parameter(Date type). I set a form that gets the possible values from...
19
3856
by: LP | last post by:
I am using (trying to) CR version XI, cascading parameters feature works it asks user to enter params. But if page is resubmitted. It prompts for params again. I did set ReuseParameterValuesOnRefresh="True" in a viewer, but it still doesn't work. Did anyone run into this problem. What's the solution? Please help. Thank you
0
2847
by: ZRexRider | last post by:
Hi, I've written reports based on stored procedures that receive parameters and it usually seems straight forward. Today I would like to use Crystal Reports parameter interface t prompt for a "Date Range" and then pass the lower and upper date values to the @StartDate and @EndDate of my SPROC's range. Unfortunately when I try to build...
3
2118
by: Dan Aldean | last post by:
Hi, To create a Crystal Reports I use a ReportViewer. How can I pass parameters to the report which is based on a stored procedure. Please provide some code. Thanks
0
7532
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7462
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7730
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7975
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7492
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
3491
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1957
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1069
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
777
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.