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

TOPIC: RP2SQL32Lib

RP2SQL32Lib 2 months 4 days ago #12971

  lagraf's Avatar Topic Author lagraf Offline Posts: 121
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

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

RP2SQL32Lib 2 months 4 days ago #12972

  wriedmann's Avatar wriedmann Away Posts: 2198
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:
www.xsharp.info/forum/public-vo-vn/1529-using-reportpro2
Vielleicht hilft das weiter.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy

www.riedmann.it - docs.xsharp.it

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

RP2SQL32Lib 2 months 3 days ago #12973

  lagraf's Avatar Topic Author lagraf Offline Posts: 121
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
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
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?

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

Last edit: by lagraf.

RP2SQL32Lib 2 months 3 days ago #12977

  wriedmann's Avatar wriedmann Away Posts: 2198
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

www.riedmann.it - docs.xsharp.it

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

RP2SQL32Lib 2 months 3 days ago #12981

  Chris's Avatar Chris Offline Posts: 1753
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.
XSharp Development Team
chris(at)xsharp.eu

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

RP2SQL32Lib 2 months 3 days ago #12993

  lagraf's Avatar Topic Author lagraf Offline Posts: 121
Hi Chris,
do you want this AEF for a special SQL database (MySQL, SQLite, ...)
Franz

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

RP2SQL32Lib 2 months 3 days ago #12994

  Chris's Avatar Chris Offline Posts: 1753
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!
XSharp Development Team
chris(at)xsharp.eu

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

RP2SQL32Lib 2 months 2 days ago #12997

  lagraf's Avatar Topic Author lagraf Offline Posts: 121
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:

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

Last edit: by lagraf.

RP2SQL32Lib 2 months 2 days ago #13001

  Chris's Avatar Chris Offline Posts: 1753
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.
XSharp Development Team
chris(at)xsharp.eu

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

RP2SQL32Lib 1 month 4 weeks ago #13064

  lagraf's Avatar Topic Author lagraf Offline Posts: 121
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
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?

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

RP2SQL32Lib 1 month 4 weeks ago #13069

  Chris's Avatar Chris Offline Posts: 1753
When this happened in my own app, it was because I was using a report:Close() after the Preview. This worked in VO because apparently the preview window was being shown modally, but in the .Net version this is not modal anymore, so the report closes directly. Could it be you are doing something similar?
XSharp Development Team
chris(at)xsharp.eu

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

RP2SQL32Lib 1 month 4 weeks ago #13073

  lagraf's Avatar Topic Author lagraf Offline Posts: 121
Hi Chris,
as the app was transported from VO the (modified) code is
CLASS dlgReports INHERIT ...
METHOD pshOk()
...
oRpReport := RpReportSQL{SELF, GetDefault()+cReport+".RPT", GetDefault(), {}, "user", "pass"}
IF oRpReport:IsValid
	oRpReport:PrintPreview(cReport,cReport+".PRN",cCaption,"Bericht in Bearbeitung...")
ENDIF
oRpReport:Close()
SELF:EndDialog()
RETURN SELF
To comment the oRpReport:Close() is not enough, you also have to comment the SELF:EndDIalog(), but then the window dlgReports is not closed, so you have to start the oRpReport:PrintPreview with SELF:Owner instead of SELF and leave the SELF:EndDialog() uncommented!

Is this the right way or is there a better way to do this, e.g. start Preview modeless?

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

Last edit: by lagraf.

RP2SQL32Lib 1 month 4 weeks ago #13077

  leighproman's Avatar leighproman Offline Posts: 39
Are you using the RpReportEnded() callback method?
METHOD RpReportEnded( oReport ) 

oReport:Close()
	
RETURN TRUE

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

RP2SQL32Lib 1 month 4 weeks ago #13078

  Chris's Avatar Chris Offline Posts: 1753
Guys, I am looking into various RP2 problems right now, will also look into making the Preview Dialog modal (optionally?) as well, so it has the same behavior as in VO. We should have a new improved version soon.
XSharp Development Team
chris(at)xsharp.eu

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

RP2SQL32Lib 1 month 4 weeks ago #13081

  lagraf's Avatar Topic Author lagraf Offline Posts: 121
The RpReportEnded method is exactly what I wanted!
I never used this method cause in VO the reports were modal so it wasn't needed!
Thanks!

Chris: I'm waiting for your next version of ReportPro, take your time!
Meanwhile I'm testing one of my apps with X# and to do this I also have ReportPro calls (in Vulcan style) up and running.

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

Last edit: by lagraf.

RP2SQL32Lib 1 month 4 weeks ago #13085

  Chris's Avatar Chris Offline Posts: 1753
Franz,

While looking at some other issues, I realized that there's a parameter (the 5th one) in PrintPreview() named "lModal". So if you pass the method TRUE as a fifth argument, the preview window should be modal as in VO. This is now also TRUE by default in our internal build.
XSharp Development Team
chris(at)xsharp.eu

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

RP2SQL32Lib 1 month 4 weeks ago #13086

  lagraf's Avatar Topic Author lagraf Offline Posts: 121
Thank you Chris!

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

RP2SQL32Lib 1 month 3 weeks ago #13161

  lagraf's Avatar Topic Author lagraf Offline Posts: 121
I got another problem with Report Pro, when I do a manual report with RpPrinter
oPrinter := RpPrinter{oWindow, SELF}
oPrinter:PrintPreview("Job","File", "Caption", "Message", TRUE, FALSE, FALSE)
3 params are missing, so I changed it to
oPrinter:PrintPreview("Job", "File", "Caption", "Message", TRUE, FALSE, FALSE, SW_NORMAL,1,NULL_SYMBOL)
Which values can I use for nZoom?
What means param symPPWindow? If I give NULL_SYMBOL report crashes?

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

Last edit: by lagraf.

RP2SQL32Lib 1 month 3 weeks ago #13164

  leighproman's Avatar leighproman Offline Posts: 39
From the RP2 help file:

nZoomed
Optional parameter which specifies the initial zoom level of the Print Preview window. Valid options are:ZOOM_WHOLE_PAGE, ZOOM_PAGE_WIDTH and ZOOM_100

symPPWindow
Optional parameter to specify a symbol representing a class to instantiate for use as the Print Preview window. The class specified must provide certain callback methods for ReportPro. The code for ReportPro's PrintPreview windows is provided as an example of what methods the window needs to provide.

There are two Print Preview window types provided with ReportPro:

#rpPrintPreviewMDI: this symbol will produce a Print Preview window that is built on an MDI child window. The owner must be an MDI shell type window.

#rpPrintPreviewDLG: this symbol will produce a Print Preview window that is built on a modal or modeless dialog window.


For zoom:
DEFINE ZOOM_WHOLE_PAGE	:=0
DEFINE ZOOM_PAGE_WIDTH	:=1
DEFINE ZOOM_100			:=2

For the window symbol we use #PreviewDlg with the following class:
CLASS PreviewDlg INHERIT ReportPro2.rpPrintPreviewDlg
METHOD Init(oParent,oPrinter,cCaption,lModal,ptrPlacement,nShowState,lLandScape,nZoom)

SUPER:Init(oParent,oPrinter,cCaption,lModal,ptrPlacement,nShowState,lLandScape,nZoom)

 SELF:Caption := cCaption
// here you can delete the default buttons
// and add yours
RETURN SELF
END CLASS

Leigh

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

RP2SQL32Lib 1 month 3 weeks ago #13166

  Chris's Avatar Chris Offline Posts: 1753
Guys,

With our latest changes in RP2, all the parameters in PrintPreview() are now optional, so you will not have to bother about it anymore. Regarding the symPPWindow parameter, NULL_SYMBOL should be fine, when this is passed (and is the default now), RP2 uses its standard preview dialog.
XSharp Development Team
chris(at)xsharp.eu

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

  • Page:
  • 1
  • 2
Moderators: wriedmann