oBrw:ToExcel() error

oBrw:ToExcel() error

Postby reinaldocrespo » Tue Mar 05, 2013 9:51 pm

Hi everyone;

I'm seen an error when exporting from xbrowse using :ToExcel(). Error text is:
Code: Select all  Expand view
Error Excel.Application.ACTIVESHEET/424 Unknown error: CELLS
...
Stack-List
Called by TXBROWSE:TOEXCEL(6935)


Any ideas?


Thank you,


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: oBrw:ToExcel() error

Postby nageswaragunupudi » Wed Mar 06, 2013 12:17 am

We need to see what is the code in line 6935.
Very likely, such an error could arise when the parameters of Cells(...) are invalid or invalid assignment.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: oBrw:ToExcel() error

Postby reinaldocrespo » Fri Mar 08, 2013 9:32 pm

Hi.

The line at 6935 is this:
Code: Select all  Expand view
                    oSheet:Cells( nPasteRow, 1 ):Select()
 


The parameters reported on the error log are:

[ 1 ] = N 353213
[ 2 ] = N 1

Again the error text is:

Error Excel.Application: ACTIVE SHEET/1 Unknown error: CELLS.

Information on how to solve this problem, is appreciated.

Thank you,


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: oBrw:ToExcel() error

Postby nageswaragunupudi » Sat Mar 09, 2013 4:43 am

[ 1 ] = N 353213

This is the reason. Here nPasteRow's value appears to be beyond the limit.
If the code of xbrowse is bug-free ( let us assume so for the time being ), this value should not exceed the total rows in the table. If the table really contains more rows than 352,213 then we now know that this number seems to be the limit and so we need to export subsets of the table.


Check #1: Does the table really contain more rows than the limit?
If so please consider exporting subsets of table.
Check #2: Does Eval( oBrw:bKeyCount() ) correctly return the number of rows in the table?
If not check the codeblocks for oBrw:bKeyCount() .and. oBrw:bSkip
Check #3:
We need to investigate why the number is so high. I request your cooperation in the logging the relevant values to a log file in the loop.

Please locate this part of the program code in toExel() method and insert the lines I indicated:
Code: Select all  Expand view

               
               ferase( 'x.log' ) // INSERTED
               logfile( 'x.log', { nRow, nPasteRow, nDataRows } )  // INSERTED              
               do while nRow <= ( nDataRows + 1 ) .and. lContinue
                  if ! Empty( cText )
                     cText += CRLF
                  endif
                  cText    += ::ClpRow( .t., aCols )

                  lContinue := ( ::Skip( 1 ) == 1 )            // Eval( ::bSkip, 1 )
                  nRow ++
                  if nRow % 1000 == 0 .or. nRow > 353000  // INSERTED
                     logfile( 'x.log', { nRow, nPasteRow, nDataRows } )   // INSERTED
                  endif // INSERTED            
                 
 


Examine the log file after termination of the program.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: oBrw:ToExcel() error

Postby reinaldocrespo » Sat Mar 09, 2013 2:53 pm

Mr. Rao;

Hi. Thank you for the information.

The error log is being saved to a systemerrors table. I get to inspect the table on a daily base looking for bugs. However, I don't have an installation where the program is used by less than 70 users and although I do know the login user's name that generates the runtime error, I do not have access to c: drive of each workstation. Therefore loggin to x.log will not help. Loggin to a shared drive won't help either as x.log would be re-written time and again by many users.

I will try to log to a table each time this piece of code executes and hopefully I will be able to match the runtime error to it. Trying to export 353k records to excel does not make any sense to me. In theory users may set a filter and then try to export to excel that subset that passes the filter condition. Filters are created using AOFs. bKeyCount() might be the problem here as it might not be respecting filters ...? If so, then this is something I can fix.

I'll get back when I have more info.

Thank you,


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: oBrw:ToExcel() error

Postby nageswaragunupudi » Sat Mar 09, 2013 3:16 pm

bKeyCount() might be the problem here as it might not be respecting filters ...?

Likely.

Actually the Loop should end when either nRow > Eval( bKeyCount ) .or. Eval( bSkip, 1 ) != 1, whichever happens first.

You can try checking behavior of these codeblocks.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 109 guests