Hey guys.
I have a problem with emailing of remittance advices - the company wants their logo in the .html file we email them. Good old outlook seperates the email into an .html part and a .bmp part which is the bitmap logo on the report.
Of course - some of their clients anti-virus software blocks the .bmp attachment and rejects the email.
The simple solution is to remove the logo - but the client insists its on the report.
Is there any way i can get round this?
Cheers,
James
0
Comments
http://www.mibuso.com/forum/search.php
http://www.BiloBeauty.com
http://www.autismspeaks.org
James
Another problem using html-reporting would be the antivirus or antispam filter. Standard html-documents from Navision are not w3c-compliant. By it is possible to manipulate the html-code and inserting the missing parts: Meta-tag and language-definitions.
Streaming the html-file into a table with a integer key-field and a text=250-field. Then insert the missing parts and outstream back into a html-file. That should do the trick \:D/
Wow.... dont suppose you have any example code :shock:
I'm using two functions to extract html-code from the navision html-report file, then I clean it to remove those annoying page-sections and inserting missing code-parts.
After cleaning the code it will be returned to the original html-file.
This procedure doesn't take much time and I have experienced that the result will be accepted in very strong antispam and and antivirus filters.
CleanHTML(l_HTMLName : Text[250]) : Boolean
{
Variables:
Globals
tmptabel(rec. Comment Line) // In table Comment Line the description-field is extended to text=250
IntLine(Integer) // This is partly hardcoded. The Html-code in Navision reports allways have the same beginning.
Text50102 = <HR> // Pagesection-tags
Text50101 = META-tag definitions. Take a look at w3c-homepage
Text50100 = Default header with script-tag. Take a look at w3c-homepage to get some examples.
}
IF tmpTabel.FIND('-') THEN
tmpTabel.DELETEALL;
CLEAR(intLine);
HTMLFile.OPEN(l_HTMLName);
HTMLFile.CREATEINSTREAM(IsInstream);
WHILE NOT (IsInstream.EOS()) DO BEGIN
intCount := IsInstream.READTEXT(strContainer, 250);
intLine := intLine + 10;
IF STRPOS(strContainer, Text50102) <> 0 THEN BEGIN
strContainer := DELSTR(strContainer, STRPOS(strContainer, Text50102), STRLEN(Text50102));
END;
tmpTabel."Table Name" := 0;
tmpTabel."No." := '';
tmpTabel."Line No." := intLine;
tmpTabel.Comment := strContainer;
tmpTabel.INSERT;
END;
// Insert header into htmlfile
tmpTabel."Table Name" := 0;
tmpTabel."No." := '';
tmpTabel."Line No." := 1; // Hardcoded due to the fact that the file structure is allways the same
tmpTabel.Comment := Text50100;
tmpTabel.INSERT;
// Insert meta-tag into htmlfile
tmpTabel."Table Name" := 0;
tmpTabel."No." := '';
tmpTabel."Line No." := 31; // Hardcoded due to the fact that the file structure is allways the same
tmpTabel.Comment := Text50101;
tmpTabel.INSERT;
HTMLFile.CLOSE;
EXIT(ReCreateHTML(l_HTMLName));
ReCreateHTML(l_htmlName : Text[250]) : Boolean
IsCreate := HTMLFile.CREATE(l_htmlName);
HTMLFile.CREATEOUTSTREAM(IsOutstream);
IF tmpTabel.FIND('-') THEN BEGIN
REPEAT
IsOutstream.WRITETEXT(tmpTabel.Comment);
UNTIL tmpTabel.NEXT = 0;
END;
HTMLFile.CLOSE;
EXIT(IsCreate);
Note:
l_htmlName contains the saveashtml-filename. This filename should be consistent for every html-report. Make some function to define this filename before you run report.saveashtml.