A doubt about scripting

Posted by: jluis-dd on 4 August 2017, 2:44 pm EST

  • Posted 4 August 2017, 2:44 pm EST

    Hi!

    I got some problems with this report:

    What Im trying to do is make some listing of all the medicines (a Vademecum).
    In my DB I got some columns like Name, Laboratory, Doses, etc.

    What Im trying to do is that my report do the format for itself. I got all the code in the same script.

    But when I run it, it brings the next error:

    Error 5800 : Scripting Error. 
     [ Extended Info:Source: Report , Event: Line number: 24  Description:End-of-instrucion expected]

    I dont know what this could mean.

    Here's a copu of my report
    2005/10/Vademecum.rpx
  • Replied 4 August 2017, 2:44 pm EST

    I didn't see anything besides your script to set what looks to be the majority of your font to size 8, which is pretty small, I normally run a 10. What size of font do you normally use for reporting?
  • Replied 4 August 2017, 2:44 pm EST

       Id found the problem [:D]

       I changed a lot of references to the objetcs inside and change the variable's declarations.

       And now my report its running

       But there's still a problem.

       When the ARD display the report. The text seems to be too small. Does anybody knows why?
  • Replied 4 August 2017, 2:44 pm EST

       Its not the font size, because I changed it to 250 and looks like the image2.

       In the image1, what I did was load the rpx file and set directly the rtftext to the richedit, instead just send the recordset like in my previous post.

       I dont know if the richedit changes the values of the font sizes or was my code?
    2005/10/image2.zip
  • Replied 4 August 2017, 2:44 pm EST

       Id found this issue in the performance of the DD's rich edit.

       1.- In VB, when I execute this code:

             PLen = Len(rtbBack.Text)
             rtbBack.SelStart = PLen
             rtbBack.SelText = !NomCom & vbCrLf
             rtbBack.SelStart = PLen
             rtbBack.SelLength = Len(!NomCom) + 2
             rtbBack.SelColor = vbBlack
             rtbBack.SelBold = True
             rtbBack.SelIndent = 80
             rtbBack.SelFontSize = 18
             rtbBack.SelUnderline = True
             rtbBack.Text = rtbBack.Text & vbCrLf

       I get something Like this

       A Grin

       But when I execute this code on the script (almost the same due the sintax variations:

       PLen = Len(rpt.Sections("Detalles").Controls("rtbBack").Text)
       rpt.Sections("Detalles").Controls("rtbBack").SelStart = PLen
       rpt.Sections("Detalles").Controls("rtbBack").SelText = rpt.Sections("Detalles").Controls("DataControl1").Recordset.Fields(1) & vbCrLf
       rpt.Sections("Detalles").Controls("rtbBack").SelStart = PLen
       rpt.Sections("Detalles").Controls("rtbBack").SelLength = Len(rpt.Sections("Detalles").Controls("DataControl1").Recordset.Fields(1)) + 2
       rpt.Sections("Detalles").Controls("rtbBack").SelColor = vbBlack
       rpt.Sections("Detalles").Controls("rtbBack").SelBold = True
       rpt.Sections("Detalles").Controls("rtbBack").SelIndent = 80
       rpt.Sections("Detalles").Controls("rtbBack").SelFontSize = 18 * 20
       rpt.Sections("Detalles").Controls("rtbBack").SelUnderline = True
       rpt.Sections("Detalles").Controls("rtbBack").Text = rpt.Sections("Detalles").Controls("rtbBack").Text & vbCrLf

       What I get Is something like this:

       A Grin

       And thats because the RichEdit doesn execute the code as the VB's RTB.

       Does anybody know why? I already downloaded the last SP.
  • Replied 4 August 2017, 2:44 pm EST

       Hi

       In fact, I found this other issue:

       When I  generate my RTF code through the AR, the result is quite diferent from the RTF code generated by VB.

       This can be seen in the files zipped in this post.

       As you can see, The AR's rtf code doesnt generates the same code as VB. And one proof is the end of lines, because in VB when I put this code

       ... & vbCrLf + vbLf

    what this does is a car retun and then put another blanck line.

       the same code in AR just make the line highest.

       Checking the RTF code in both file, is easy to see that AR y VB generates different RTF code?

       how can I force AR to generate the same code as VB?
    2005/10/rtf.zip
  • Replied 4 August 2017, 2:44 pm EST

       I guess I was only matter of RTF speciffications... By the way... I solve the problem.

       Id just insert an VB's rtb on my report through the .AddNamedItem and it make all the dirty job.


        Tnx for listenning hahahahaha

        jluis!
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels