Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with custom ASP 2

Status
Not open for further replies.

IanWaterman

Programmer
Jun 26, 2002
3,511
GB
CR9 reports on CE9 (using Oracle 9i database)

we use CE9 to publsh reports but instead of using Eportfolio we use custom ASP called from our oracle application.

I am trying to change a report within a folder on CE, it installs and runs through CMC without a problem.

Process I am following
Change label on existing report Object eg RPTABC010 to
RPTABC010_OLD and import new report as RPTABC010, both object work within CMC.

If I now call report in my ASP code I get the error
Error Type:
Microsoft VBScript runtime (0x800A0006)
Overflow: 'CInt'
/activebank/file1_CR.inc, line 102


This code refers to the report object number

'Create the report source and report factory objects
Set rptFactory = iStore.EnterpriseSession.Service("", "PSReportFactory")
Set rptSource = rptFactory.OpenReportSource(CInt(reportID))

However, if I rename the new object _NEW and change _OLD back to correct name and run ASP again it all works fine. I have also tried reimporting the OLD report and this will not run either. Its almost as if CE is not updating the Report object ID numbers and there is some sort of clash. I am reluctant to delete the old object just incase I can not import the new report at all. At least for now report works and changes were just cosmetic.

I have even tried giving report a new name RPTABC017, again runs through CMC, but fails for same reason. Its as if CE is generating Report Object IDs too big for the ASP code or the variable CInt.

Any suggestions as to what is going wrong.

Ian
 
Hi,
If the ID# of the new report is too large, CInt will fail..
( It is usually not needed, anyway, in my experience..)



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
From what you are saying I just need to change this

'Create the report source and report factory objects
Set rptFactory = iStore.EnterpriseSession.Service("", "PSReportFactory")
Set rptSource = rptFactory.OpenReportSource(CInt(reportID))

to

'Create the report source and report factory objects
Set rptFactory = iStore.EnterpriseSession.Service("", "PSReportFactory")
Set rptSource = rptFactory.OpenReportSource(reportID)

Ian

 
Turkbear

That works, however, I am not an ASP programmer. I just know enough to bend other peoples code to do what I want.

What does CInt do, I just need to make a case to remove from about 3 or 4 .Inc files which we use all over the place.

The place I work at will not accept

"Because it works now!"

Thanks

Ian

 
Hi,
CInt converts the supplied value to an Integer..
from the docs on VbScript:

The CInt function converts an expression to a variant of subtype Integer.

Note: The value must be a number between -32768 and 32767.





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
It works because OpenReportSource method is overloaded to take either the object id or the object itself (InfoObject) - that's the change by removing the int cast.

VBScript int is 16bit (hence 32767 max) you could cast to a Long but as Turk states it's redundant in this case.

Kingfisher
 
Thanks guys for your help. What I do not understand is how we have got to report ID 32767, we can't have more than 50 or so reports on CE.

I have noticed that IDs do seem to jump in steps of about 500. Is it something we have done wrong in set up?

Our APS database is Oracle and I have heard that Oracle can reserve 20 records at a time, and if they are not used in a session they are discarded, (and is a known 9i bug) but that would not explain 500 record jumps.

Ian

 
Hi,
Not sure where you got that Oracle info, but Oracle does not 'reserve' records..

CE assigns a number from the table called CMS_IDNUMBERS(x)
( varies based on version and # of CMS servers) . Not sure how it assigns a value to the next Number field..Not sure it is purely sequential.





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top