Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TextMerge
Message
 
À
07/02/2006 16:17:52
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01094444
Message ID:
01094446
Vues:
17
This message has been marked as the solution to the initial question of the thread.
Change CHR(13) with CHR(13)+CHR(10) this is usual CR LF sequence, or
#define CRLF CHR(13)+CHR(10)

	CASE m.FileType = 'TXT'
		Response.AddHeader("Content-Type", "application/notepad")
		Response.AddHeader("Content-Disposition", "attachment; filename=notepad.txt")
		SET TEXTMERGE ON
		cHtmlOutput=""
		TEXT TO cHtmlOutput NOSHOW ADDITIVE
			<<m.ColumnNames>>
		ENDTEXT
		SELECT crsTestDownloads
		SCAN
				TEXT TO cHtmlOutput NOSHOW ADDITIVE
					<<CRLF>>
				ENDTEXT
				FOR i = 1 TO FCOUNT()
					IF &FieldList
						m.FieldValue = TRANSFORM(EVAL(FIELD(i)))
						TEXT TO cHtmlOutput NOSHOW ADDITIVE
						     <<m.FieldValue>>
						ENDTEXT
					ENDIF
				ENDFOR
				TEXT TO cHtmlOutput NOSHOW ADDITIVE
					<<CRLF>>
				ENDTEXT
		ENDSCAN
		SET TEXTMERGE OFF
		Response.Write(cHtmlOutput)
>I'm expecting the CHR(13) to cause a line break, but the results from the following are all on one line. Regardless of the name of the variable "cHtmlOutput" this is just to create a TXT file.
>
>
>
>	CASE m.FileType = 'TXT'
>		Response.AddHeader("Content-Type", "application/notepad")
>		Response.AddHeader("Content-Disposition", "attachment; filename=notepad.txt")
>		SET TEXTMERGE ON
>		cHtmlOutput=""
>		TEXT TO cHtmlOutput NOSHOW ADDITIVE
>			<<m.ColumnNames>>
>		ENDTEXT
>		SELECT crsTestDownloads
>		SCAN
>				TEXT TO cHtmlOutput NOSHOW ADDITIVE
>					<<CHR(13)>>
>				ENDTEXT
>				FOR i = 1 TO FCOUNT()
>					IF &FieldList
>						m.FieldValue = TRANSFORM(EVAL(FIELD(i)))
>						TEXT TO cHtmlOutput NOSHOW ADDITIVE
>						<<m.FieldValue>>
>						ENDTEXT
>					ENDIF
>				ENDFOR
>				TEXT TO cHtmlOutput NOSHOW ADDITIVE
>					<<CHR(13)>>
>				ENDTEXT
>		ENDSCAN
>		SET TEXTMERGE OFF
>		Response.Write(cHtmlOutput)
>
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform