Tools.OpenReportCard_Customer( "<Customer>"."No.");
//MESSAGE( "<Customer>"."No.");
IF ShowPDFCLient.PDF.HASVALUE THEN BEGIN
MESSAGE('has value');
ShowPDFCLient.ShowPDF()
END
ELSE
MESSAGE('not value');
Hi,
Are you first importing data and the running it right after?
Have you any commits in the code? Although I normally warn against commits, then in this case that could maybe be the issue. Also if the report can be triggered manually also, then a commit after you finish handling the import data, could prevent at roll-back if the pdf-function fails.
Setup.Read;
IF PDF.HASVALUE THEN BEGIN
MESSAGE('HAShVALUE')
END
ELSE
MESSAGE('no value');
CALCFIELDS(PDF);
IF NOT PDF.HASVALUE THEN BEGIN
TESTFIELD(PDF);
END;
PDF.CREATEINSTREAM(InStream);
Tools.ShowPDF(InStream);
//MESSAGE('Dinges: %1', Response.COUNT);
IF Response.FIND('-') THEN
BEGIN
IF Response.COUNT = 1 THEN
BEGIN
CreditFetchRapport.RetrieveOnlineReportProcess(Response);
//total Counter
TotalFound := TotalFound + 1;
//ShowPDFCLient.ShowPDF();
END;
END;
SLEEP(300);
COMMIT;
Tools.OpenReportCard_Customer( "<Customer>"."No.");
Request."Link Type" := Request."Link Type"::customer;
IF ShowPDFCLient.PDF.HASVALUE THEN BEGIN
MESSAGE('has value');
ShowPDFCLient.ShowPDF()
END
ELSE
MESSAGE('not value');
Let me see if I fully understand the issue right now:
You can run the function to import the lines. After import you can manually show the pdf file with the ShowPDF function.
If you run the function directly, in the context of the import function, then it the PDF field shows as having no data? And if it fails to show, then you can still show it manually after?
If that is correct, then I understand that you are puzzled. Me too.
You have showed a lot of your code. But where do you actually sets the value of the showpdfclient pdf blob field?
Also looking at the code in the reply above, then where did you GET the ShowPDFClient record. After you get it, then before HASVALUE, did you CALCFIELDS(PDF) first?
//MESSAGE('Dinges: %1', Response.COUNT);
IF Response.FIND('-') THEN
BEGIN
IF Response.COUNT = 1 THEN
BEGIN
CreditFetchRapport.RetrieveOnlineReportProcess(Response);
//total Counter
TotalFound := TotalFound + 1;
//ShowPDFCLient.ShowPDF();
END;
END;
SLEEP(300);
COMMIT;
Tools.OpenReportCard_Customer( "<Customer>"."No.");
Request."Link Type" := Request."Link Type"::customer;
ShowPDFCLient.CALCFIELDS(PDF);
//MESSAGE(ShowPDFCLient."CS Company Name");
IF ShowPDFCLient.PDF.HASVALUE THEN BEGIN
MESSAGE('has value');
ShowPDFCLient.ShowPDF()
END
ELSE
MESSAGE('not value');
I get the message that I have to declare CLACFIELDS in globals? But CALCFUNCTION is a function
IF ISSERVICETIER THEN BEGIN
Filename := GetTempFilename('pdf');
DOWNLOADFROMSTREAM(InStream,'',FileManagement.Magicpath,Text010,Filename);
END ELSE BEGIN
File.CREATETEMPFILE;
Filename := File.NAME + '.pdf';
File.CLOSE;
File.CREATE(Filename);
File.CREATEOUTSTREAM(OutStream);
COPYSTREAM(OutStream,InStream);
File.CLOSE;
END;
HYPERLINK(Filename);
After the function ShowPDF() it goes to: this function:
I really like to help you out, but you make it very difficult if you don’t start answering the questions asked, in the previous reply.
So let me give you those questions again:
Let me see if I fully understand the issue right now:
1) You can run the function to import the lines. After import you can manually show the pdf file with the ShowPDF function.
2) If you run the function directly, in the context of the import function, then it the PDF field shows as having no data? And if it fails to show, then you can still show it manually after?
If that is correct, then I understand that you are puzzled. Me too.
Is this assumption correction?
You have showed a lot of your code. But where do you actually sets the value of the showpdfclient pdf blob field?
Also looking at the code in the reply above, then where did you GET the ShowPDFClient record. After you get it, then before HASVALUE, did you CALCFIELDS(PDF) first?
I’m not really interested in what happens in the function you wrote (as I read it) works. I like to know why there is no value in the pdf blob field.
If that is correct, then I understand that you are puzzled. Me too.
Yes. Because there is a button. you can see it in the image I posted. If you trigger that button a pdf will be shown. But if you do it in the XML port the PDF is empty and no pdf will be shown.
CALCFIELDS(PDF) that is part of that function(ShowPDF())
Yes I understand that. But please show me the code where you GET or FIND or INSERT or in what other way you populate the table containing the BLOB field that you have your PDF file in. Especially where you stream the data into the field, to where you check its value.