NetTalk Central

Author Topic: NTWS and Fomin - almost there  (Read 4379 times)

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
NTWS and Fomin - almost there
« on: May 09, 2012, 01:17:46 PM »
Hi,

I´m using the code form CS to generate SV Report to PDF into Fomin RunTimeReport. With some little changes. but p_web.SendFile can´t send me the file.

the PDF file is generated on web\reports but i can´t receive the file. and my button (i´m executing server side code after button pressed) is disable keep disable after pressed
Could someone help me?

thanks
Walter - SOFTVALE

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NTWS and Fomin - almost there
« Reply #1 on: May 09, 2012, 11:13:36 PM »
does the file exist after the report runs?
is it in your web.folder or below?

cheers
Bruce

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: NTWS and Fomin - almost there
« Reply #2 on: May 10, 2012, 05:07:13 AM »
Hi Bruce,

Yes, it is. and it is deleted after process cause its name start with $$$. I´ve put a MESSAGE before SendFile in this code.

  If Not p_Web &= NULL
    if not p_web.replyCompleted
      If Loc:NoRecords
        RelatorioSemRegistro(p_web)
      ElsIf not exists(loc:PDFName)
        Loc:html = 'The Print procedure failed to create the PDF file ['&clip(loc:PdfName)&']'
        p_web.ParseHTML(loc:html)
      Else
        p_web.ForceNoCache = 1
        p_web.ReplyContentType = p_web._GetContentType('.pdf')
        MESSAGE(loc:PDFName)
        p_web._Sendfile(loc:PDFName)
      End
    End
    p_web.SetProgress(loc:ProgressName,loc:URL)
  End

and check web\reports for the file. of course the file is deleted after code.

Walter - SOFTVALE

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NTWS and Fomin - almost there
« Reply #3 on: May 10, 2012, 06:36:49 AM »
It's deleted because it's sent.
ie SendFile will delete it after sending it (because of the $$$ in the name.)

ok, so it's being sent - but not received by the browser. Does it generate and get to the browser before the browser times out (ie typically inside 30 seconds)? Of does it try to send _after_ the browser times out?

cheers
Bruce

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: NTWS and Fomin - almost there
« Reply #4 on: May 10, 2012, 10:38:03 AM »
Hi Bruce,

It´s OK about deleting pdf file.

it is created about 2 seconds. anyway i don´t understant about browse time out. this what i´m doing:

thanks


[attachment deleted by admin]
Walter - SOFTVALE

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: NTWS and Fomin - almost there
« Reply #5 on: May 11, 2012, 10:51:25 AM »
Hi Bruce,

I did it. so, i was calling FRB RuntimeReport directly from server after click on button. i´ve created a NetWebPage serving PDF and i´m calling it as URL from button. On processed code embed i´m calling FRBRuntimeReport the same way i´ve sent last post with this change:

! == Sending PDF file  Priority 2500
  If Not p_Web &= NULL
    if not p_web.replyCompleted
      If Loc:NoRecords
        RelatorioSemRegistro(p_web)
      ElsIf not exists(loc:PDFName)
        Loc:html = 'The Print procedure failed to create the PDF file ['&clip(loc:PdfName)&']'
        p_web.ParseHTML(loc:html)
      Else
         p_web.SSV('loc:PDFName',loc:URL)
!        p_web.ForceNoCache = 1
!        p_web.ReplyContentType = p_web._GetContentType('.pdf')
!        p_web._Sendfile(loc:PDFName)
      End
    End
    p_web.SetProgress(loc:ProgressName,loc:URL)
  End

and on filename of NetWebPage i use p_web.gsv('loc:PDFName'). now i´m receiving pdf but the tab text is 404 error

i can use it this way for while. but if anyone have some improvement, please let me know
thaks
Walter - SOFTVALE

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: NTWS and Fomin - almost there
« Reply #6 on: May 11, 2012, 11:43:28 AM »
Bruce,

If i access it form mobile its cause exception error sending file.

:(
Walter - SOFTVALE