Quantcast
Channel: Dynamics 365 Business Central/NAV User Group
Viewing all articles
Browse latest Browse all 11285

Forum Post: RE: Show pdf file after after linking

$
0
0
And this is my xml port: Documentation() Report - OnInitReport() Report - OnPreReport() Report - OnPostReport() IF Filename <> '' THEN ImportFile ELSE MESSAGE(NoFileText); Report - OnCreateHyperlink(VAR URL : Text[1024]) Report - OnHyperlink(URL : Text[1024]) UploadFile(VAR FileName : Text[1024]) IF NOT ISSERVICETIER THEN NewFileName := CommonDialogMgt.OpenFile(Caption,FileName,4,Filefilter,0) ELSE IF NOT(UPLOAD(Caption,'',Filefilter,FileName,NewFileName)) THEN NewFileName := ''; IF NewFileName <> '' THEN FileName := NewFileName; ImportFile() // The import function in NAV cant handle with the xmlns line in the xml file. So a work around is to strip the line with the //xmlns in it. dFile.TEXTMODE(FALSE); dFile.OPEN(Filename); dFile.CREATEINSTREAM(Stream); InputText.READ(Stream); dFile.CLOSE; TextToFind :=' xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'; TextPos := InputText.TEXTPOS(TextToFind); WHILE TextPos <> 0 DO BEGIN InputText.GETSUBTEXT(SubText, 1, TextPos - 1); OutputText.ADDTEXT(SubText); InputText.GETSUBTEXT(InputText, TextPos + STRLEN(TextToFind)); TextPos := InputText.TEXTPOS(TextToFind); END; OutputText.ADDTEXT(InputText); //Begin kvk TextToFindKVKBegin :=' '; TextToFindKVKEnd :=' '; Pos1 := InputText.TEXTPOS(TextToFindKVKBegin); Pos2 := InputText.TEXTPOS(TextToFindKVKEnd); Pos := Pos1; WHILE Pos <> 0 DO BEGIN InputText.GETSUBTEXT(result,Pos1+5,Pos2-(Pos1+5)); InputText.GETSUBTEXT(InputText,Pos2+6,GivenText.LENGTH); Pos1 := InputText.TEXTPOS(TextToFindKVKBegin); Pos2 := InputText.TEXTPOS(TextToFindKVKEnd); Pos := Pos1; END; duplicateChambreofCommerce.SETRANGE(duplicateChambreofCommerce."Chamber of Commerce no.",result); IF duplicateChambreofCommerce.FINDFIRST THEN ERROR('KVK nummer bestaat al.'); dFile.TEXTMODE(FALSE); dFile.CREATE(Filename); dFile.CREATEOUTSTREAM(NVOutStream); OutputText.WRITE(NVOutStream); dFile.CLOSE; IF ISSERVICETIER THEN BEGIN IF UPLOADINTOSTREAM( 'Select the simple.xml file', '\\svdh04\data\NAV docs\webaanmelding\', 'XML File *.xml| *.xml', Filename, Stream) THEN MESSAGE(ImportCompleteText) ELSE EXIT; END ELSE BEGIN dFile.OPEN(Filename); dFile.CREATEINSTREAM(Stream); IF NOT XMLPORT.IMPORT(50010,Stream) THEN MESSAGE(ErrorText) ELSE MESSAGE(ImportCompleteText); END; IF NOT ISSERVICETIER THEN dFile.CLOSE;

Viewing all articles
Browse latest Browse all 11285

Trending Articles