cancel
Showing results for 
Search instead for 
Did you mean: 

Printing issue with MS SQL Server BLOB (jpg) Data Fields

Former Member
0 Kudos

I'm using MS SQL Server 2014 and Crystal Reports 2013.

The report prints BLOB data field (.jpg) when it runs from Crystal Reports Designer Preview (Screenshot 1), but the fields are blank when the report is printed from the Crystal Reports Viewer.  Please note that the only BLOB fields are blank other data fields are working properly.

Please help.

Screenshot 1:

Screenshot 2:

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Did you write an application using our .NET SDK packages?

Or are you using the Crystal Reports Viewer product itself?

Don

Former Member
0 Kudos

The application printing blank BLOB fields developed by using crystal reports for visual studio .NET SDK. It uses the CR Viewer from the .NET SDK package.

Thanks.

0 Kudos

See this post, the end of it, it's a long one...

There is a a line to add to the code that will fix this...

    // Open a report and get and fill in the various info boxes
   private void btnOpenReport_Click(object sender, System.EventArgs e)
   {
        // from Soda to handle Viewer OLE Object refresh issue 175343
        crystalReportViewer1.CachedPageNumberPerDoc = 1;

Don

Former Member
0 Kudos

Thanks Don for the detail answer,

Is it possible to set this flag without touching the application? For example: using Windows Registry to set this flag ON by default.

It is a third party application and its update is out of the scope.

FYI,

I've developed a sample application myself for the testing purposes, which prints the same report .  I've also added the line "crystalReportViewer1.CachedPageNumberPerDoc = 1" you have suggested for the fix, but I have no success. The BLOB fields are still blank.

Any idea?

0 Kudos

Search for KBA 2163438, it includes a Printer app that you can test with.

See if setting the Viewers Print button to use POC, it's the same Dialog box CR designer uses and may fix this.

And no there is no registry or command line option to enable that feature.

Are the JPG's static or loaded from a database?

Don

Former Member
0 Kudos

I'll check the KBA and share the results later.

But, what I found during my research today is:

the report under the question is printing poperly if I use OLEDB Provider for SQL Server. Anyway the application requires the ODBC connection only. 

My assumption is something goes wrong with Crystal Reports .NET SDK if the report is created using ODBC Crystal Reports driver.

The DSN is creted with MS SQL Server Native Client 11.0.

JPG is loaded from the database (varbinary(MAX)).

0 Kudos

Write an app that doesn't use CR and see if you can display the images using ODBC. Could be a buffer overun, too much data, for those images to get through the ODBC driver.

Enable ODBC tracing and see if it reports any errors.

Don

Former Member
0 Kudos

Hi Don,

Please find the results of KBA 2163438 in the screenshots below:


Screenshot 1: Report1.rpt created using ODBC connection and DB driver shows crdb_odbc.dll file with major version 13.0, which means that it part of Crystal Reports .NET SDK package.

Screenshot 2: Report2.rpt created using OLEDB connection and DB driver shows crdb_ado.dll, which also is a part of Crystal Reports .NET SDK package.

Please note that the both reports are successfully printed from Crystal Reports 2013 Designer preview either with ODBC or OELDB.  The driver files mentioned above (crdb_odbc.dll and crdb_ado.dll) are placed on the different place for Crystal Reports 2013 and the major version for them is 14.1. That is why I'm referring to the Crystal Reports .NET SDK fix rather than issue with ODBC connection.

I'll also develop a sample application which shows an image from database without using CR, and let you know the results.

Thanks in advance.

0 Kudos

Thank you for testing...

It definitely looks to be an issue in the ODBC driver. I've never seen this happen before though.

Is it possible for you to zip up the MDF and LDF files that hold those images so I can test here also and if required I would need to send the dB to DEV to look into also?

Make a copy of the DB and remove all the table not needed and any private info, Or export that table into a new DB/table and send just it, with an ID field also so I can get other data with the field.

If you can I'll send you a link to upload it to...

Just thought of something else to try, open the report and click on File, Report Options.. and check on this option:

Don

Former Member
0 Kudos

Yes, I can send you the SQL DB backup with tables that refer to the report as well as the report file itself. Just provide me with the upload link and I'll send it you tomorrow morning.

I had already tried the report option earlier, that you suggested, but the issue still exists.

Thanks Don

0 Kudos

And I need to know the version of MS SQL you are using.

It is actually a lot easier to simply attach the MDF to my Server, Restoring requires the names of the DB whcih I don't know.

And the MDF/LDF file will zip up to quite a small file.

Don

Former Member
0 Kudos

Hi Don,

I've uploaded the TESTDB.zip file to the link you have provided.

Please extract the archive to find the requested files:

TESTDB.mdf

TESTDB_log.ldf

Report1.rpt

Report2.rpt

Please note that I'm using MS SQL Server 2014 with SP1.

Thanks in advance.

Former Member
0 Kudos

Hi Don,

Any updates on this thread?

Gevorg

0 Kudos

Hello,

Thanks, just got back form holidays. I'll get my 2014 server running and attach, that's again.

mmmm. works for me, both black and white and color.

So I suggest looking at the printer and driver.

What printer are you using to test with?

Don

Former Member
0 Kudos

The printer is Canon LBP6670 Class Driver You can find it on the top-left corner of the screenshot I've provided earlier.

Could you tell me what is the number of the CR .NET SDK support pack you have installed on your test PC?

I'm testing on the Windows 10 x86 System, does it make sense?

Could you please attach the screeshot of your test too?

Thanks

Former Member
0 Kudos

Hi Don,

It would be more helpful if we can arrange a TeamViewer remote session to connect to my test PC.  I will reproduce the issue during the remote session so that we can try to solve it.

I've also created a new test PC with Windows 7 x64 system, that have only CR runtime version 13.0.16.1954 (the latest one) installed on that PC, but I've got the same result (a blank image with ODBC).

Please let me know if my suggestion with the remote session is applicable for you.

Thanks in advance

0 Kudos

Sorry, this is not a support system that allows direct access. If you want to connect you'll have to purchase a single case or if you have a support contract create one in SMP.

Yesterday I did a quick test just before leaving for the day, now that I have done more testing I can duplicate the problem....

I don't get the images if I remove the saved data with the report and set log on and parameter value at runtime either, so it's not a printer problem.

Seems the routine in the crdb_odbc has a problem with the amount or data type when using JPG's.

Also has nothing to do with the option for caching either.

I'll have to send this off to DEV to see if there is some registry key that might fix this or if they need to do a fix..

I'll update the post once I get the case created.

Don

Incident 152017 / 2016 / Accessing JPG from SQL server fails for ODBC - OLE DB works

KBA - 2322297 - Accessing JPG through Stored Procedure from MS SQL Server 2014 fails to show images using ODBC, OLE DB works.

Former Member
0 Kudos

Thank you very much for your effort to help me with this case. I appreciate it. I'll be waiting for your update.

0 Kudos

Done, info updated above....

Interesting way you wrote the SP to collect the image files into the buffer.... May have something to do with it. But I don't use SQL this way so not sure if that is the way it should be done.

Once R&D has a look at tit they can determine the cause how to fix it.

If it's a Registry fix I'll update the post, if it needs code fix it will be released in SP 18.

Thanks again

Don

Former Member
0 Kudos

Hi Don,

Many thanks for your great support.

The issue was solved in SP18.

Regards,

Gevorg

Answers (1)

Answers (1)

mapostol
Discoverer
0 Kudos

I have the same issue with Crystal Report 2020. TIF images are showing as a white square blob field. However, images are showing perfectly in Version 10. Images are saved in SQL server database. Can you please assist?