473,569 Members | 2,788 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 7804
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
5426
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
1130
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
3618
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
8720
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
2518
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
1518
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
3862
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
2848
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
2119
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
7924
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. ...
1
7672
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
7968
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6283
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
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
1212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
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.