1. Dale
  2. Report Editor
  3. Вторник, Ноябрь 05 2019, 03:29 AM
  4.  Подписаться через 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.
Вложения
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
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.
Комментарий
There are no comments made yet.
Dale Ответ принят
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.
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
What if you run pre_build script with Execute button? Does it work?
Комментарий
There are no comments made yet.
Dale Ответ принят
It also crashes.
Комментарий
There are no comments made yet.
Dale Ответ принят
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?
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
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.
Комментарий
There are no comments made yet.
Dale Ответ принят
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.
Вложения
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
So with only SELECT statement now it works fine, right?

SELECT * FROM stockcardDetails
Комментарий
There are no comments made yet.
Dale Ответ принят

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


It just closes itself.
Комментарий
There are no comments made yet.
Dale Ответ принят
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 )
Вложения
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
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
Вложения
Комментарий
There are no comments made yet.
Dale Ответ принят
It's 8.0.2, Sergey.
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
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?
Комментарий
There are no comments made yet.
Dale Ответ принят
Do I need to save the project in v8.0.2?
Комментарий
There are no comments made yet.
Dale Ответ принят
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.
Вложения
Комментарий
There are no comments made yet.
Dale Ответ принят
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.
Вложения
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Thank you, I’ll try to reproduce it in Xojo. Could you please attach a report file (exported)?
Комментарий
There are no comments made yet.
Dale Ответ принят
Thank you, Sergey.
Вложения
Комментарий
There are no comments made yet.
Dale Ответ принят
Can Xojo set the values of the parameters defined in the report query?
Вложения
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Yes, they are all defined with report.SetParameterValue( “paramName”, “v1” ) method
Комментарий
There are no comments made yet.
  • Страница :
  • 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