Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Form fields visible, not accessible
  FAQ FAQ  Forum Search   Register Register  Login Login

Form fields visible, not accessible

 Post Reply Post Reply
Author
Message
JohnT View Drop Down
Team Player
Team Player


Joined: 23 Oct 13
Location: United States
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote JohnT Quote  Post ReplyReply Direct Link To This Post Topic: Form fields visible, not accessible
    Posted: 24 Oct 13 at 5:11AM
I loop through a table and create radio button and checkbox form fields.

The fields appear on the displayed PDF.

However, if I programmatically try to access certain fields either by title or index, they are not available.

Even checking with the following Delphi diagnostic loop reveals that certain fields are not there.

    TotalFormFields := DPL.FormFieldCount();
      for i := 1  to TotalFormFields do
      Begin
         FieldValue := DPL.GetFormFieldValue(i);
         FormFieldTitle := DPL.GetFormFieldTitle(i);
         Showmessage(inttostr(i) + ' ' + FormFieldTitle + ' ' + FieldValue);
      end;

And of course DPL.SetFormFieldValueByTitle and DPL.SetFormFieldValue do not work since the fields
seemingly disapear. The confusing part is that the fields are visually available and their titles display.

Thanks for any hints. Hope this gives at least enough to point me in the right direction.

John 
Back to Top
JohnT View Drop Down
Team Player
Team Player


Joined: 23 Oct 13
Location: United States
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote JohnT Quote  Post ReplyReply Direct Link To This Post Posted: 24 Oct 13 at 5:00PM
Update...

As expected it appears to be my problem.

When creating simple checkboxes for all fields everything is fine.

I have some sort of problem when creating subfields for radiobuttons.
The subfields are visible and a call to:
DPL.DrawText(500,Vertical, DPL.GetFormFieldTitle(r1));
shows the expected result.
More later when I find the cause.
Sorry for the "static."

John
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 28 Oct 13 at 12:48AM
John,

Here is some sample code that you might find useful


Andrew.

Back to Top
JohnT View Drop Down
Team Player
Team Player


Joined: 23 Oct 13
Location: United States
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote JohnT Quote  Post ReplyReply Direct Link To This Post Posted: 28 Oct 13 at 6:22PM
Thanks Andrew.

Unfortunately, I am still having a problem.

Hopefully a brief read of this Delphi excerpt by a set of fresh eyes will tell me what I am doing wrong.

I loop through a table and make a decision whether a field should be a radio button, (mutually exclusive) or simply a checkbox. The checkboxes work fine. Only the first radio button can actually have its value set. All subsequent attempts to set a value fail.

The raw code with the diagnostics included are shown. I test to see if the value can be set on
the radiobutton field. It is successful if it happens to be the FIRST radiobutton in a group. After that
it will not set the value.

Thanks for any insight anyone might have.

Sincerely,

John

if OptionsBookMasterQuery.FieldByName('MutuallyExclusive').value = True then
begin
   r2 := DPL.NewFormField(OptionsBookMasterQuerySelectionName.value, 4);
MarkNone := True; ///variable used to decide if a "None" radiobutton will be shown/value set
Showmessage('Created: ' + inttostr(r2)); ///diagnostic confirms the index number is there
end;

...
while not Form1.OptionsBookQuery.eof do
Begin
ProspectusPriceListCheckQuery.close;
ProspectusPriceListCheckQuery.Params[0].Value := Form1.CustomerLocalcustnmr.value;
ProspectusPriceListCheckQuery.Params[1].Value := Form1.OptionsBookQueryRecord.value;
ProspectusPriceListCheckQuery.Open;

 if ((OptionsBookMasterQuery.FieldByName('MutuallyExclusive').value <> True) or (OptionsBookQuery.RecordCount = 1)) then
begin /// checkboxes work fine...problem down below with radio buttons
r0 := DPL.NewFormField(Trim(FloatToStr(OptionsBookQueryRecord.value)), 3); ///checkbox
DPL.SetFormFieldBounds(r0, 50, Vertical - 15, 20, 20);
DPL.SetFormFieldCheckStyle(r0, csCheck, 1);
DPL.SetFormFieldBorderColor(r0,0,0,0);

end;// else

if OptionsBookMasterQuery.FieldByName('MutuallyExclusive').value = True then

begin
Showmessage('Field: ' +OptionsBookQueryName.value + ' ' + Trim(FloatToStr(OptionsBookQueryRecord.value)) + ' '+  inttostr(r2));

r1 := DPL.AddFormFieldSub(r2, Trim(FloatToStr(OptionsBookQueryRecord.value)));
Showmessage('SubField: ' +OptionsBookQueryName.value + ' ' + Trim(FloatToStr(OptionsBookQueryRecord.value)) + ' '+  inttostr(r1));

DPL.SetFormFieldBounds(r1, 50, Vertical - 15, 20, 20);
DPL.SetFormFieldCheckStyle(r1, csCheck, 1);
DPL.SetFormFieldBorderColor(r1,0,0,0);
If ProspectusPriceListCheckQuery.recordcount = 1 then
begin
c1 := 0;
c1 := DPL.SetFormFieldValue(r1,'Yes');
if c1 <> 0 then  showmessage('SUCCESS');
c2 := 0;
c2 := DPL.SetFormFieldValueByTitle(Trim(FloatToStr(ProspectusPriceListCheckQuery.fieldbyname('PriceListRecordNumber').value)),'Yes');// 
if c2 <> 0 then  showmessage('SUCCESS 2');
Showmessage('R1 ' + DPL.GetFormFieldValue(R1));
MarkNone := False;
end;
end;


Back to Top
JohnT View Drop Down
Team Player
Team Player


Joined: 23 Oct 13
Location: United States
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote JohnT Quote  Post ReplyReply Direct Link To This Post Posted: 28 Oct 13 at 7:38PM
PROBLEM SOLVED!

I misunderstood how the SetFormFieldValue function works.

Thanks for "listening."

John
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store