Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Craig Boyd's GridExtras exporting blank rows
Message
De
26/10/2011 07:21:33
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Titre:
Craig Boyd's GridExtras exporting blank rows
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01527395
Message ID:
01527395
Vues:
231
Hi,

I'm using Craig Boyd's GridExtras class to allow data to be exported to Excel. I'm adjusting the default code so that rather than just the data in a grid gets exported, but the data from a specified cursor which may or may not be tied to a grid.

The data are getting exported, but so are lots of blank rows.

This is the code that creates the excel file:
			m.loCursorAdapter = CREATEOBJECT("CursorAdapter")
			m.loCursorAdapter.Alias = SYS(2015)
			m.loCursorAdapter.DataSourceType = "ADO"
			m.loCursorAdapter.DataSource = m.loRecordSet
			m.loCursorAdapter.SelectCmd = "Select " + m.lcSelectFields + " From [" + m.tcSheet + "]"
			IF m.loCursorAdapter.CursorFill(.F.,.T.)
				m.loCursorAdapter.Tables = "[" + m.tcSheet + "]"
				m.loCursorAdapter.BufferModeOverride = 3 && faster than 5 when dealing with larger record sets
				m.loCursorAdapter.UpdateNameList = m.lcUpdateNameListFields
				m.loCursorAdapter.UpdatableFieldList = m.lcUpdatableFieldList
				IF !EMPTY(m.lcConversionFunc)
					m.loCursorAdapter.ConversionFunc = m.lcConversionFunc
				ENDIF
				INSERT INTO (m.loCursorAdapter.Alias) SELECT * FROM (m.lcTempAlias)
				m.lnReturn = TABLEUPDATE(.T.,.T.,m.loCursorAdapter.Alias)
			ELSE
				AERROR(m.laErr)
				ERROR m.laErr(2)
			ENDIF
Stepping through this code shows that the m.loCursorAdapter.Alias has the correct data in it prior to the TABLEUPDATE(.T.,.T.,m.loCursorAdapter.Alias) and the return value is .T.

So why should there be all these blank rows in the Excel file?

I've never worked with cursoradapters before so if I need to provide more info, let me know.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform