Solved

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

Posted on 2004-09-27
17
432 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
>>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
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 10

Expert Comment

by:ebolek
Comment Utility
No problem. Glad to help

Regards
Emre
0
 
LVL 26

Expert Comment

by:Kurt Reinhardt
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Please let us know - this should work for you.

frodoman
0
 

Author Comment

by:jrogovsky
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Formula to get month and year from date 5 40
Next Full Week 4 61
websphere 1 72
VS2010 and Crystal Reports Loading Image at runtime 8 50
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
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 video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

13 Experts available now in Live!

Get 1:1 Help Now