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!<br> <br> I got some problems with this report:<br> <br> What Im trying to do is make some listing of all the medicines (a Vademecum). <br> In my DB I got some columns like Name, Laboratory, Doses, etc. <br> <br> What Im trying to do is that my report do the format for itself. I got all the code in the same script.<br> <br> But when I run it, it brings the next error:<br> <br> Error 5800 : Scripting Error.  <br>  [ Extended Info:Source: Report , Event: Line number: 24  Description:End-of-instrucion expected]<br> <br> I dont know what this could mean. <br> <br> 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] <br> <br>    I changed a lot of references to the objetcs inside and change the variable's declarations.<br> <br>    And now my report its running<br> <br>    But there's still a problem.<br> <br>    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.<br> <br>    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.<br> <br>    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.<br> <br>    1.- In VB, when I execute this code:<br> <br>          PLen = Len(rtbBack.Text)<br>          rtbBack.SelStart = PLen<br>          rtbBack.SelText = !NomCom & vbCrLf<br>          rtbBack.SelStart = PLen<br>          rtbBack.SelLength = Len(!NomCom) + 2<br>          rtbBack.SelColor = vbBlack<br>          rtbBack.SelBold = True<br>          rtbBack.SelIndent = 80<br>          rtbBack.SelFontSize = 18<br>          rtbBack.SelUnderline = True<br>          rtbBack.Text = rtbBack.Text & vbCrLf<br> <br>    I get something Like this<br> <br>    <u> A Grin<br></u><br>    But when I execute this code on the script (almost the same due the sintax variations:<br> <br>    PLen = Len(rpt.Sections("Detalles").Controls("rtbBack").Text)<br>    rpt.Sections("Detalles").Controls("rtbBack").SelStart = PLen<br>    rpt.Sections("Detalles").Controls("rtbBack").SelText = rpt.Sections("Detalles").Controls("DataControl1").Recordset.Fields(1) & vbCrLf<br>    rpt.Sections("Detalles").Controls("rtbBack").SelStart = PLen<br>    rpt.Sections("Detalles").Controls("rtbBack").SelLength = Len(rpt.Sections("Detalles").Controls("DataControl1").Recordset.Fields(1)) + 2<br>    rpt.Sections("Detalles").Controls("rtbBack").SelColor = vbBlack<br>    rpt.Sections("Detalles").Controls("rtbBack").SelBold = True<br>    rpt.Sections("Detalles").Controls("rtbBack").SelIndent = 80<br>    rpt.Sections("Detalles").Controls("rtbBack").SelFontSize = 18 * 20<br>    rpt.Sections("Detalles").Controls("rtbBack").SelUnderline = True<br>    rpt.Sections("Detalles").Controls("rtbBack").Text = rpt.Sections("Detalles").Controls("rtbBack").Text & vbCrLf<br> <br>    What I get Is something like this:<br> <br>    A Grin<br> <br>    And thats because the RichEdit doesn execute the code as the VB's RTB.<br> <br>    Does anybody know why? I already downloaded the last SP.
  • Replied 4 August 2017, 2:44 pm EST

       Hi<br> <br>    In fact, I found this other issue:<br> <br>    When I  generate my RTF code through the AR, the result is quite diferent from the RTF code generated by VB.<br> <br>    This can be seen in the files zipped in this post.<br> <br>    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 <br> <br>    ... & vbCrLf + vbLf<br> <br> what this does is a car retun and then put another blanck line.<br> <br>    the same code in AR just make the line highest.<br> <br>    Checking the RTF code in both file, is easy to see that AR y VB generates different RTF code? <br> <br>    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.<br> <br>    Id just insert an VB's rtb on my report through the .AddNamedItem and it make all the dirty job.<br> <br> <br>     Tnx for listenning hahahahaha<br> <br>     jluis!
Need extra support?

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

Learn More

Forum Channels