Solved

CR.Net: dynamic image loading from url stored in sql database, output as pdf

Posted on 2004-09-27
17
433 Views
Last Modified: 2013-11-18
Hi,

I'm having a heck of a time trying to get any of the potential work arounds for CR not liking to load images dynamically to work.

Does anyone have a working solution for CR.Net?

I have a SQL database with thousands of user profiles. Each profile record contains a url to a JPG image of the user. I'd like to make a CR.Net report that shows 4 images per page and outputs to PDF. I already have a report that creates a rectangle placeholder for each image and we've been using it to manually print the pages and glue pictures onto the paper. But it's now time for a more complete solution.

I can easily get just what I want without Crystal if I use ASP.Net capability to render dynamic html in real-time. But then I lose control of page breaks and margins. I've looked into .Net plug-ins for generating PDFs from html in real time and I think that's what I'll fall back on if I can't get Crystal to work.

Anyway, I hope I've properly described what I'm trying to accomplish. Please let me know if you need further elaboration.
0
Comment
Question by:jrogovsky
  • 5
  • 5
  • 3
  • +1
17 Comments
 
LVL 10

Expert Comment

by:ebolek
ID: 12162348
I have answered this question before

Check this out. It has the code and explain how to d oit

http://www.experts-exchange.com/Databases/Crystal_Reports/Q_21094752.html
Regards
Emre
0
 

Author Comment

by:jrogovsky
ID: 12162516
Thanks. I'll review the other thread. I'll probably have some questions. I'll accept the solution here once I've had a chance to review it. I hope the rules allow you to get my points for this even though it's a question that's already been asked; as far as I'm concerned this solution is worth 10,000 points!
0
 
LVL 42

Expert Comment

by:frodoman
ID: 12162528
The common technique that I've heard people using is to simply create a dynamic dataset and base your report off the ado.net dataset (general walkthru: http://support.businessobjects.com/communityCS/TechnicalPapers/rtm_reportingoffadonetdatasets.pdf.asp ).  Once your code adds the image to the dataset, the image would be just another field and the end result should be like reading the image itself directly from the db.

I haven't tried Emre's code so I don't know if it's better or worse than just using a dataset.

frodoman
0
 
LVL 10

Expert Comment

by:ebolek
ID: 12162537
I dont think you will be able to get refund for that because the answer is posted here to you. When you look at the answer, you will be glad that you didnt have to spend the time that I spent how to find it

Regards
Emre
0
 
LVL 10

Expert Comment

by:ebolek
ID: 12162542
>>frodoman
My code is also using datasets. There is no other way in .net if you dont embed your image into the database
Regards
Emre
0
 
LVL 42

Expert Comment

by:frodoman
ID: 12162556
Emre - I hadn't really looked at your link other than to see that you'd posted code / I didn't even read the code itself.  Certainly if that's what you're doing then the specific code is much more relevant than my general comment.  Cheers - frodoman
0
 

Author Comment

by:jrogovsky
ID: 12163038
Not looking for a refund at all. Just the opposite. I very much want you to get the credit!

I haven't had a chance to check the code out yet but will later today. Thanks again! :)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 10

Expert Comment

by:ebolek
ID: 12163172
No problem. Glad to help

Regards
Emre
0
 
LVL 26

Expert Comment

by:Kurt Reinhardt
ID: 12164321
Listen to both frodoman and emre.  Using a dynamic dataset is a good way to go.  Alternately, you can upload the images into a table in your database and simply report from them as another field.
0
 

Author Comment

by:jrogovsky
ID: 12203448
Hi all,

Sorry for not updating this in a couple of days. I gave the info to one of my employees and he couldn't get it implemented. I'm going to give it a try myself over the weekend and let you know if I have any problems/questions. Thanks again for the help.
0
 

Author Comment

by:jrogovsky
ID: 12394330
I still haven't had a chance to re-visit this issue. I've given the suggested solution to two employees and they couldn't make it work. It is coming around to being an important customer issue again so I intend to look into in myself in the next few days.
0
 
LVL 10

Accepted Solution

by:
ebolek earned 250 total points
ID: 12399548
check it out and tell us if you have any problems

Regards
Emre
0
 
LVL 42

Assisted Solution

by:frodoman
frodoman earned 250 total points
ID: 12402931
Please let us know - this should work for you.

frodoman
0
 

Author Comment

by:jrogovsky
ID: 12894916
First of all, I'd like to apologize for kind of dropping this when so many people tried to help right away.

I had initially delegated this to two of my employees and they both had problems getting it to work. It was only in the last few days that I was able to spend some time on this myself. I am happy to report that I have successfully implemented the advice to generate my report with images not stored in sql.

I'd like to thank Emre for his suggestions. I had already had the idea of loading the images into a dataset before binding to Crystal but hadn't researched the mechanics involved. Emre's source code saved me some time and effort.

There were a few things I did have to figure out for myself that I'd like to mention for anyone else researching a solution for this problem.

1) I used a type of "xs:base64Binary" for the column in the dataset that was used to design the Crystal Report. (See the PDF tutorial linked by Frodoman above for a good basic example of creating a report based on a dataset.) Crystal saw this column as a BLOB object and allowed me to set picture properties.

2) I didn't add the column the way Emre did in his code. It was already in the dataset that I created. I populated my dataset via an ADO.Net call to a SQL stored procedure that was designed to bring down the image column as null. Then I traversed the rows in the table inside my dataset (with a for loop) and loaded each image into the column record. I bound my now updated dataset to the Crystal Report and was actually surprised by how easy it worked.

Thanks again for everybody's help. This is truly a great website.

If anyone reading this needs help solving the same problem, I'd be happy to provide more specific details.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Not Exists 3 65
Crystal Reports 9 and Subreports 3 52
Crystal Reports Sum only working when drilling down 20 44
Help with a Crystal Report Formula 8 43
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
In this article you will learn how to create a free basic website on Bitbucket, a git service provider. Polymer creates dynamic HTML components, which allow more flexibility than static HTML. This tutorial uses Ubuntu Linux but can also be done on W…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now