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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OEPICK01 Report is blank 2

Status
Not open for further replies.

Bluejay07

Programmer
Mar 9, 2007
780
CA
I am using VB6, Crystal reports 11 and Sage Accpac 5.4.

I am trying to populate the report OEPICK01, however, when the report is previewed, all that appears on the report is the company name. No other values are displayed.

I am not accessing the OE1300 UI at all. The values are either determined through code or are accessed by values from a recordset.

Several values used below are passed from a calling function.
Here is the code that is used to access the report.

Code:
Dim xPSRpt As ACCPACXAPILib.xapiReport 
Set xPSRpt = CreateObject("ACCPAC.xapiReport") 
With xPSRpt 
.Select qmSESS, l_strReport, "" 'l_strReport = OEPICK01[OEPICK01.rpt] 
.SetParam "CMPNAME", qmSESS.Company 
.SetParam "SELECTBY", "0" 
.SetParam "SORTBY", "1" 
.SetParam "FROMSELECT", m_strOrdSplit(0) 
.SetParam "TOSELECT", m_strOrdSplit(1) 
.SetParam "FROMLOC", "1" 
.SetParam "TOLOC", "ZZZZZZ" 
.SetParam "REPRINT", "1" 
If g_bolFractionalQty Then 
.SetParam "QTYDEC", "4" 
Else 
.SetParam "QTYDEC", "0" 
End If 
.SetParam "COMPLETED", "0" 
.SetParam "PRINTKIT", "0" 
.SetParam "PRINTBOM", "0" 
.SetParam "PRINTBY", "0" 

.SetParam "SESHNDL", "11111111" 

.PrintDestination = PD_PREVIEW '= PD_PRINTER 
.PrintReport 1 
End With

I have recorded a macro and the values seem to match what I already have. The only difference is the session handle, which I also do not know how it is determined and the macro is COMAPI whereas my code is xapi.

I have also tried accessing the OEFlag table using the following:

Code:
Set OEFLAG2 = qmSESS.OpenView("OE0270", "OE") 
With OEFLAG2 
.Init 
.Fields("FROMORDER").Value = m_strOrdSplit(0) 
.Fields("TOORDER").Value = m_strOrdSplit(1) 
.Fields("FROMLOC").Value = "1" 
.Fields("TOLOC").Value = "ZZZZZZ" 
.Process 
End With

After trying this, I am still viewing a blank report.

Could anyone provide some insight as to why I cannot populate the report?
 
At the BP site, this was said to work:

Init OEFLAG and set the parameters, then .Process and get the SESHNDL.
 
You need the correct SESHNDL value, passing a random value will do no good.
You need to get SESHNDL from OE0270 - OEFLAG

Something like this:

Code:
With OEFLAG
.Init

.Fields("OPTYPE").PutWithoutVerification 13
.Fields("FROMSHI").PutWithoutVerification shipNumber
.Fields("TOSHI").PutWithoutVerification shipNumber

.Fields("FROMLOC").PutWithoutVerification " "
.Fields("TOLOC").PutWithoutVerification "Z"
.Fields("LBLREQUIRE").PutWithoutVerification 0

.Process

End With

and then

Code:
rpt.SetParam "SESHNDL", OEFLAG.Fields("SESHNDL").Value

HTH
 
Thank you both for your reply.

Ettienne,
As soon as I copied your code and used it, everything on the report was showing up.

I guess it all has to do with the session handle. Since I was only using a default value, it didn't know how to process the information.


Thank you for your assistance.
 
FYI the SESSHNDL is required to flag the transactions as printed.
 
Everything has been working great since I received help from this thread.

I am now having a similar issue with Accpac 5.5, with some exceptions.

Using the same code as I used for Accpac 5.4, I encountered the following:
- the name of the report(s) have changed. (eg. in 5.4 for orders, I used OEPICK01. In 5.5, the report is OEPICKORDER1)
- After setting the parameters and printing to screen, the report form appears and is asking for the parameters again. If I re-enter the parameters and click ok, the report is completely blank. (At least for 5.4 before I had the session handle, the company name and the report layout showed up. Now its just a blank page).

The recorded macro looks the same (except for the report name).

I would appreciate any suggestions that could help.
 
I believe I have solved this problem.

The oerpt.ini file is still partially referencing [OEPICK01].

Therefore, for my report, I needed to place the report name in the following format:

OEPICK01[OEPICKORDER1]

I was trying OEPICKORDER1[OEPICKORDER1] and that is why the parameter screen was re-appearing.

Thank you.
 
In OEPICK01[OEPICKORDER1] the OEPICK01 refers to the [OEPICK01] section in OERPT.INI and [OEPICKORDER1] refers to the Crystal report name.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top