Tweak grid export dialog with some minor enhancements:

- Auto select ANSI encoding for Excel output, see http://en.wikipedia.org/wiki/Comma-separated_values#Application_support
- Auto modify file extension when selecting format
- Support "Include query" checkbox in XML format, see http://www.heidisql.com/forum.php?t=10853#p11082
- Imitate mysqldump's XML style, see http://dev.mysql.com/doc/refman/5.5/en/mysqldump.html#option_mysqldump_xml
This commit is contained in:
Ansgar Becker
2012-08-31 09:54:01 +00:00
parent 17600be9c1
commit 694a99f13a
3 changed files with 86 additions and 56 deletions

View File

@ -242,7 +242,7 @@ type
function sstr(str: String; len: Integer) : String;
function encrypt(str: String): String;
function decrypt(str: String): String;
function htmlentities(str: String): String;
function HTMLSpecialChars(str: String): String;
function BestTableName(Data: TDBQuery): String;
function EncodeURL(const Src: String): String;
procedure StreamWrite(S: TStream; Text: String = '');
@ -477,15 +477,9 @@ begin
end;
{***
Convert HTML-characters to their corresponding entities
@param string Text used for search+replace
@return string Text with entities
}
function htmlentities(str: String) : String;
function HTMLSpecialChars(str: String) : String;
begin
// Convert critical HTML-characters to entities. Used in grid export.
result := StringReplace(str, '&', '&', [rfReplaceAll]);
result := StringReplace(result, '<', '&lt;', [rfReplaceAll]);
result := StringReplace(result, '>', '&gt;', [rfReplaceAll]);