JPG/TIFF to PDF over the web with AR

Posted by: neerpds on 4 August 2017, 2:43 pm EST

  • Posted 4 August 2017, 2:43 pm EST

    how hard is it to export a RPX report to PDF through the web?

    or a solution to convert jpg/tiff scanned files to PDF and deliver it to a user through webrowser? The convertion must be done everytime they click on the link.

    Thanks
  • Replied 4 August 2017, 2:43 pm EST

    All exports are done from the completed report output, which is in RDF format.  Exports from RDF are all very similar.  Please see the following helpfile article for an example:
    http://www.datadynamics.com/Help/AR2/AR2Exports/HX_Using_The_Export_Filters.html

    And a web example is here:
    http://www.datadynamics.com/ShowPost.aspx?PostID=2275

    If you run into any difficulty in accomplishing this, let us know.
  • Replied 4 August 2017, 2:43 pm EST

    Question, is it possible to output a recordset of images?

    say I query the database and have a recordset of 5 imagepaths... all JPGs
    and I have a Image element in the detail of my RPX.. would simply linking the Datafield be enough to output the images?

     
  • Replied 4 August 2017, 2:43 pm EST

    Not as I recall.  You need to call LoadPicture on the file path in order to load the image onto the report.  I suggest having a hidden textbox (with the DataField property set to your path column - no DataField on the Image) in the same section as the Image control and using the following code in the format event of that section:
    Me.Image1.Picture = LoadPicture(Me.Field1.DataValue)
  • Replied 4 August 2017, 2:43 pm EST

    Hey Peter, thanks for the reply,
    but I get a error in acrobat. "File does not begin with '%PDF-'"

    I tested the field called"imagepath" and it works fine without the format.. which looks like this :

    Sub OnFormat
     Me.Image.Picture = LoadPicture(Me.ImagePath.DataValue)
    End Sub

    Any ideas?
  • Replied 4 August 2017, 2:43 pm EST

    ok, after doing some crafty debugging I figured this out! (note that error above was only in Firefox.. IE just loaded a blank page)

    "Event : OnFormat , Line number: 2 Description:Object doesn't support this property or method: 'Me.ImagePath'"

    The field is there! I even tried it without the me.. and it gave the same asnwer!! and I do have
    the only code in the rpx is :
    Sub OnFormat
     Me.Image.Picture = LoadPicture(Me.ImagePath.DataValue)
    End Sub


    got any ideas on this?
  • Replied 4 August 2017, 2:43 pm EST

    When I played with this, I was unable to bind a string to the image source except with the hidden textbox.  Binding with the DataField is intended for an actual image in the datasource.  The line and scenario from above does allow for this.  Again, take the path from a hidden textbox bound to the image path's column and use that in your LoadPicture call.
  • Replied 4 August 2017, 2:43 pm EST

    Ya, I'm pretty sure I did that! here I have attached the RPX file.

    I can post the vb code too! if you like!!

    2005/10/JPEGtoPDF.rpx
  • Replied 4 August 2017, 2:43 pm EST

    You do not have a control on this RPX named "ImagePath".  Try the following code instead:
    Me.Image.Picture = LoadPicture(Me.Path.DataValue)

    It appears that you are trying this in script as well.  In script, this would be:
    rpt.Sections("Detail").Controls("Image").Picture = LoadPicture(rpt.Sections("Detail").Controls("Path").DataValue)
Need extra support?

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

Learn More

Forum Channels