1. Dale
  2. Report Editor
  3. Tuesday, November 05 2019, 03:29 AM
  4.  Subscribe via email
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.
Attachments (4)
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Hi Dale,

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

The problem must be in the double quotes:
"%ware%"

The string is already in the double quotes, so to use double quotes you must escape them with a slash.
Comment
There are no comments made yet.
  1. one week ago
  2. Report Editor
  3. # 1
Dale Accepted Answer
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.
Comment
There are no comments made yet.
  1. one week ago
  2. Report Editor
  3. # 2
Sergey Pashkov Accepted Answer
What if you run pre_build script with Execute button? Does it work?
Comment
There are no comments made yet.
  1. one week ago
  2. Report Editor
  3. # 3
Dale Accepted Answer
It also crashes.
Comment
There are no comments made yet.
  1. one week ago
  2. Report Editor
  3. # 4
Dale Accepted Answer
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?
Comment
There are no comments made yet.
  1. 6 days ago
  2. Report Editor
  3. # 5
Sergey Pashkov Accepted Answer
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.
Comment
There are no comments made yet.
  1. 6 days ago
  2. Report Editor
  3. # 6
Dale Accepted Answer
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.
Attachments (1)
Comment
There are no comments made yet.
  1. 6 days ago
  2. Report Editor
  3. # 7
Sergey Pashkov Accepted Answer
So with only SELECT statement now it works fine, right?

SELECT * FROM stockcardDetails
Comment
There are no comments made yet.
  1. 6 days ago
  2. Report Editor
  3. # 8
Dale Accepted Answer

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


It just closes itself.
Comment
There are no comments made yet.
  1. 6 days ago
  2. Report Editor
  3. # 9
Dale Accepted Answer
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 )
Attachments (2)
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
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
Attachments (1)
Comment
There are no comments made yet.
Dale Accepted Answer
It's 8.0.2, Sergey.
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
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?
Comment
There are no comments made yet.
Dale Accepted Answer
Do I need to save the project in v8.0.2?
Comment
There are no comments made yet.
Dale Accepted Answer
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.
Attachments (1)
Comment
There are no comments made yet.
Dale Accepted Answer
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.
Attachments (2)
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Thank you, I’ll try to reproduce it in Xojo. Could you please attach a report file (exported)?
Comment
There are no comments made yet.
Dale Accepted Answer
Thank you, Sergey.
Attachments (1)
Comment
There are no comments made yet.
Dale Accepted Answer
Can Xojo set the values of the parameters defined in the report query?
Attachments (1)
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Yes, they are all defined with report.SetParameterValue( “paramName”, “v1” ) method
Comment
There are no comments made yet.
  • Page :
  • 1


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. 0 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories
Omegabundle
  1. 0 subcategories