|
-
Nov 4th, 2000, 11:40 AM
#1
Thread Starter
Lively Member
Data report object in Visual Basic 6:
How could I load a picture from a file to image control in the report at Run Time?
Is it impossible or there is a way to do that?
NOTE: my report will show some information about one employee including his picture.
I made a form instead of th report (i'll show only one employee) but I had other problems:
-1- The maximum height for the form is 9000 and the A4 paper height is about 16000 !!
-2- When attend to print the form - Me.PrintForm - I got an error '486' says: "Can't print form image to this type of printer".
ANY HELP PLEASE !_!
Yesterday is history ... Tomorrow is mistry .. Today is a gift.
VB6 , intermidiat
-
Nov 4th, 2000, 02:16 PM
#2
Member
im not sure if its possible but if it is, but allow me to suggest a 'neater' (in both meanings of the word) way to do this (which is how i do all my reporting thru VB):
create a form and put a WebBrowser control on it and dynamically create html files for your reports and display them in the control, you can make it look anyway you want and is much cleaner and easier to debug.
<RANT>
This may not be what you want to do but in my experience the dataenv and data reports in VB are buggy and always end up being trouble.
</RANT>
if you want, you can drop me your email you a tiny example project ive created using this method.
-
Nov 4th, 2000, 06:03 PM
#3
Thread Starter
Lively Member
thank you
Originally posted by glitch13
if you want, you can drop me your email you a tiny example project ive created using this method.
It's very nice to offer that.
I will be very appreciate to recieve that from you.
my email is : [email protected]
thanks again.
Yesterday is history ... Tomorrow is mistry .. Today is a gift.
VB6 , intermidiat
-
Nov 4th, 2000, 11:00 PM
#4
New Member
You can do it as follows:
DataRpt1.Sections("Section2").Controls("Image").Picture
= LoadPicture("C:\Windows\MyPicture.bmp")
A similar question has bothered me for a long time:
I have put a picture in my Database, now I want to take it out and set to an image in DataReport, how can I do it by code:
dim cnn as ADODB.connection
dim rst as ADODB.recordset
dim rst= NEW ADODB.Recordset
rst.open "select * from Mytable",cnnParameter, adOpenStatic, adLockOptimistic
Then how can i take the picture out for an image?
rst.fields("MyPicture")
-
Nov 5th, 2000, 11:45 AM
#5
Thread Starter
Lively Member
Originally posted by tulip
You can do it as follows:
DataRpt1.Sections("Section2").Controls("Image").Picture
= LoadPicture("C:\Windows\MyPicture.bmp")
But this will cause the Run_Time Error '438': "Object doesn't support this property or method".
Yesterday is history ... Tomorrow is mistry .. Today is a gift.
VB6 , intermidiat
-
Nov 7th, 2000, 04:53 PM
#6
Thread Starter
Lively Member
Thanks
Thanks Brent Kelly, it was more than a great sample.
It was very helpfull to me, but I had a new little problem when print the report it prints undesirable additional line for the file location (URL) "file://C:\....". How can I get rid of it?
It could be a silly question but it's my first time using this control.
Thanks for help, and special thanks for Brent Kelly.
Yesterday is history ... Tomorrow is mistry .. Today is a gift.
VB6 , intermidiat
-
Nov 9th, 2000, 04:06 PM
#7
Member
Sorry i forgot to check back to see how it went!
I emailed you a module and code snippet that would fix the problem with the Header and Footer showing up on the printout. I would have posted it here but it needs a module that can edit the registry because thats where the header and footer info is stored.
good luck!
-
Dec 2nd, 2001, 05:38 PM
#8
Hyperactive Member
Hey Feras,
Did you ever figure out how to correct the error while displaying a picture to the data report?
Does anyone know how I can add a picture at run time to my report? I need a photo to e displayed with the employee information that is generated.
Thanks
-
Jun 12th, 2002, 12:58 PM
#9
Frenzied Member
If this can't be done then every last microsoft employee should be shot!
I mean come on isnt this a basic feature that many people would need?
There has to be a way!!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|