TD 4.2 Report Builder problem

Discussion forum about all things Report Builder (all versions).
rogeryeoh

TD 4.2 Report Builder problem

Post by rogeryeoh » 17 Jan 2008, 08:05

Guys, I'm facing a strange problem that I've never encountered before.

System is Windows Vista / Windows XP (2 machines).

CTD is V 4.2

I have this menu program that is nothing more than a series of SalLoadApp's and works fine on all programs... in SOME ways. But my report APPs that use SalReportView are behaving weird.

For instance, in any of my report APPs

1) In Debug <F7> mode, the report comes out fine.

2) In Windows, running the built .EXE comes out fine.

3) From the menu program that does the SalLoadApp, the EXE is loaded fine. I can select whatever criteria there is, but when I process the SalReportView function, I notice that it totally bypasses the SAM_ReportStart, SAM_ReportFetchInit and SAM_ReportFetchNext sections completely. I confirmed this by putting SalMessageBox's inside them, and they were never executed at all, whilst in 1) and 2), they worked fine.

This sounds like something's wrong with my menu program but I could be wrong. Problem is, the report EXE loads fine just like all other EXEs. What is it that could possibly cause this problem?

Below are the relevent code segments :

Code: Select all

REPORT MENU
-----------
Global Declarations
!!CB!! 28
On SAM_AppStartup
   Set strProgramName = 'MAINMENU'
   Set strVersion = 'V1.00'
   Set bCombo = TRUE
   Set strArgArray[1] = 'WEIGH'
   If SalModalDialog( dlgLogin, hWndNULL, strUser, strPassword ) = 0
      Set strArgArray[2] = strUser
      Set strArgArray[3] = strPassword
      Set strLoginStr = strArgArray[1] || ' ' || strUser || ' ' || strPassword
      If InitUser( )
   Else
      Call AccessError(  )

Form Window: frmReportMenu
   Contents
      cpb: pbUsers
         Message Actions
            On SAM_Click
               Call SalLoadApp( 'USERLST.EXE', strLoginStr )

======================================
UserLst.App
-----------
Form Window: frmMain
   Contents
      Pushbutton: pbView
         Message Actions
            On SAM_Click
         Set strSelCrit = ' '
         Call FormSortSeq(  )
         Set strSqlFinal = strSelect || strSelCrit || strSqlSort
         Call SalMessageBox( 'Just before SalReportView' )      ; This msg is shown always
         Call SalReportView( frmMain, hWndNULL, 'UserLst.QRP', strRptVars, strInpItems, nReturn )
         Call Prompt( 'back from SalReportView' )         ; This msg is shown always
   Message Actions
      On SAM_Create
      On SAM_ReportStart
         Call SalMessageBox( 'inside SAM_ReportStart', '', MB_Ok )   ; This is shown during <F7>, Windows Run but not from SalLoadApp
         Call SqlPrepare( hSqlTemp, strSqlFinal )
      On SAM_ReportFetchInit
         Call SalMessageBox( 'inside SAM_ReportFetchInit', '', MB_Ok )   ; This is shown during <F7>, Windows Run but not from SalLoadApp
         If SqlExecute( hSqlTemp )
            Return TRUE
      On SAM_ReportFetchNext
         Call SalMessageBox( 'inside SAM_ReportFetchNext', '', MB_Ok )   ; This is shown X times during <F7>, Windows Run but not from SalLoadApp
         If SqlFetchNext( hSqlTemp, nReturn )
            Return TRUE
==========================================
UserLst.App is built as UserLst.exe

Any ideas, guys?

Thanks

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3390
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: TD 4.2 Report Builder problem

Post by Dave Rabelink » 17 Jan 2008, 17:43

I guess you have a location issue.

Could be the report is not found and therefore not executed.
Try to catch the return value of SalReportView to see if loading succeeds.

Test your app and fully qualify the location of the report, so instead of

'UserLst.QRP'

try to use

'c:\\Reports\\UserLst.QRP'

(or whatever the location is where the report is situated).

Keep in mind the current folder could change during runtime.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

rogeryeoh

Re: TD 4.2 Report Builder problem

Post by rogeryeoh » 19 Jan 2008, 08:43

Dave,

I wasn't aware of the location change possibility during runtime, but will give it a shot, thanks :)
Dave Rabelink wrote:I guess you have a location issue.

Could be the report is not found and therefore not executed.
Try to catch the return value of SalReportView to see if loading succeeds.

Keep in mind the current folder could change during runtime.

rogeryeoh

Re: TD 4.2 Report Builder problem

Post by rogeryeoh » 20 Jan 2008, 06:01

Dave my man,

You were spot on with your suggestion .. everything's totally solved, really appreciate it. I checked my report programs from the old days and true enough, the file locations were fully qualified, but not my current set of programs. Thanks a whole lot

Cheers

Roger

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3390
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: TD 4.2 Report Builder problem

Post by Dave Rabelink » 20 Jan 2008, 10:46

Roger,

If your reports are situated in the folder of your application, but the folder could
change due to custom installations, you could use this :

https://wiki.tdcommunity.net/index.php/ ... ime_folder

Code: Select all

Set sReport = GetRuntimeDirectory( ) || "Report1.qrp"
This way you will not have to fully qualify the location, so installing your app in any location
will not break your report features.

Dave
Last edited by EwaldP on 30 Sep 2008, 08:58, edited 1 time in total.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

rogeryeoh

Re: TD 4.2 Report Builder problem

Post by rogeryeoh » 21 Jan 2008, 08:13

Cool, Dave,

Thanks once again :)

Roger

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests