1. Dale
  2. Report Editor
  3. Dienstag, November 05 2019, 03:29 AM
  4.  Abonnieren via E-Mail
Valentina Studio Pro 8.3.3 report keeps on crashing.

Here's the story:
1. In the query I called a stored procedure and tested it (pic 1).
2. Designed a report and preview it (pic 2). So far so good.
3. Now, I disable any calls from the query (pic 3) and
4. Simulate the calls in the pre-build script as I plan to call this from my Xojo app.
When I preview the report, Valentina crashes.
Anhänge
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hello Dale,

I can't reproduce such issue in my Xojo test app.
Maybe try to simplify call in the pre_build script, run without getting parameters? Just to know if it is executed and the table is created.

Also, you can try to use parameters in the report query:
CALL getstockcard( $P('vDateFrom'), ...

$P adds quotes to values of string parameters. $!P was added in 9.0.7 and it never quotes the parameter value.

But we can't define sorting or grouping if there are multiple statements in the report query.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Yes, they are all defined with report.SetParameterValue( “paramName”, “v1” ) method
Kommentar
There are no comments made yet.
Dale Akzeptierte Antwort
Can Xojo set the values of the parameters defined in the report query?
Anhänge
Kommentar
There are no comments made yet.
Dale Akzeptierte Antwort
Thank you, Sergey.
Anhänge
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Thank you, I’ll try to reproduce it in Xojo. Could you please attach a report file (exported)?
Kommentar
There are no comments made yet.
Dale Akzeptierte Antwort
More info...

If I add a prior call to the stored proc in the query (see add call in query.png) and run it from Xojo, it is working. But of course, it losses the purpose of the parameters since the call becomes static.
Anhänge
Kommentar
There are no comments made yet.
Dale Akzeptierte Antwort
Sergey, I did what you tell me to do. Thank you, but it is the same. I have no problem running the report from Valentina Studio but from Xojo as it generates the error as I posted before.
Anhänge
Kommentar
There are no comments made yet.
Dale Akzeptierte Antwort
Do I need to save the project in v8.0.2?
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
And 8.0.2 is the latest version available for your serial, right?
Then the fastest way to check is to install 8.0.2 Valentina Studio (maybe to another folder):
http://valentina-db.com/download/prev_releases/8.0.2/win_64/vstudio_x64_8_win.exe

Copy the project and try to open it in the Valentina Studio 8.0.2 - what will be the result?
Kommentar
There are no comments made yet.
Dale Akzeptierte Antwort
It's 8.0.2, Sergey.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
No, there is really no difference. What about the version of V4RB plugin? Is it close to the version Valentina Studio?
Can be checked in the properties of the vcomponents libraries
Anhänge
Kommentar
There are no comments made yet.
Dale Akzeptierte Antwort
So with only SELECT statement now it works fine, right?

SELECT * FROM stockcardDetails


You are correct, Sergey. I made some progress. Here's what I did:
1. Removed the stored procedure call from the query and left alone the command Select * From stockcardDetails;
2. Add some report parameters
3. Modified the pre-build script to accommodate said parameters so that I can use them from Xojo.

report.datasource.sqlSelect("Call genstockcard('" + report.parameterValue( "vDateFrom" ) + "','" + report.parameterValue( "vDateTo" ) + "'," +
report.parameterValue( "vItemID" ) + "," + report.parameterValue( "vStockID" ) + "," + report.parameterValue( "vCustomCond" ) + ",Null,Null," +
report.parameterValue( "vOrderBy" ) + ",Null,'" + report.parameterValue( "vLogo" ) + "');");

4. Preview the report from Valentina IDE. The report is working (please see picture).
5. But when I call the report from Xojo, an exception error was triggered (see error picture).

Does it mean that if the report is called from Xojo, the query takes the precedence?

The error occurs from this code, during the rendering.

Dim pdfData As String = mReport.PrintToBuffer( EVReportPrintType.kToPDF, 1 )
Anhänge
Kommentar
There are no comments made yet.
Dale Akzeptierte Antwort

What is an exact crash message - something about NULL pointer?


It just closes itself.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
So with only SELECT statement now it works fine, right?

SELECT * FROM stockcardDetails
Kommentar
There are no comments made yet.
Dale Akzeptierte Antwort
I rebuild my report from scratch and now the pre-build script runs fine. But if I comment all commands in the query and run the report, it still crashes.
Anhänge
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
They are both executed, pre_build and then query.
So in a query, you usually have an only SELECT statement, without comments, because it may be nested as a subquery if it is necessary to sort or execute SQL expression in the report.

Still can't reproduce anything like that.
What is an exact crash message - something about NULL pointer?
Does any other SQL crash in the pre_build script?
If you type JavaScript which doesn't use the datasource - will it crash, too? Something like "var i = parseInt( '5' ); ++i;" should give a result.
Kommentar
There are no comments made yet.
Dale Akzeptierte Antwort
Just a quick question while I am here:

Do I need to delete my report's query if I have a script in the pre build? If I have both, what takes precedence if I preview the report from Valentina Studio IDE, the query or the script?
Kommentar
There are no comments made yet.
Dale Akzeptierte Antwort
It also crashes.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
What if you run pre_build script with Execute button? Does it work?
Kommentar
There are no comments made yet.
Dale Akzeptierte Antwort
Thanks for the response, Sergey.

It is still crashing, though, even if I changed the script to:

report.datasource.sqlSelect("Call genstockcard('2019-06-01','2019-10-31',5130,7608,Null,Null,Null,Null,Null,'C:\\ProgramData\\Clients\\00001\\Images\\baccrea.png');");


Replacing the parameter in question to Null.
Kommentar
There are no comments made yet.
  • Seite :
  • 1
  • 2


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories