1. Ben Antwi
  2. Valentina Reports ADK
  3. Вторник, Февраль 22 2022, 09:15 AM
  4.  Подписаться через email
HI,
i'm new to valentina suite. I saw the tutorials on how to download and install valentina studio,valentina server and valentina ADK. I want to embed valentina report in my python code but I can't find any video tutorial on that. i saw saw for java implementation. I would appreciate if I'm assisted with the steps to achieve this task. Thanks in advance.
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
SQLite doesn't have a fixed extension, so you can use *.db instead *.sqlite.
Комментарий
There are no comments made yet.
Ben Antwi Ответ принят
@Sergey Pashkov I'm I doing the right thing? my sqlite database name is product

# Open local project
project = valentina.project.connect('C:/Users/Desktop/PROJECT/V_firstreport.vsp')

# Make report instance
report = project.report(name='Report_FilmList', dsn="C:/Users/Desktop/PROJECT/product.db";)


[/code]
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
It should be something like that:
dsn="sqlite://C:/Users/Desktop/PROJECT/product.db"

We support multiple types of datasources.
Комментарий
There are no comments made yet.
Ben Antwi Ответ принят
@ Sergey Pashkov when I run the code below I get the following error
 [ConnectionParameters] Unable to parse port: /C:/Users/Desktop/PROJECT
. I don't know what I'm doing wrong.Please I need assistance.


# Open local project
project = valentina.project.connect('C:/Users/Desktop/PROJECT/First_Report.vsp')


# Make report instance
report = project.report(name='First_Report', dsn="sqlite://C:/Users/Desktop/PROJECT/product.db")

# Print result as PDF
report.printToDisk('C:/Users/Documents/First_Report.pdf')
Комментарий
There are no comments made yet.
Ben Antwi Ответ принят
I'm running this on windows 10
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Please try to add "file://":

project = valentina.project.connect('file://C:/Users/Desktop/PROJECT/First_Report.vsp')
Комментарий
There are no comments made yet.
Ben Antwi Ответ принят
Error messages is showing no more but I don't see the pdf report output in the specified location
Комментарий
There are no comments made yet.
Ben Antwi Ответ принят
I don't see the saved pdf report in the document folder as shown below.


# Print result as PDF
report.printToDisk('C:/Users/Documents/First_Report.pdf')
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят

'C:/Users/Documents/First_Report.pdf'


Looks unusual. Or you deleted the user name from the path?
Комментарий
There are no comments made yet.
Ben Antwi Ответ принят
Am I doing something wrong
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
The actual path is 'C:/Users/USERNAME/Documents/First_Report.pdf', right?
Комментарий
There are no comments made yet.
Ivan Smahin Ответ принят
What about this one?


dsn="sqlite://path_to_db/myDatabase.db"


BTW, we are sorry for the delay in answering your questions, but Kherson, Ukraine (our city) is currently being attacked by russians.
Комментарий
There are no comments made yet.
Ben Antwi Ответ принят
@Sergey Pashkov Thanks alot I can now get the report saved!!!
Комментарий
There are no comments made yet.
Ben Antwi Ответ принят
Is there a tutorial on how to set parameters to search for all data fields or specific fields from database on report in valentina studio?
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Valentina for Python doesn't have the necessary methods in the current version, we have to create a new build.
Do you only need to run it on Windows now?
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Sorry, reread it again, not very clear.

For example, the base query is SELECT * FROM table1

Conditionally, you need to change it to e.g. SELECT * FROM table1 WHERE f1 > 5

Right, or do you want something else? A little example would help.
Комментарий
There are no comments made yet.
Ben Antwi Ответ принят
@Sergey Pashkov I want to do something like the image below.

I want to set a parameter for any Item No on my report to get specific fields of a particular product including image field.
Example : SELECT * FROM items WHERE item_No =$P(pItemNo);

Thus the Item No can be any Item No not a specific Item No that can display specific XXXXXXX records on report as shown in the image.
Вложения
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
1. Create this query on the project tab and add a parameter with some default value on the Parameters tab of the following dialog (vs_add_parameter_query.png)
2. Create a report with this query
3. Report is generated with a default value of the parameter.

Now the report is generated using the default value.

It is also possible to set the parameter value interactively within the Valentina Studio but in ADK code we use rerport.setParameterValue method (not available in Python yet)
Вложения
Комментарий
There are no comments made yet.
Ben Antwi Ответ принят
@Sergey Pashkov what I mean is I only want the actor_id, first_name and last_name fields only on the report excluding last_update field. How can I set this in Valentina studio? Please see the image attached.
Вложения
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Do you have a Valentina Studio Pro license? Editing is available only in Pro version.
Комментарий
There are no comments made yet.
  • Страница :
  • 1
  • 2
  • 3
  • 4


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