fbpx
Welcome, Guest
Username: Password: Remember me
Hier wird Deutsch gesprochen
  • Page:
  • 1

TOPIC: Rp2 mit Unicode

Rp2 mit Unicode 3 months 3 weeks ago #8775

  MSZoll's Avatar Topic Author MSZoll Offline Posts: 8
Hallo,
Ich habe meine Vo in XSharp übernommen und muß jetzt Unicode nutzen,
hat wer einen Plan, wie ich einfach in RP2 Unicode nutzen kann?
Oder gibt es eine genauso einfachen Report-Generator mit DBF der Unicode kann?
LG Michael

Please Log in or Create an account to join the conversation.

Rp2 mit Unicode 3 months 3 weeks ago #8792

  wriedmann's Avatar wriedmann Offline Posts: 1683
Hallo Michael,

mit RP2 dürfte das nicht so einfach funktionieren, da intern ANSI-basierte Windows-API-Aufrufe genutzt werden.

Leider kann ich Dir auch keinen Report-Generator nennen, der DBF und Unicode unterstützt, und ich habe meine Zweifel, ob es sowas überhaupt gibt.
Aber an und für sich ist das DBF-Format doch auch nicht Unicode-fähig.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Rp2 mit Unicode 3 months 3 weeks ago #8793

  MSZoll's Avatar Topic Author MSZoll Offline Posts: 8
Hallo Wolfgang,
Ich habe unicode mit dbf mit code64 umgesetzt,
Das funktioniert wunderbar.
Wie könnt ich am einfachsten einen normalen
Druck programmieren?
Gruss Michael

Please Log in or Create an account to join the conversation.

Rp2 mit Unicode 3 months 3 weeks ago #8794

  wriedmann's Avatar wriedmann Offline Posts: 1683
Hallo Michael,

da hast Du einen Sonderweg gefunden, den vermutllich kein Tool so von Haus aus unterstützen dürfte.
Phil Hepburn hat Artikel drüber geschrieben, wie man mit .NET Bordmitteln das Drucken angehen kann: enotes.xsharp.it/enotes/ReportsNPrinting_81b.chm

Ansonsten fällt mir nur ein Drucktool ein, das die Datenbeschaffung komplett dem Programmierer überlässt: List&Label. Ist nicht ganz billig, aber doch leistungsfähig.

Ich habe meinen eigenen Reportwriter geschrieben, der aber VPE von Ideal Software nutzt. Daher bin ich, was Drucken betrifft, vielleicht nicht ganz die richtige Person.

Ich würde mal warten, ob sich vielleicht Robert dazuzmeldet und eine Lösung für ReportPro hat.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Rp2 mit Unicode 3 months 3 weeks ago #8801

  robert's Avatar robert Offline Posts: 1085
Wolfgang, Michael,

When the fields are specially encoded in the DBF with Base64 encoding you need at least to manually decode that.
W.r.t. ReportPro and Unicode:
- RP2 and RP3 are programmed against ANSI API Calls. They both use an ANSI UI Layer (VO GUI for RP2 and Classmate GUI for RP3).
Once we have a new VO compatible UI based on winforms I will have a look at how much work it is to migrate the RP2 reporting code (which uses DrawText, DrawLine and similar API calls) to Windows Forms.

Robert
XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

Rp2 mit Unicode 3 months 3 weeks ago #8802

  MSZoll's Avatar Topic Author MSZoll Offline Posts: 8
Hello Robert,
Could you tell me the way to Decode manualy within rp2?

Please Log in or Create an account to join the conversation.

Rp2 mit Unicode 3 months 3 weeks ago #8812

  robert's Avatar robert Offline Posts: 1085
Michael,
How are you encoding ?
I would replace the access to the field (Alias.FieldName) with an expression MyDecode(Alias.FieldName).
To allow that in the designer you need to create a UDF library.

Robert
XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

Last edit: by robert.

Rp2 mit Unicode 3 months 3 weeks ago #8815

  MSZoll's Avatar Topic Author MSZoll Offline Posts: 8
Hello Robert,
I use for Encode / Decode the following:
PUBLIC PARTIAL CLASS WindlgEingabe ;
INHERIT System.Windows.Forms.Form

PRIVATE editText := "" AS STRING
public property Editedtext as string
get
var bytes := Encoding.Unicode:GetBytes(editText)
var base64 := Convert.ToBase64String(bytes)
return base64
end get
set
try
var bytes := System.Convert.FromBase64String(value)
editText := Encoding.Unicode:GetString(bytes)
editor:Text := editText
catch
editor:Text := value
end try
end set
end property

Please Log in or Create an account to join the conversation.

Rp2 mit Unicode 3 months 3 weeks ago #8816

  robert's Avatar robert Offline Posts: 1085
Michael,
So you need to create a function that does the same. Something like
FUNCTION MyBase64Decode(cSource AS STRING) AS STRING
VAR bytes := System.Convert.FromBase64String(cSource )
RETURN Encoding.Unicode:GetString(bytes)

Create a RP UDF DLL and include this function in this DLL and in your report use something like this as expression for a field:
MyBase64Decode(Client.LastName)

The only problem that I see is that when the decoded field contains a character that is not in your current codepage. This character will be displayed as a question mark (?) in the ansi output of ReportPro.

Robert
XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

Last edit: by robert.

Rp2 mit Unicode 3 months 3 weeks ago #8817

  MSZoll's Avatar Topic Author MSZoll Offline Posts: 8
Hallo Robert,
I have now build a new class to do This:
and use it in my program with:

var winBase64 := UMS_Base64{}
winBase64:Editedtext := RTrim (self:owner:server:FIELDGET (#REF_NR))
oDCsleREF_NR:value := winBase64:Editedtext


USING System
USING System.Collections.Generic
USING System.Text

CLASS UMS_Base64

PRIVATE editText := "" AS STRING
public property Editedtext as string
get
var bytes := Encoding.Unicode:GetBytes(editText)
var base64 := Convert.ToBase64String(bytes)
return base64
end get
set
try
var bytes := System.Convert.FromBase64String(value)
editText := Encoding.Unicode:GetString(bytes)
catch
editText := value
end try
end set
end property

CONSTRUCTOR()
RETURN

END CLASS

Please Log in or Create an account to join the conversation.

Rp2 mit Unicode 3 months 3 weeks ago #8818

  MSZoll's Avatar Topic Author MSZoll Offline Posts: 8
Then it does not work for me,
because I have to Print a line like this:
3_1_1_scprl1_89_xml ß?+ä'㐿㪳çËöŠïÔчШ

without questionmarks
Thanks

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: wriedmann