1. Dale
  2. Report Editor
  3. 火, 11月 05 2019, 03:29 AM
  4.  メールで購読
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