Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reports on memo fields with Rich text ?
Message
From
12/05/1997 15:43:40
 
 
To
12/05/1997 05:22:52
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00031589
Message ID:
00031845
Views:
45
>>>>Sorry if it's been asked befored and I missed it, but can somebody tell me if it's possible to let users format their text using the Rich Text Control, save to a memo field and ther REPORT on it so that the users see it as if on-screen?
>>>
>>>
>>>Yes...it is possible.
>>
>>
>>Sorry...just had to do it.....here's one way of doing it....hehehe
>>
>>The Rich Text Control should store the value into a file. From there you can append it into a memo...APPEND MEMO (memofieldname) FROM (filename). To printer it use the SelPrint method on the Rich Text Control to print the file.
>>
>>In order to use the SelPrint you have to have a printer device context. This is the code I use to print the Rich Text Control information from the SelPrint method....
>>
>>-------------------------------
>>
>>DECLARE Long CreateDC IN GDI32 ;
>> String, String, String, String
>>
>>DECLARE Long DeleteDC IN GDI32 ;
>> Long
>>
>>lnhDC = CreateDC("", SET("PRINTER",2), 0, 0)
>>Thisform.RichTextBox1.SelPrint(lnHdc)
>>=DeleteDC(lnHdc)
>>
>>----------------------------------
>>
>>
>>Hope this helps (at least it's better than my last answer) :-)
>
>I am also having a problem printing RichText and I have tried the above:
>
>The CreateDC returns a handle (8386) and the SelPrint either sends the prinout into the ether (it is not sent to the Windows print spooler or anywhere where I can find it), or I get an error :
>
> OLE error code 0x80020005: Type mismatch
>
>Notes: I use Getprinter() before the CreateDC so that I can select the printer. I have also tried
> SET PRINTER ON.
> SET PRINTER TO NAME
> CreateDC...
> ...SelPrint...
> SET PRINTER OFF
> SET PRINTER TO
>
> All this does is to throw a blank page.
>
>Any assistance would be very very welcome


That is strange...I do not have a problem with this. I did not use the GetPrinter in front of mine but I do not see why that would cause a problem. What happens if you do not select the GetPrinter first? What line gives you the Type Mismatch error? The Type mismatch error is a very vague error message. I know...I have spent hours and hours trying to figure out what it meant, then spend hours more trying to find why it is occurring. What I have found is that usually it means the parameter you are passing the SelPrint is invalid.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform