BIRT Exchange Forum: Passing the Maximo Where Clause to an asp web page - BIRT Exchange Forum

Jump to content


 

No Latest Open Poll.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Passing the Maximo Where Clause to an asp web page Rate Topic: -----

#1 User is offline   Riad Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 11-March 11


Posted 01 March 2012 - 10:51 AM

Hi,

Is it possible to pass the maximo Where Clause to an asp web page ?
The Where clause will be used in the asp web page like this:
SQL = "SELECT PO.* FROM PO WHERE " + WHERECLAUSE

The asp web page will be put in the birt report as Hyperlink

Thanks
0

#2 User is offline   johnw Icon

  • Senior Member
  • View blog
  • Group: Members
  • Posts: 712
  • Joined: 08-May 08


Posted 01 March 2012 - 11:31 AM

The Where clause is a parameter in BIRT reports, so yes, you just need to pass it through as params["where"]
0

#3 User is offline   Riad Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 11-March 11


Posted 01 March 2012 - 11:50 AM

View Postjohnw, on 01 March 2012 - 11:31 AM, said:

The Where clause is a parameter in BIRT reports, so yes, you just need to pass it through as params["where"]


Thanks johnw for the reply,

I tried this and it didn't work.
SQL = "SELECT PO.* FROM PO WHERE " + params["where"]


In fact I want to retrieve the where used by maximo to show selected PO
for example if maximo have (where PONUM like '14059%')

The sql in my asp web page will have the same clause where
SQL = "SELECT PO.* FROM PO WHERE PONUM like '14059%'

Thanks
0

#4 User is offline   johnw Icon

  • Senior Member
  • View blog
  • Group: Members
  • Posts: 712
  • Joined: 08-May 08


Posted 01 March 2012 - 12:56 PM

SQL = "SELECT PO.* FROM PO WHERE 1 = 1 " + params["where"]

Give that a try. I seem to recall that Maximo will add and AND to everything in its where clause. I don't have a copy of Maximo handy to give it a try. Also, you can refer to the report in the Maximo examples directory, they show how that mechanism work. Or you can use the extract report tool to get a existing report.
0

#5 User is offline   mblock Icon

  • Expert Member
  • View blog
  • Group: Members
  • Posts: 213
  • Joined: 07-August 07


Posted 01 March 2012 - 04:26 PM

View Postjohnw, on 01 March 2012 - 01:56 PM, said:

SQL = "SELECT PO.* FROM PO WHERE 1 = 1 " + params["where"]

Give that a try. I seem to recall that Maximo will add and AND to everything in its where clause. I don't have a copy of Maximo handy to give it a try. Also, you can refer to the report in the Maximo examples directory, they show how that mechanism work. Or you can use the extract report tool to get a existing report.


Use params["where"].value. Also it does not include a preceding 'AND', so it should be :
SQL = "SELECT PO.* FROM PO WHERE " + params["where"]
0

#6 User is offline   Riad Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 11-March 11


Posted 02 March 2012 - 06:57 AM

Thanks johnw and mblock for your reply,

It still not working. I put the [where] parameter in the report to show his value and it was
((po.poid = 1042))

I tried without succes all this:

SQL = "SELECT PO.* FROM PO where 1=1 " & params["where"]
SQL = "SELECT PO.* FROM PO where 1=1 " + params["where"]


SQL = "SELECT PO.* FROM PO where 1=1 and " & params["where"]
SQL = "SELECT PO.* FROM PO where 1=1 and " + params["where"]


SQL = "SELECT PO.* FROM PO where " & params["where"]
SQL = "SELECT PO.* FROM PO where " + params["where"]
0

#7 User is offline   mblock Icon

  • Expert Member
  • View blog
  • Group: Members
  • Posts: 213
  • Joined: 07-August 07


Posted 02 March 2012 - 07:10 AM

View PostRiad, on 02 March 2012 - 07:57 AM, said:

Thanks johnw and mblock for your reply,

It still not working. I put the [where] parameter in the report to show his value and it was
((po.poid = 1042))

I tried without succes all this:

SQL = "SELECT PO.* FROM PO where 1=1 " & params["where"]
SQL = "SELECT PO.* FROM PO where 1=1 " + params["where"]


SQL = "SELECT PO.* FROM PO where 1=1 and " & params["where"]
SQL = "SELECT PO.* FROM PO where 1=1 and " + params["where"]


SQL = "SELECT PO.* FROM PO where " & params["where"]
SQL = "SELECT PO.* FROM PO where " + params["where"]


This is the correct one:
SQL = "SELECT PO.* FROM PO where " + params["where"].value

Why it is not working I do not know. What error are you getting?
0

#8 User is offline   Riad Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 11-March 11


Posted 05 March 2012 - 06:23 AM

Hi,

Sorry for the delai, I'm not working full time on this issue.

It didn't work with SQL = "SELECT PO.* FROM PO where " + params["where"].value

It shows me HTTP 5000 error.

But when I use SQL = "SELECT PO.* FROM PO where po.ponum = '" & 13056218 & "'"

It works fine.

Thanks
0

#9 User is offline   Riad Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 11-March 11


Posted 05 March 2012 - 06:25 AM

Sorry not HTTP 5000 but HTTP 500
0

#10 User is offline   mblock Icon

  • Expert Member
  • View blog
  • Group: Members
  • Posts: 213
  • Joined: 07-August 07


Posted 05 March 2012 - 07:35 AM

How are you calling the ASP page?
0

#11 User is offline   Riad Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 11-March 11


Posted 05 March 2012 - 08:43 AM

By a Hyperlink on a data set column and I call a asp file

"http://ServerName/main.asp"
0

#12 User is offline   mblock Icon

  • Expert Member
  • View blog
  • Group: Members
  • Posts: 213
  • Joined: 07-August 07


Posted 05 March 2012 - 08:46 AM

View PostRiad, on 05 March 2012 - 09:43 AM, said:

By a Hyperlink on a data set column and I call a asp file

"http://ServerName/main.asp"


What does your URI expression look like in BRD?
0

#13 User is offline   Riad Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 11-March 11


Posted 05 March 2012 - 09:19 AM

View Postmblock, on 05 March 2012 - 08:46 AM, said:

What does your URI expression look like in BRD?



Location: "http://ServerName/main.asp"
Target: Self
0

#14 User is offline   mblock Icon

  • Expert Member
  • View blog
  • Group: Members
  • Posts: 213
  • Joined: 07-August 07


Posted 05 March 2012 - 09:22 AM

View PostRiad, on 05 March 2012 - 10:19 AM, said:

Location: "http://ServerName/main.asp"
Target: Self


So how are you passing the where clause? Should it notbe something like:

"http://ServerName/main.asp?where= " + params["where"].value
0

#15 User is offline   Riad Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 11-March 11


Posted 05 March 2012 - 10:34 AM

View Postmblock, on 05 March 2012 - 09:22 AM, said:

So how are you passing the where clause? Should it notbe something like:

"http://ServerName/main.asp?where= " + params["where"].value



Ok the where is passing ... Thank you very much ...

Still a little issue, the where is using the poid not the ponum and the SQL is not recognising the POID

this is the error: ORA-00904: "PO"."POID": invalid identifier

Do you have a idea why ?

The where I retrieve within the asp is ( ( po.poid = 1042 ))

Thanks
0

#16 User is offline   mblock Icon

  • Expert Member
  • View blog
  • Group: Members
  • Posts: 213
  • Joined: 07-August 07


Posted 05 March 2012 - 10:38 AM

View PostRiad, on 05 March 2012 - 11:34 AM, said:

Do you have a idea why ?


Probably the SQL in your ASP page is being generated incorrectly.
1

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users