ich habe zum Thema Umlaute hier schon einiges finden können, nur bezieht sich dabei alles auf Dataports.
Wenn ich mit meinem Report eine Datei ausgeben möchte, so wird diese im ASCII Format ausgeben, so dass ich eine Konvertierung ins ANSI Format vornehmen muß. Ich habe auch schon die Codeunits vom Timo Lässer gefunden (Nav Tools)
Leider fehlt mir im Moment noch das Wissen, wie ich zum einen diese Funktiionen in meinen Report einbauen kann und vor allem wo. Ich habe in einem Dataport von unserem Partner etwas gefunden und habe versucht das ganze in meinem Report umzusetzen, jedoch ohne Erfolg.
Für Schläge auf den Hinterkopf bin ich wie immer dankbar.
Gruß
and.Y
PS: Anbei der Code des Reports. Im Anhang Details.zip befinden sich Bilder der Parametrisierung.
- Code: Alles auswählen
SalesSetup.GET;
SchreibString := ASCII2ANSI(SchreibString);
OnAfterGetRecord()
Filename := SalesSetup."UPS Path+File";
SchreibString := ASCII2ANSI(SchreibString);
Datei.TEXTMODE(TRUE);
Datei.WRITEMODE(TRUE);
IF Datei.OPEN(Filename) THEN BEGIN
Datei.SEEK(Datei.LEN);
Datei.TRUNC;
END ELSE
Datei.CREATE(Filename);
SchreibString := DELCHR("Sales Invoice Header"."No.",'<>') + ';' +
DELCHR("Sales Invoice Header"."Sell-to Customer No.",'<>') + ';' +
DELCHR("Sales Invoice Header"."Ship-to Name",'<>') + ';' +
DELCHR("Sales Invoice Header"."Ship-to Name 2",'<>') + ';';
// Abfrage Lieferadresse vorhanden
IF DELCHR("Sales Invoice Header"."Ship-to Address") <> '' THEN
SchreibString := SchreibString + DELCHR("Sales Invoice Header"."Ship-to Address",'<>') + ';'
ELSE
SchreibString := SchreibString + DELCHR("Sales Invoice Header"."Ship-to Address 2",'<>') + ';';
//Abfrage Ländercode gefüllt
IF "Sales Invoice Header"."Ship-to Country Code" = '' THEN
SchreibString := SchreibString + 'DE' + ';'
ELSE
SchreibString := SchreibString + DELCHR("Sales Invoice Header"."Ship-to Country Code",'<>') + ';';
SchreibString := SchreibString + DELCHR("Sales Invoice Header"."Ship-to Post Code",'<>') + ';' +
DELCHR("Sales Invoice Header"."Ship-to City",'<>') + ';' +
DELCHR("Sales Invoice Header"."Sell-to Phone No.",'<>') + ';' +
DELCHR("Sales Invoice Header"."Sell-to E-Mail",'<>') + ';' +
DELCHR("Sales Invoice Header"."Shipment Method Code",'<>') + ';';
//Abfrage nach Nachnahmelieferung
IF "Sales Invoice Header"."Shipment Method Code" = 'NACH' THEN
SchreibString := SchreibString + 'Y' + ';' + 'COD' + ';' + 'N'
ELSE
SchreibString := SchreibString + 'N';
SchreibString := SchreibString + DELCHR("Sales Invoice Header"."Currency Code",'<>') + ';';
//Abfrage nach Währung
IF "Sales Invoice Header"."Currency Code" = '' THEN
SchreibString := SchreibString + 'EUR' + ';'
ELSE
SchreibString := SchreibString + DELCHR("Sales Invoice Header"."Currency Code",'<>') + ';';
"Sales Invoice Header".CALCFIELDS("Amount Including VAT");
SchreibStringdec := FORMAT("Sales Invoice Header"."Amount Including VAT",5,'<Integer Thousand><Decimals,3>');
Datei.WRITE(DELCHR(SchreibString + SchreibStringdec,'>'));
OnPostDataItem()
Datei.CLOSE;
ANSI2ASCII(Text : Text[1024]) : Text[1024]
FOR i := 1 TO STRLEN(Text) DO BEGIN
CASE Text[i] OF
// ANSI ASCII
131 : Text[i] := 159; // ƒ
161 : Text[i] := 173; // ¡
162 : Text[i] := 189; // ¢
163 : Text[i] := 156; // £
164 : Text[i] := 207; // ¤
165 : Text[i] := 190; // ¥
166 : Text[i] := 221; // ¦
167 : Text[i] := 245; // §
168 : Text[i] := 249; // ¨
169 : Text[i] := 184; // ©
170 : Text[i] := 166; // ª
171 : Text[i] := 174; // «
173 : Text[i] := 240; //
174 : Text[i] := 169; // ®
175 : Text[i] := 238; // ¯
176 : Text[i] := 167; // °
177 : Text[i] := 241; // ±
178 : Text[i] := 253; // ²
179 : Text[i] := 252; // ³
180 : Text[i] := 239; // ´
181 : Text[i] := 230; // µ
182 : Text[i] := 244; // ¶
183 : Text[i] := 250; // ·
184 : Text[i] := 247; // ¸
185 : Text[i] := 251; // ¹
187 : Text[i] := 175; // »
188 : Text[i] := 172; // ¼
189 : Text[i] := 171; // ½
190 : Text[i] := 243; // ¾
191 : Text[i] := 168; // ¿
192 : Text[i] := 183; // À
193 : Text[i] := 181; // Á
194 : Text[i] := 182; // Â
195 : Text[i] := 199; // Ã
196 : Text[i] := 142; // Ä
197 : Text[i] := 143; // Å
198 : Text[i] := 146; // Æ
199 : Text[i] := 128; // Ç
200 : Text[i] := 212; // È
201 : Text[i] := 144; // É
202 : Text[i] := 210; // Ê
203 : Text[i] := 211; // Ë
204 : Text[i] := 222; // Ì
205 : Text[i] := 214; // Í
206 : Text[i] := 215; // Î
207 : Text[i] := 216; // Ï
208 : Text[i] := 209; // Ð
209 : Text[i] := 165; // Ñ
210 : Text[i] := 227; // Ò
211 : Text[i] := 224; // Ó
212 : Text[i] := 226; // Ô
213 : Text[i] := 229; // Õ
214 : Text[i] := 153; // Ö
215 : Text[i] := 158; // ×
216 : Text[i] := 157; // Ø
217 : Text[i] := 235; // Ù
218 : Text[i] := 233; // Ú
219 : Text[i] := 234; // Û
220 : Text[i] := 154; // Ü
221 : Text[i] := 237; // Ý
222 : Text[i] := 232; // Þ
223 : Text[i] := 225; // ß
224 : Text[i] := 133; // à
225 : Text[i] := 160; // á
226 : Text[i] := 131; // â
227 : Text[i] := 198; // ã
228 : Text[i] := 132; // ä
229 : Text[i] := 134; // å
230 : Text[i] := 145; // æ
231 : Text[i] := 135; // ç
232 : Text[i] := 138; // è
233 : Text[i] := 130; // é
234 : Text[i] := 136; // ê
235 : Text[i] := 137; // ë
236 : Text[i] := 141; // ì
237 : Text[i] := 161; // í
238 : Text[i] := 140; // î
239 : Text[i] := 139; // ï
240 : Text[i] := 208; // ð
241 : Text[i] := 164; // ñ
242 : Text[i] := 149; // ò
243 : Text[i] := 162; // ó
244 : Text[i] := 147; // ô
245 : Text[i] := 228; // õ
246 : Text[i] := 148; // ö
247 : Text[i] := 246; // ÷
248 : Text[i] := 155; // ø
249 : Text[i] := 151; // ù
250 : Text[i] := 163; // ú
251 : Text[i] := 150; // û
252 : Text[i] := 129; // ü
253 : Text[i] := 236; // ý
254 : Text[i] := 231; // þ
255 : Text[i] := 152; // ÿ
END;
END;
EXIT(Text);
ASCII2ANSI(Text : Text[1024]) : Text[1024]
FOR i := 1 TO STRLEN(Text) DO BEGIN
CASE Text[i] OF
// ASCII ANSI
159 : Text[i] := 131; // ƒ
173 : Text[i] := 161; // ¡
189 : Text[i] := 162; // ¢
156 : Text[i] := 163; // £
207 : Text[i] := 164; // ¤
190 : Text[i] := 165; // ¥
221 : Text[i] := 166; // ¦
245 : Text[i] := 167; // §
249 : Text[i] := 168; // ¨
184 : Text[i] := 169; // ©
166 : Text[i] := 170; // ª
174 : Text[i] := 171; // «
240 : Text[i] := 173; //
169 : Text[i] := 174; // ®
238 : Text[i] := 175; // ¯
167 : Text[i] := 176; // °
241 : Text[i] := 177; // ±
253 : Text[i] := 178; // ²
252 : Text[i] := 179; // ³
239 : Text[i] := 180; // ´
230 : Text[i] := 181; // µ
244 : Text[i] := 182; // ¶
250 : Text[i] := 183; // ·
247 : Text[i] := 184; // ¸
251 : Text[i] := 185; // ¹
175 : Text[i] := 187; // »
172 : Text[i] := 188; // ¼
171 : Text[i] := 189; // ½
243 : Text[i] := 190; // ¾
168 : Text[i] := 191; // ¿
183 : Text[i] := 192; // À
181 : Text[i] := 193; // Á
182 : Text[i] := 194; // Â
199 : Text[i] := 195; // Ã
142 : Text[i] := 196; // Ä
143 : Text[i] := 197; // Å
146 : Text[i] := 198; // Æ
128 : Text[i] := 199; // Ç
212 : Text[i] := 200; // È
144 : Text[i] := 201; // É
210 : Text[i] := 202; // Ê
211 : Text[i] := 203; // Ë
222 : Text[i] := 204; // Ì
214 : Text[i] := 205; // Í
215 : Text[i] := 206; // Î
216 : Text[i] := 207; // Ï
209 : Text[i] := 208; // Ð
165 : Text[i] := 209; // Ñ
227 : Text[i] := 210; // Ò
224 : Text[i] := 211; // Ó
226 : Text[i] := 212; // Ô
229 : Text[i] := 213; // Õ
153 : Text[i] := 214; // Ö
158 : Text[i] := 215; // ×
157 : Text[i] := 216; // Ø
235 : Text[i] := 217; // Ù
233 : Text[i] := 218; // Ú
234 : Text[i] := 219; // Û
154 : Text[i] := 220; // Ü
237 : Text[i] := 221; // Ý
232 : Text[i] := 222; // Þ
225 : Text[i] := 223; // ß
133 : Text[i] := 224; // à
160 : Text[i] := 225; // á
131 : Text[i] := 226; // â
198 : Text[i] := 227; // ã
132 : Text[i] := 228; // ä
134 : Text[i] := 229; // å
145 : Text[i] := 230; // æ
135 : Text[i] := 231; // ç
138 : Text[i] := 232; // è
130 : Text[i] := 233; // é
136 : Text[i] := 234; // ê
137 : Text[i] := 235; // ë
141 : Text[i] := 236; // ì
161 : Text[i] := 237; // í
140 : Text[i] := 238; // î
139 : Text[i] := 239; // ï
208 : Text[i] := 240; // ð
164 : Text[i] := 241; // ñ
149 : Text[i] := 242; // ò
162 : Text[i] := 243; // ó
147 : Text[i] := 244; // ô
228 : Text[i] := 245; // õ
148 : Text[i] := 246; // ö
246 : Text[i] := 247; // ÷
155 : Text[i] := 248; // ø
151 : Text[i] := 249; // ù
163 : Text[i] := 250; // ú
150 : Text[i] := 251; // û
129 : Text[i] := 252; // ü
236 : Text[i] := 253; // ý
231 : Text[i] := 254; // þ
152 : Text[i] := 255; // ÿ
END;
END;
EXIT(Text);