1. Dale
  2. Valentina Studio
  3. Friday, December 07 2018, 07:10 AM
  4.  Subscribe via email
Hi,

I created a label to print qr code from a receiving list. This receiving list has quantity of items received. From there, I need to print the number of qr codes per item. For example, I have the following;

Items Quantity
------- ------------
Item A 15
Item B 10
Item C 25

Although I only have 3 items, I need to print 50 qr codes total (15 for item a, 10 for item b and 25 for item c). How to do this on Valentina Studio Pro?
Comment
There are no comments made yet.
Dale Accepted Answer
It is working from Xojo if I revert to [SQL] in the report's pre-build with the statement "Call genqrlabels(1)". The thing is, I have to provide an explicit value as a parameter for the stored proc. If I switch to [Javascript] with this statement:

report.datasource.sqlSelect( "CALL genqrlabels(" + report.parameterValue( "pHeaderID" ) + ");" );


... this one works from Valentina Studio because I provide the value of pHeaderID at runtime. From xojo, it shows nothing. I suspect that the parameter passing from Xojo does not get into consideration during the initialization of the report in the statement:

mReport = mProject.MakeNewReport(strReportFile, vconnect, strSelect)


This is an excerpt from my xojo code:


mReport = mProject.MakeNewReport(strReportFile, vconnect, strSelect)

mReport.SetParameterValue("cCompany",ReportModule.CompanyName)
mReport.SetParameterValue("cAddress",ReportModule.CompanyAddress)
mReport.SetParameterValue("cEmail",ReportModule.CompanyEmail)
mReport.SetParameterValue("cWebsite",ReportModule.CompanyWebsite)
mReport.SetParameterValue("cLandLine",ReportModule.CompanyLandline)
mReport.SetParameterValue("cMobile",ReportModule.CompanyMobile)
mReport.SetParameterValue("cTIN",ReportModule.CompanyTIN)
mReport.SetParameterValue("pHeaderID",Str(me.HeaderID))


pHeaderID is passed AFTER the creation of the report not before, so I think the pre-build takes the default value instead and use it and cannot find the HeaderID value of "333" (your given default). Thus the report is blank.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Studio
  3. # 21
Dale Accepted Answer
Update: I tried changing the parameter pHeaderID value to "1" in Valentina Studio,still the result shows a blank report.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Studio
  3. # 22
Sergey Pashkov Accepted Answer
Hi Dale,

Thank you for the details, I think I recreated your structure but it still works for me from Xojo.

The report query is not executed in the MakeNewReport, but only when it is necessary - like getting the number of pages or printing, so it should not be a problem.

Have you tried also to pass a constant value to parameter, like:
mReport.SetParameterValue("pHeaderID", "1" )
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Studio
  3. # 23
Dale Accepted Answer
My Dear Sergey,

Well, I'll be damned! You hit the nail on the head by suggesting to pass an explicit value instead of a variable. I just found out that I did not handle well the variable used to pass for the parameter to catch. Now my report works! You are a God-send, Sergey! Loads of thanks to you!!!
Attachments (1)
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Studio
  3. # 24
Sergey Pashkov Accepted Answer
You're welcome!
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Studio
  3. # 25
  • Page :
  • 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. 0 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories
Omegabundle
  1. 0 subcategories