On 15-8-2011 11:25, Michael Van Canneyt wrote: > I created a dataset with 2 fields. A ftString field with size 33, and a > ftWideString field with size 44. > > Based on the following output from SaveToFile, I would say that you'll > need to put Size*SizeOf(CharTypeUsedInfield), which should be DataSize. > > Michael. > > <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <DATAPACKET > Version="2.0"> > <METADATA> > <FIELDS> > <FIELD attrname="stringveld" fieldtype="string" WIDTH="33"/> > <FIELD attrname="WideStringVeld" fieldtype="string.uni" WIDTH="44"/> > </FIELDS> > <PARAMS/> > </METADATA> > <ROWDATA> > </ROWDATA> > </DATAPACKET>
Thanks, Michael, Set to .DataSize... I'm ready for uploading this for inclusion in FPC, I can open a bugreport and attach the patch if you're happy with that. Fixes/changes since first commit to FPC ======================================= 1. Code cleanup to make it more modular and maintainable: split out code per export format and moved class-level variables there. 2. Delphi Clientdataset export now works thanks to FPC XML fixes by Sergei Gorelkin and tests/improvements by Ludo Brands. 3. Extended test coverage with all field types in a BufDataset so tests cover more. 4. Fixes for invalid data: Access, ADO.Net, Excel date limits respected (generate NULL or text fields respectively) 5. Decimalseparator setting in Access export should now work. 6. Variants are saved as blobs, not strings, because of their variable nature. 7. Fix for proper export of null values to Access NULL values (instead of empty/default values). 8. Changed description of class from "Unicode XML file with XSD" to "Unicode XML file" to better match unit function. 9. Compiled on Windows x86, Linux x64 without warnings using fpc -vweh fpxmlxsdexport.pp. Compared output. - ftVarBytes gave different output on Windows & Linux. Disregarded as I don't fill these fields in the test because of bug 19930 10. Added option KeepFilesAfterTest = true in xmlxsdexporttestcase1; can be switched to false to delete export test files after use. 11. Lower-cased source code file names. 12. Fixes for Linux invalid date export to Excel by using clocale and specifying dateformat (restored at end of export). 13 .Datasize instead of .Size for string/widestring Delphi fields. Regards, Reinier _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal