p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

crystal_reports thread: Parameters


Message #1 by "Italo Cafferata R." <ICafferata@E...> on Thu, 8 Nov 2001 11:38:10 -0500
Hi everybody:



Situation 1:



I make a report based on a Stored Procedure (SQL 7.0) that recieves a

parameter in order to know how to order the list (Name, code, sex, 

etc),

each time i run the report appear a window asking me for the parameter

value.



Questions:



1.	How can I set the parameters value from then VB6 code

2.	How is there are more than 1 parameter



Situation 2:



I make a report indicating a sql string "SELECT * FROM Users ORDER BY 

Name"

(SQL 7.0), then in my code i wrote:



    l_sSql =3D "SELECT * FROM Usuarios ORDER BY "

    If iOrden =3D 1 Then l_sSql =3D l_sSql + "Codigo"

    If iOrden =3D 2 Then l_sSql =3D l_sSql + "Apellidos, Nombres"

    If iOrden =3D 3 Then l_sSql =3D l_sSql + "Nombres, Apellidos"

    If iOrden =3D 4 Then l_sSql =3D l_sSql + "Tipo"

    If iOrden =3D 5 Then l_sSql =3D l_sSql + "AbgRes"

    If iOrden =3D 6 Then l_sSql =3D l_sSql + "Estado"



    l_rptUsr.SQLQueryString =3D l_sSql





but when i run the report the system say :



	"the database does not support SQL queries"





Any help would be welcome.



Thanks





> Italo Cafferata

> Rodrigo, El=EDas & Medrano Abogados

> Av. San Felipe 758 - Jes=FAs Mar=EDa

> Lima - Per=FA

> Central: 51 1 219 1900

> Fax       51 1 463 7300

> Email: ICafferata@E...

> 

************************************************************************

**

> ***********************************

> La informaci=F3n contenida en este e-mail es confidencial, 

privilegiada y

> esta dirigida exclusivamente a su destinatario. Cualquier revisi=F3n,

> difusi=F3n, distribuci=F3n o copiado de este mensaje est=E1 

prohibido. Si ha

> recibido este e-mail por error por favor b=F3rrelo y env=EDe un 

mensaje al

> remitente.

> The information contained in this e-mail is privileged and 

confidential

> and is intended only for its addressee. Any review, dissemination,

> distribution or copying of this e-mail is prohibited. If you have 

received

> it in error please delete the original message and e-mail us.

> 

************************************************************************

**

> ***********************************

>

Message #2 by "Preethi" <preethi@s...> on Fri, 9 Nov 2001 08:56:42 +0600
Situation 1:



1.    When send the parameters write this way

        crystareport1.ParameterFields(0) = "Sex;" & txtSex.text & "; True"

        The Last 'True' will tell crystal report not the display the screen



2.    If you have more than 1 parameters set it Parametersfields(0),

parameterfields(1)... etc.



Situation 2:



What is the database you are using.  SQLQuery is supported for client Server

databases only (Oracle, SQLServer Etc.) It is not supported for desktop

databases like Access.

If you are using SQLServer/ Oracle check for the actual fields in the report

Otherwise use 'Sortfields' property of crystal reports.

Hope this may solve your problems



Preethi



----- Original Message -----

From: "Italo Cafferata R." <ICafferata@E...>

To: "crystal_reports" <crystal_reports@p...>

Sent: Thursday, November 08, 2001 10:38 PM

Subject: [crystal_reports] Parameters





Hi everybody:



Situation 1:



I make a report based on a Stored Procedure (SQL 7.0) that recieves a

parameter in order to know how to order the list (Name, code, sex, etc),

each time i run the report appear a window asking me for the parameter

value.



Questions:



1. How can I set the parameters value from then VB6 code

2. How is there are more than 1 parameter



Situation 2:



I make a report indicating a sql string "SELECT * FROM Users ORDER BY Name"

(SQL 7.0), then in my code i wrote:



    l_sSql = "SELECT * FROM Usuarios ORDER BY "

    If iOrden = 1 Then l_sSql = l_sSql + "Codigo"

    If iOrden = 2 Then l_sSql = l_sSql + "Apellidos, Nombres"

    If iOrden = 3 Then l_sSql = l_sSql + "Nombres, Apellidos"

    If iOrden = 4 Then l_sSql = l_sSql + "Tipo"

    If iOrden = 5 Then l_sSql = l_sSql + "AbgRes"

    If iOrden = 6 Then l_sSql = l_sSql + "Estado"



    l_rptUsr.SQLQueryString = l_sSql





but when i run the report the system say :



"the database does not support SQL queries"





Any help would be welcome.



Thanks





> Italo Cafferata

> Rodrigo, Elías & Medrano Abogados

> Av. San Felipe 758 - Jesús María

> Lima - Perú

> Central: 51 1 219 1900

> Fax       51 1 463 7300

> Email: ICafferata@E...

> **************************************************************************

> ***********************************

> La información contenida en este e-mail es confidencial, privilegiada y

> esta dirigida exclusivamente a su destinatario. Cualquier revisión,

> difusión, distribución o copiado de este mensaje está prohibido. Si ha

> recibido este e-mail por error por favor bórrelo y envíe un mensaje al

> remitente.

> The information contained in this e-mail is privileged and confidential

> and is intended only for its addressee. Any review, dissemination,

> distribution or copying of this e-mail is prohibited. If you have received

> it in error please delete the original message and e-mail us.

> **************************************************************************

> ***********************************

>






$subst('Email.Unsub')




  Return to Index