fbpx
Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1

TOPIC:

PDF File not being created 14 Dec 2019 03:13 #12194

  • BiggyRat's Avatar

  • BiggyRat

  • Topic Author

    Hi, I've created a report, it prints to screen, printer and I can save manually to a file, but I cannot automate it, despite being able to do exactly what I want in the last program I wrote. I cannot see where I'm going wrong. Here's the code, and a screenshot of the variables output:

    METHOD OKButton( ) CLASS EditInvoice
    Local oReport as RpReport
    Local cFileName, cWorkDir,cMessage, cStr as String
    Local nInv, cCaption
    nInv := self:Server:FIELDGET(#INVNO)

    If gTermDays == 0
    gDueDate := FT_LDay(Today())
    else
    gDueDate := Today() + gTermDays
    end if

    // Bill To fields
    self:Server:FIELDPUT(#MAILADD1, AllTrim(self:oDCMAILADD1:CurrentText))
    self:Server:FIELDPUT(#MAILADD2, AllTrim(self:oDCMAILADD2:CurrentText))
    self:Server:FIELDPUT(#MAILSUBURB, AllTrim(self:oDCMAILSUBURB:CurrentText))
    self:Server:FIELDPUT(#MAILPCODE, AllTrim(self:oDCMAILPCODE:CurrentText))
    self:Server:FIELDPUT(#MAILSTATE, AllTrim(self:oDCMAILSTATE:CurrentText))
    self:Server:FIELDPUT(#CLNAME, AllTrim(self:oDCCLNAME:CurrentText))
    self:Server:FIELDPUT(#INVDATE, self:oDCInvDateDTP:SelectedDate)
    self:Server:FIELDPUT(#INVDUE, self:oDCDateTimePicker1:SelectedDate)
    self:Server:FIELDPUT(#CLIENTREF, self:oDCCLIENTREF:CurrentText)

    // Line 1
    self:Server:FIELDPUT(#ITEM1, AllTrim(self:oDCComboBoxEx1:CurrentItem))
    self:Server:FIELDPUT(#TAXTYPE1, iif(IsNil(self:oDCComboBoxEx11:VALUE), "", self:oDCComboBoxEx11:VALUE))
    self:Server:FIELDPUT(#ACC1, AllTrim(self:oDCComboBoxEx21:CurrentItem))
    self:Server:FIELDPUT(#UNITPR1, self:oDCUNITPR1:VALUE)
    self:Server:FIELDPUT(#QTY1, self:oDCQTY1:VALUE)
    self:Server:FIELDPUT(#GST1, self:oDCSingleLineEdit37:VALUE)
    self:Server:FIELDPUT(#TOTPR1, self:oDCTOTPR1:VALUE)
    self:Server:FIELDPUT(#LINE1, self:oDCLINE1:CurrentText)
    self:Server:Commit()

    // Line 2
    self:Server:FIELDPUT(#ITEM2, self:oDCComboBoxEx2:CurrentItem)
    self:Server:FIELDPUT(#TAXTYPE2, iif(IsNil(self:oDCComboBoxEx12:VALUE), "", self:oDCComboBoxEx12:VALUE))
    self:Server:FIELDPUT(#ACC2, self:oDCComboBoxEx22:CurrentItem)
    self:Server:FIELDPUT(#UNITPR2, self:oDCUNITPR2:VALUE)
    self:Server:FIELDPUT(#QTY2, self:oDCQTY2:VALUE)
    self:Server:FIELDPUT(#GST2, self:oDCSingleLineEdit38:VALUE)
    self:Server:FIELDPUT(#TOTPR2, self:oDCTOTPR2:VALUE)
    self:Server:FIELDPUT(#LINE2, self:oDCLINE2:CurrentText)
    self:Server:Commit()

    // Line 3
    self:Server:FIELDPUT(#ITEM3, self:oDCComboBoxEx3:CurrentItem)
    self:Server:FIELDPUT(#TAXTYPE3, iif(IsNil(self:oDCComboBoxEx13:VALUE), "", self:oDCComboBoxEx13:VALUE))
    self:Server:FIELDPUT(#ACC3, self:oDCComboBoxEx23:CurrentItem)
    self:Server:FIELDPUT(#UNITPR3, self:oDCUNITPR3:VALUE)
    self:Server:FIELDPUT(#QTY3, self:oDCQTY3:VALUE)
    self:Server:FIELDPUT(#GST3, self:oDCSingleLineEdit39:VALUE)
    self:Server:FIELDPUT(#TOTPR3, self:oDCTOTPR3:VALUE)
    self:Server:FIELDPUT(#LINE3, self:oDCLINE3:CurrentText)
    self:Server:Commit()

    // Line 4
    self:Server:FIELDPUT(#ITEM4, self:oDCComboBoxEx4:CurrentItem)
    self:Server:FIELDPUT(#TAXTYPE4, iif(IsNil(self:oDCComboBoxEx14:VALUE), "", self:oDCComboBoxEx14:VALUE))
    self:Server:FIELDPUT(#ACC4, self:oDCComboBoxEx24:CurrentItem)
    self:Server:FIELDPUT(#UNITPR4, self:oDCUNITPR4:VALUE)
    self:Server:FIELDPUT(#QTY4, self:oDCQTY4:VALUE)
    self:Server:FIELDPUT(#GST4, self:oDCSingleLineEdit40:VALUE)
    self:Server:FIELDPUT(#TOTPR4, self:oDCTOTPR4:VALUE)
    self:Server:FIELDPUT(#LINE4, self:oDCLINE4:CurrentText)
    self:Server:Commit()

    // Line 5
    self:Server:FIELDPUT(#ITEM5, self:oDCComboBoxEx5:CurrentItem)
    self:Server:FIELDPUT(#TAXTYPE5, iif(IsNil(self:oDCComboBoxEx15:VALUE), "", self:oDCComboBoxEx15:VALUE))
    self:Server:FIELDPUT(#ACC5, self:oDCComboBoxEx25:CurrentItem)
    self:Server:FIELDPUT(#UNITPR5, self:oDCUNITPR5:VALUE)
    self:Server:FIELDPUT(#QTY5, self:oDCQTY5:VALUE)
    self:Server:FIELDPUT(#GST5, self:oDCSingleLineEdit41:VALUE)
    self:Server:FIELDPUT(#TOTPR5, self:oDCTOTPR5:VALUE)
    self:Server:FIELDPUT(#LINE5, self:oDCLINE5:CurrentText)
    self:Server:Commit()

    // Line 6
    self:Server:FIELDPUT(#ITEM6, self:oDCComboBoxEx6:CurrentItem)
    self:Server:FIELDPUT(#TAXTYPE6, iif(IsNil(self:oDCComboBoxEx16:VALUE), "", self:oDCComboBoxEx16:VALUE))
    self:Server:FIELDPUT(#ACC6, self:oDCComboBoxEx26:CurrentItem)
    self:Server:FIELDPUT(#UNITPR6, self:oDCUNITPR6:VALUE)
    self:Server:FIELDPUT(#QTY6, self:oDCQTY6:VALUE)
    self:Server:FIELDPUT(#GST6, self:oDCSingleLineEdit42:VALUE)
    self:Server:FIELDPUT(#TOTPR6, self:oDCTOTPR6:VALUE)
    self:Server:FIELDPUT(#LINE6, self:oDCLINE6:CurrentText)
    self:Server:Commit()

    // Line 7
    self:Server:FIELDPUT(#ITEM7, self:oDCComboBoxEx7:CurrentItem)
    self:Server:FIELDPUT(#TAXTYPE7, iif(IsNil(self:oDCComboBoxEx17:VALUE), "", self:oDCComboBoxEx17:VALUE))
    self:Server:FIELDPUT(#ACC7, self:oDCComboBoxEx27:CurrentItem)
    self:Server:FIELDPUT(#UNITPR7, self:oDCUNITPR7:VALUE)
    self:Server:FIELDPUT(#QTY7, self:oDCQTY7:VALUE)
    self:Server:FIELDPUT(#GST7, self:oDCSingleLineEdit43:VALUE)
    self:Server:FIELDPUT(#TOTPR7, self:oDCTOTPR7:VALUE)
    self:Server:FIELDPUT(#LINE7, self:oDCLINE7:CurrentText)
    self:Server:Commit()

    // Line 8
    self:Server:FIELDPUT(#ITEM8, self:oDCComboBoxEx8:CurrentItem)
    self:Server:FIELDPUT(#TAXTYPE8, iif(IsNil(self:oDCComboBoxEx18:VALUE), "", self:oDCComboBoxEx18:VALUE))
    self:Server:FIELDPUT(#ACC8, self:oDCComboBoxEx28:CurrentItem)
    self:Server:FIELDPUT(#UNITPR8, self:oDCUNITPR8:VALUE)
    self:Server:FIELDPUT(#QTY8, self:oDCQTY8:VALUE)
    self:Server:FIELDPUT(#GST8, self:oDCSingleLineEdit44:VALUE)
    self:Server:FIELDPUT(#TOTPR8, self:oDCTOTPR8:VALUE)
    self:Server:FIELDPUT(#LINE8, self:oDCLINE8:CurrentText)
    self:Server:Commit()

    // Line 9
    self:Server:FIELDPUT(#ITEM9, self:oDCComboBoxEx9:CurrentItem)
    self:Server:FIELDPUT(#TAXTYPE9, iif(IsNil(self:oDCComboBoxEx19:VALUE), "", self:oDCComboBoxEx19:VALUE))
    self:Server:FIELDPUT(#ACC9, self:oDCComboBoxEx29:CurrentItem)
    self:Server:FIELDPUT(#UNITPR9, self:oDCUNITPR9:VALUE)
    self:Server:FIELDPUT(#QTY9, self:oDCQTY9:VALUE)
    self:Server:FIELDPUT(#GST9, self:oDCSingleLineEdit45:VALUE)
    self:Server:FIELDPUT(#TOTPR9, self:oDCTOTPR9:VALUE)
    self:Server:FIELDPUT(#LINE9, self:oDCLINE9:CurrentText)

    // Line 10
    self:Server:FIELDPUT(#ITEM10, self:oDCComboBoxEx10:CurrentItem)
    self:Server:FIELDPUT(#TAXTYPE10, iif(IsNil(self:oDCComboBoxEx20:VALUE), "", self:oDCComboBoxEx20:VALUE))
    self:Server:FIELDPUT(#ACC10, self:oDCComboBoxEx30:CurrentItem)
    self:Server:FIELDPUT(#UNITPR10, self:oDCUNITPR10:VALUE)
    self:Server:FIELDPUT(#QTY10, self:oDCQTY10:VALUE)
    self:Server:FIELDPUT(#GST10, self:oDCSingleLineEdit46:VALUE)
    self:Server:FIELDPUT(#TOTPR10, self:oDCTOTPR10:VALUE)
    self:Server:FIELDPUT(#LINE10, self:oDCLINE10:CurrentText)
    self:Server:Commit()

    cWorkDir := WorkDir() + "Invoices\"
    self:Server:Seek(nInv)
    cFileName := ""
    cFileName := cWorkDir + "Invoice "+ PadL(AllTrim(self:Server:FIELDGET(#INVNO)), 8, "0") + " from " + ProperA(AllTrim(gCompanyName)) + ".pdf"
    cFileName := "'" + cFileName + "'"
    cMessage := "Please Wait..."
    cCaption := "Test"
    oReport := RpReport{self, "LAINVOICE.RPT"}

    oReport:SeekExpression := AllTrim(nInv)
    oReport:SetVariableValue("gInvNo", AllTrim(nInv) )
    oReport:SetVariableValue("gAdd1", gAdd1)
    oReport:SetVariableValue("gAdd2", gAdd2)
    oReport:SetVariableValue("gABN", StrTran(gABN, "-", " "))
    oReport:SetVariableValue("gSuburb", gSuburb)
    oReport:SetVariableValue("gState", gState)
    oReport:SetVariableValue("gPCode", gPCode)
    oReport:SetVariableValue("gEmail", gEmail)
    oReport:SetVariableValue("gTermDays", gTermDays)
    oReport:SetVariableValue("gEOMPlusDay", gEOMPlusDay)
    oReport:SetVariableValue("cPhone", "Phone: " + AllTrim(gPhone))
    oReport:SetVariableValue("cEmail", "Email: " + AllTrim(gEmail))
    cStr := "Date Due: " + iif( gTermDays > 0, DToC(Today()+gTermDays), DToC(FT_LDay(Today()) + gEOMPlusDay))
    oReport:SetVariableValue("gEOMStr", cStr)

    oReport:PrintExport(cCaption ,cMessage, #RP_PDF, cFileName)
    ? "cCaption = " + cCaption
    ? "cMessage = " + cMessage
    ? "cFileName = " + cFileName
    oReport:Close()

    self:EndWindow()
    RETURN nil



    In the screenshot above, I've tried the file name (cFileName) with and without the ' at either end. No difference.

    Any ideas please?
    Attachments:

    Please Log in or Create an account to join the conversation.

    PDF File not being created - UPDATE! 15 Dec 2019 02:28 #12196

  • BiggyRat's Avatar

  • BiggyRat

  • Topic Author

    OK, looks like it is to do with RpExport.dll somehow, as it doesn't export to ANY format. The file size is always 0kb. Surely if it was a programmatic thing it wouldn't print properly? And why does it work fine from my other program???



    OK, NOW any ideas?
    Attachments:

    Please Log in or Create an account to join the conversation.

    Last edit: by BiggyRat.

    PDF File not being created 15 Dec 2019 13:06 #12199

  • Sherlock's Avatar

  • Sherlock


  • Posts: 24
  • Try file name with NO SPACES... seen weird things relating to this.
    Phil McGuinness

    Please Log in or Create an account to join the conversation.

    PDF File not being created - UPDATE! 15 Dec 2019 15:41 #12201

  • robert's Avatar

  • robert


  • Posts: 1790
  • Jeff,
    Does the version of the export DLL match the version of the other RP dlls ?
    Look at the tab 'Details'.

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    PDF File not being created 15 Dec 2019 23:15 #12204

  • BiggyRat's Avatar

  • BiggyRat

  • Topic Author

    No spaces didn't work I'm afraid Phil, but thank you. I tried aTest.pdf no difference... As for the DLL versions Robert, they all say 2.30.1.0

    After further investigation and testing, it appears the report itself is the culprit. Any ideas what may be causing it please? BMINVOICE WORKS, LAINVOICE does not. I also removed the image.... no difference....
    Attachments:

    Please Log in or Create an account to join the conversation.

    Last edit: by BiggyRat.

    PDF File not being created 18 Dec 2019 05:36 #12251

  • BiggyRat's Avatar

  • BiggyRat

  • Topic Author

    I have now deleted EVERYTHING off the report - text, fields, boxes, image, everything. It still plays up. Now this error has started:



    WTH does THAT mean please?
    Attachments:

    Please Log in or Create an account to join the conversation.

    PDF File not being created 18 Dec 2019 05:52 #12253

  • wriedmann's Avatar

  • wriedmann


  • Posts: 2300
  • Hi Jeff,

    "memory low" means exactly that - you have run out of memory.
    Maybe you have some sort of loop in your code, or better, an inifinite recursion.
    When I see this error, normally thatis the cause.
    Wolfgang
    P.S. I don't use nor know ReportPro, so I cannot give you any hint
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    PDF File not being created 18 Dec 2019 06:01 #12255

  • BiggyRat's Avatar

  • BiggyRat

  • Topic Author

    Yeah thanks Wolfgang, It's totally got me beat. I fire up the program, click the screen to activate the listing, then click ok. That's it! I cannot for the life of me see any loop.

    Please Log in or Create an account to join the conversation.

    PDF File not being created 18 Dec 2019 11:01 #12271

  • robert's Avatar

  • robert


  • Posts: 1790
  • Jeff,
    Send me the report and the data files.
    I'll have a look tonight.

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    PDF File not being created 09 Jan 2020 00:55 #12506

  • BiggyRat's Avatar

  • BiggyRat

  • Topic Author

    Well, that didn't work out. BUT I now KNOW it's not my code. It's the Report itself causing all my grief. I can export other reports to pdf using my code, just not this one report, which is attached. Any ideas please? I suspect maybe the grouping???
    Attachments:

    Please Log in or Create an account to join the conversation.

    PDF File not being created 09 Jan 2020 07:55 #12508

  • Chris's Avatar

  • Chris


  • Posts: 2033
  • Hi Jeff,

    I am sure a lot of people would be looking forward to help you out by trying your .rpt file, but you have not included any of the data (dbf files etc) that is necessary for it? How can we test this and give you feedback if we cannot test it in our machines?

    And also the problem could potentially lay in the actual code that is calling/showing the report, but we do not have that either, in order to have a look. When you ask for help for such a problem, it is always a very good idea to provide a full sample with all the code and support files needed, so people who try to help you can have a hands on look into it, rather than just makes guesses of what the problem could be.
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    PDF File not being created 09 Jan 2020 08:08 #12509

  • BiggyRat's Avatar

  • BiggyRat

  • Topic Author

    Hi Chris. all of the code was in my first post.

    I don't think it's my code, as I can export other reports without issue. This is the only one I have a problem with. It is also the only report that I use groupings and variable length memo fields, which is where I suspect the problem will be. I though someone would just look at the structure of the report and say "oh yeah, you screwed up there", and problem solved... seems not anyway, I've attached the report file, the databases, index files and fpt files. Hopefully that will be enough.
    Attachments:

    Please Log in or Create an account to join the conversation.

    Last edit: by BiggyRat.

    PDF File not being created 12 Jan 2020 02:19 #12572

  • BiggyRat's Avatar

  • BiggyRat

  • Topic Author

    I found it. Thanks.

    Please Log in or Create an account to join the conversation.

    PDF File not being created 12 Jan 2020 13:51 #12577

  • robert's Avatar

  • robert


  • Posts: 1790
  • Jeff,
    I am glad you found it. On the other newsgroup I saw that the image size of the logo was the problem.
    I can't remember that you have ever included the logo in your posts here.
    That is why nobody was able to help you, even when they wanted to.

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1