Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing a chart that is in the clipboard
Message
 
To
24/06/2003 13:31:20
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00799638
Message ID:
00803416
Views:
27
What is the OLeClass for olecontrol1?

>The chart is generated. It is, because I execute my app that generates the chart and after that outside that app I get back to VFP to run the code that you gave me to see what goes on under the hood.
>
>Here's the code that generate the chart
>
>
>with thisform.olecontrol1
>	*!* Display a 3d chart with 8 columns and 8 rows of data.
>	.ChartType = what_type(ThisForm.cmb_type.listIndex,2)
>	*!* Set the number of columns to 8
>	.COLUMNCOUNT = 1
>	*!* Set the number of rows to 8
>	.RowCount = my_number
>     FOR lnRow = 1 TO 20
>         .COLUMN = 1
>         .ROW = lnRow
>         .DATA = my_graph.&my_second_field
>     NEXT ROW
>	*!* Use the chart as the backdrop of the legend.
>	.ShowLegend = .T.
>	*!* Select Chart Part 1
>	.SelectPart(1,1,1,1,1) && VtChPartTypePlot, index1, index2, index3, index4)
>	*!*	Copy the chart to the clipboard in Windows Metafile format.
>	.EditCopy
>	*!* Select Chart Part 1
>	.SelectPart(1,1,1,1,1) && VtChPartTypeLegend, index1, index2, index3, index4)
>	*!*  Paste the Windows Metafile graphic from the clipboard into the chart
>	.EditPaste
>	*!* Set the chart object visible
>	.VISIBLE=.T.
>	*!* Refresh the chart object
>	.REFRESH	
>endwith
>
>
>
>>Perhaps you need to wait until Chart is generated and process of coping to clipboard is completed.
>>*---------
>>wait window "Preparing Copy-Paste" timeout 5
>>create curs tempgen(storegraph G)
>>.....
>>*----------
>>
>>Hard to tell without details of your code.
>>
>>
>>>This seems to be simple enough but it does'nt work.
>>>
>>>After doing some tests here's what I found:
>>>
>>>I executed my app so that I generated a Bar Chart. By executing that app. the bar chart is copied to the clipboard.
>>>
>>>After that I executed the code you gave me as a prg
>>>
>>>
>>>create curs tempgen(storegraph G)
>>>append blank
>>>keyboard '{Ctrl+V}{Ctrl+W}' plain clear  &&paste from clipboard
>>>modi general storegraph
>>>
>>>That did'nt work. It resulted in an empty record.
>>>
>>>After that I opened MS Paint and made a paste. That gave me my bar chart.
>>>
>>>But VFP could'nt get it at that point.
>>>
>>>So from MS paint I did a copy (to copy to clipboard)
>>>
>>>After that I reexecuted the code and this time it worked.
>>>
>>>Anyone knows why the clipboard can't be read by VFP the first time but can after the bar chart is copied to it by MS paint?
>>>
>>>Could this be a problem caused by EditCopy method for msChart activex?
>>>
>>>How do I fix this?
>>>
>>>
>>>>Try to add this:
>>>>
>>>>create curs tempgen(storegraph G)
>>>>append blank
>>>>keyboard '{Ctrl+V}{Ctrl+W}' plain clear &&paste from clipboard
>>>>modi general storegraph
>>>>
>>>>Then you will be able to combine this field with another information in the report.
>>>>
>>>>>VFP6
>>>>>
>>>>>1. There is a chart in the clipboard
>>>>>2. I want to print that chart
>>>>>3. Is there a way to get that chart in a report and print it?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform