Showing posts with label inside. Show all posts
Showing posts with label inside. Show all posts

Wednesday, March 28, 2012

Manage Images dinamically

I've got two problems:
First problem
I've got a report with images inside. These images are referenced by phisical path in a db field. This path can change dinamically at runtime so i need to allow report to link the referenced images.
Is there a way to do this..?
Any suggestion is apprecied

Second problem
Is possible to get HDC (Handle Device Contest) of any objects inside the report..? I've to write an image into an object (if it's an image object is better) by an OCX control. If it's possible could i've some example about it..?

Thanks in advanced for any suggestion

Walter & DarioHa Walter,
Check out the Crystal example for this runtime picture load example,
(Crystal Decisions Technical Support - CR9_VB_RDC_LoadPic.exe)
It works.
Sorry can't help with the second point.

Cheers Phil.|||Ok, first of all Thanks Phil, that really does work, now I can finally use all my <EmployeeNr>.jpg 's in my detail section ;)

But my problem is now that this only work while I keep de Crystal report in my VB Project... And inserting a picture which is a whole A4 (it are certificates so) results in my compiled project file growing from 1,5Mb to 12Mb !!!

So I have to find a way to decrease this...
So I thought up a couple of things :
1) Use a external report, but that won't work because of the VB code needed in the report
2) Use a blank image @. start, but this doesn't help
3) Use a small image and recode the height and width of de imagefield, but everytime I try this I get Permission Denied and I can't find a way around that...

I'm lost... Been trying to get it right for 3 days straight, but...
Does anyone know a solution to this problem?!?!

Monday, March 26, 2012

Making managed code calls inside SQL Server in context of the client

Dear all,

I am very new to the subject of writing CLR code inside SQL Server, so I apologise if my questions seem naive.

I have a requirement to populate an asp.net 2.0 GridView control with data columns, some of which are directly from a SQL Server 2005 database, but some of which are calculated by calling CLR methods passing the values from the database columns to those methods.

However, the methods I need to call only make sense in the process context of the client web site which is calling the stored procedure which I want to write to return the data columns.

In effect, I want to be able to make a remote procedure call from within the SQL Server CLR code to the methods available in the client process.

Is this possible? If so, could someone please refer me to an example of how to do it.

If it can be done, it opens up lots of very cool possibilities!

Thanks.

It's a much cleaner design if you can explicitly pass the client context information to the server-side CLR code rather than RPC back to the client. While you can do anything you want if you register the assembly as unsafe, I don't recommend that approach. It's better for both security and performance reasons to keep server-side processing on the server itself as much as possible.

|||

Dear BonnieFe,

Thanks for your suggestion. It would be a much cleaner design, if it was possible. Unfortunately, the data I need back changes for every row in the returned data, since it is obtained by passing a value from a returned data column to a method which has to be called in the context of the calling process.

I have now solved the problem by calling a web service in the calling web site from the CLR code inside SQL Server 2005. This seems to work fine, although it is bound to be slower than it would be if it used RPC back through the SQL connection.