Report Builder fails to print images

Discussion forum about all things Report Builder (all versions).
ivano_osti
Brazil
Posts: 415
Joined: 17 Nov 2017, 20:02
Location: Itapira-SP, Brazil

Report Builder fails to print images

Post by ivano_osti » 28 Oct 2010, 13:17

Hi.

I'm migrating from CTD151 to TD52.

I have a lot of reports that we get images from database and then we print in the reports.

It works fine with CTD151 but it fails using TD52. I have a "G" (I think Gupta) in the place I should have a picture.

In the TD52 sample I tried to fix the problem with no success reading "employee.photo" inside a binary variable and then using SalStrToMultiByte() and SalStrToWideChar().

Attached samples and shotscreens of both CTD151 and TD52 using island database.

I think the problem is the same as a recent topic posted here "BMP in Report Builder".

I need an urgent fix because we are rushing with the migrations and we have a lot of this reports.

Look forward to hear from you.

Thank you.
You do not have the required permissions to view the files attached to this post.

mkonir

Re: Report Builder fails to print images

Post by mkonir » 01 Nov 2010, 17:39

We're printing images in reports without problems. You're probably not reading the binary data from database correctly and they get corrupted.

ivano_osti
Brazil
Posts: 415
Joined: 17 Nov 2017, 20:02
Location: Itapira-SP, Brazil

Re: Report Builder fails to print images

Post by ivano_osti » 03 Nov 2010, 11:41

Hi Milan.

Do you read into Long String and then use it as bind variable to the .QRP? It is what I do.

Is it possible you run my TD52 testcase using SQLBase's employee table?

I cannot understand why it works for you and not for me... I could not understand the way you work.

Thank you.

Jeff Luther

Re: Report Builder fails to print images

Post by Jeff Luther » 11 Nov 2010, 23:38

You are fetching a LONG that's a binary value, so you need to call SqlSetLongBindDatatype() for that. And you need to make that call between the Prepare and the Execute. Note I do Prepare on SAM_ReportStart, and Execute on SAM_ReportFetchInit:

Code: Select all

On SAM_ReportStart
   Return SqlPrepare( hSql,
         'Select employee_id, photo
         From employee
         Into :sEmployee_ID, :lsPhoto' )
On SAM_ReportFetchInit
   Call SqlSetLongBindDatatype( 2, 23 )
   Return SqlExecute( hSql )
See help for SqlSetLongBindDatatype() and the different values for the 2nd parameter. Now the BMPs get fetched and displayed OK in your test case.

Return to “General Discussion Report Builder”

Who is online

Users browsing this forum: No registered users and 1 guest