I know that I need to add the vb code to the code page of Reporting Service ,
But I want to get a example because of I'm not familiar with coding work.
I've simply used the PI OLEDB Classic provider to set up a linked server to PI in SQL Server. Then I can query PI using the OPENQUERY function in SQL.
I also use this way before，but it takes too long to query the data。
And if i want to get a lot of tag values , you can guess the situation.
I have personally never experienced using code with SQL Server Reporting Services. There seems to have a good example here:
Integrating .NET Code and SQL Server Reporting Services
With this you could potentially use the PI AF SDK to make the data calls, if you are familiar with PI AF SDK that could be a way to go, if not, that will be a longer road to go.
PI SQL Products
This is really important to keep in mind that the PI System is not a relational database. This means that the queries that you generate or write may need to be optimized.
The PI SQL products work quite well but they require a good knowledge of the underlying functionning of the PI System, thus this makes it a product that is more suited for the intermediate/advanced user of the PI Developer Technologies.
We can probably guide you if you explain us what your query should return and what you have written so far. And this is probably the shortest route to get your report done.
There is also some useful resources:
PI OLEDB Provider 2016 User Guide
PI OLEDB SQL Optimization White Paper
Hint to paralellize queries
Retrieving data ...