Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Graphs 1

Status
Not open for further replies.

gromm

Programmer
Feb 21, 2003
12
PH
Hi! I hope someone could help about printing my forms with bar graphs in it. I'm making this program that would require me to print several forms with graphs (horizontal colored bars)but the method I have is printline which does not work well.

Pls. help me. THanks so much! [2thumbsup]
 
what control r u using to draw the graph (or is it line command)? i asked this question because i need to know what determines the graph dimensions.
 
there is a workaround, i dont know wether it will be viable

1. Create a gif (the size of a bar)
2. Add the Internet control to ur page.
3. Using file system object create a html page. in that page give <img src=&quot;gif file path&quot; width=&quot;calculated amt&quot;>

load the file in the internet control.

the advantage is u get a print like IE

hopes this helps
 
Thanks, I'm sure this is going to help. However, since I already have an existing form with computations in it for the bar, how can I transfer those to the object that you suggested. How can this be viewed in print preview?

Thanks again.
 
u dont have to change the computation, only display part will change, when u create a line bar u need the positions, with that calculate the width of the bar.

i assume that u know something bout HTML

do u know how to create a gif (any internet picture file will do)

if u know then it will reduce the code.

the internet control has all the features of IE print preview will also be available.
 
Sorry to bug you but could you send me a sample?

Thanks.
 
in form_load
FileNumber = FreeFile()
Open RMPath + &quot;\print.html&quot; For Output As #FileNumber
rt1=&quot;<html><body>This is my first html page.</body&quot;</html>&quot;
Print #FileNumber, rt1
Close #FileNumber

using components load the microsoft internet control.
u will be able to create web browser in the form rename it to 'wb'

in the form_activate
wb.Navigate pth + &quot;\print.html&quot;

this will create a simple html file and allow the user to view it,
like normal IE the menu that is displayed using right click will also be displayed allowing the user to print the form.


if this works i will give u a detailed way of using images.
 
Thanks so much. I will do this on my program.

Have a nice day! [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top