RP2SQL32Lib

Deutschsprachiges X#-Forum – German language forum

Moderator: wriedmann

lagraf
Posts: 417
Joined: Thu Jan 18, 2018 9:03 am

RP2SQL32Lib

Post by lagraf »

Wenn ich meine erste App nach X# portiere und dann in die XIDE importiere, erhalte ich die Meldung dass die RP2SQL32Lib fehlt. RP2 2.35 habe ich heruntergeladen, aber da gibt es keine AEFs, aus denen ich eine Lib erstellen kann. Wie binde ich RP2 2.35 in X# ein?

Franz
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

RP2SQL32Lib

Post by wriedmann »

Hallo Franz,
unter X# läuft das komplett anders - da kannst Du das komplette ReportPro einbinden.
Allerdings ist das nicht wirklich sehr glücklich gelöst - das ist das Entwicklungsteam draufgekommen, und sie arbeiten dran, die Kompatibilität zu verbessern.
ReportPro für X# ist nämlich eine Weiterentwicklung von ReportPro für Vulcan, und da wurden bei der Portierung ein paar nicht ganz glückliche Entscheidungen getroffen.
Ich habe das bei einem Freund in Verona aber definitiv zum Laufen gebracht.
Du kannst mal hier schauen:
https://www.xsharp.eu/forum/public-vo-v ... reportpro2
Vielleicht hilft das weiter.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
lagraf
Posts: 417
Joined: Thu Jan 18, 2018 9:03 am

RP2SQL32Lib

Post by lagraf »

Hallo Wolfgang,
ich habe jetzt vom RP 2.35 ins Programm eingebunden:
- ReportPro2.Base.dll
- ReportPro2.English.dll
- ReportPro2.Export.dll
- ReportPro2.Runtime.dll
- ReportPro2.UDF.dll

Dann habe ich die Aufrufe geändert:
von VO: oRpReport := RpReport{oWindow, GetDefault()+"REPORTS"+cReport+".RPT"}
nach X#: oRpReport := RpReportSQL{oWindow, cReport+".RPT", GetDefault()+"REPORTS"}

Damit bringt der Compiler beim Aufruf den Fehler

Code: Select all

error XS7036: There is no argument given that corresponds to the required formal parameter 'aDbfSwap' of 'ReportPro2.RpReportSql.RpReportSql(object, string, string, XSharp.__Array, XSharp.__Usual, XSharp.__Usual)
Die restlichen Parameter brauche ich nicht. Gebe ich den aDbfSwap Parameter als Leerarray dazu, dann will er den nächsten Parameter cUserID, usw. Sollten dafür nicht Default Values eingebaut werden vor 3 Monaten?

Ausserdem kommen massig Fehler, dass RP2 Variablen und Methoden nicht beinhaltet, die ich mit ILSpy aber sehe

Code: Select all

error XS1061: 'ReportPro2.RpReport' does not contain a definition for 'SetVariableValue' and no accessible extension method 'SetVariableValue' accepting a first argument of type 'ReportPro2.RpReport' could be found (are you missing a using directive or an assembly reference?)
Wieso findet der Compiler die nicht?
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

RP2SQL32Lib

Post by wriedmann »

Hallo Franz,
Du kannst keine Parameter auslassen.
Ich weiß jetzt nicht, was seit meinen Versuchen geändert worden ist - ich denke aber nicht viel.
Daher würde ich versuchen, das so zum Laufen zu bekommen, und dann, sobald die neue Version verfügbar ist, darauf umstellen.
Dass Methoden als fehlend angemeckert werden, hat IMHO auch nur mit ungültigen Parameter-Listen zu tun.
Aber nachdem das Team jetzt eine VO-App von Chris umgestellt hat, sind sie selber draugekommen, dass sie da was anpassen müssen, und das ist jetzt laut Roadmap für das erste Quartal auf dem Plan.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

RP2SQL32Lib

Post by Chris »

Hi Franz,

As Wolfgang said, the person who did the migration for the VO version of Report Pro to .Net (vulcan back then) did a great job, but unfortunately also made some design decisions which broke code compatibility with VO, causing troubles like the ones you are facing. In the last weeks I have changed the code interface of RP2 to be more like Vo and that helps a lot, need to do it also for the sql interface as well.

Unfortunately I do not have experience myself with the SQL interface to make sure I make the correct changes, so could you please send me a small sample VO aef that uses RP2 with sql, calling all the RP2 functions/methods that you do in your real app? Will then make sure that your code will work in X# with no code changes at all regarding RP2.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
lagraf
Posts: 417
Joined: Thu Jan 18, 2018 9:03 am

RP2SQL32Lib

Post by lagraf »

Hi Chris,
do you want this AEF for a special SQL database (MySQL, SQLite, ...)
Franz
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

RP2SQL32Lib

Post by Chris »

Hi Franz,

MySQL would be best, but anything would be ok, I just need something that compiles without errors in VO so I will make sure it compiles without errors in X#, too.

Thanks!
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
lagraf
Posts: 417
Joined: Thu Jan 18, 2018 9:03 am

RP2SQL32Lib

Post by lagraf »

Hi Chris,
attached you will find VO AEF and one ReportPro 2.17 SQL report.
First you have to create a mysql odbc driver called "TEST" manually!
Then you can start app, create table with data and do the SQL report within the app.
Franz

PS I forgot: If you find a SQLTable definition named SQLChris you can delete it. I do not use it and it conflicts with assemly name! I attach a corrected AEF.
Attachments
SQLChris.zip
(108.31 KiB) Downloaded 20 times
SQLChris.zip
(108.56 KiB) Downloaded 22 times
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

RP2SQL32Lib

Post by Chris »

Thanks Franz! From what I see, the SQL layer of RP2 does not need many changes, it's only the constructor than needs as you said to support default parameters. The rest of the methods like SetVariable() name have already been adjusted, being part of the RDD layer.

Regarding the error you mentioned above about not finding some methods, that's because (as it is today), you do not need to only change the class name you use when instantiating the class, but you need to also declare your oRpReport variable AS RpReportSql. We plan to adjust the code so this (or other changes) will not be required anymore, will try to have a new version ready in the next days.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
lagraf
Posts: 417
Joined: Thu Jan 18, 2018 9:03 am

RP2SQL32Lib

Post by lagraf »

Hi Chris,
now I transported my first app using ReportPro from VO to X#. When I preview a report the window pops up and closes immediately!
-> I start the Report like I do in SQLChris, ReportPro2 References are identical
-> When I copy statements from SQLChris it does the same, window pops up and closes

Code: Select all

LOCAL oRpReport AS RpReportSQL
oRpReport := RpReportSQL{SELF, GetDefault()+"Report Name.RPT", GetDefault(), {}, "root", ""}
IF oRpReport:IsValid
	oRpReport:PrintPreview("Job","File.PRN","Caption","Message")
ENDIF
What could be missed in my app, so ReportPro pops up and closes while SQLChris app does well?
Post Reply